agentel 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +452 -0
- package/agentlog-spec.md +551 -0
- package/bin/agentlog-recall.js +8 -0
- package/bin/agentlog.js +14 -0
- package/docs/code-reference.md +1108 -0
- package/docs/history-source-handling.md +837 -0
- package/docs/release.md +69 -0
- package/package.json +57 -0
- package/src/archive.js +1130 -0
- package/src/autostart.js +182 -0
- package/src/canonical-events.js +575 -0
- package/src/cli.js +7928 -0
- package/src/collector.js +113 -0
- package/src/commands/logs.js +51 -0
- package/src/commands/server.js +11 -0
- package/src/config.js +240 -0
- package/src/doctor.js +102 -0
- package/src/importers/aider.js +553 -0
- package/src/importers/claude.js +349 -0
- package/src/importers/cline.js +471 -0
- package/src/importers/gemini.js +795 -0
- package/src/importers/providers.js +149 -0
- package/src/importers/shared.js +15 -0
- package/src/importers.js +7063 -0
- package/src/mcp.js +148 -0
- package/src/parser-versions.js +62 -0
- package/src/paths.js +61 -0
- package/src/redaction.js +228 -0
- package/src/repo.js +106 -0
- package/src/search.js +619 -0
- package/src/sources.js +86 -0
- package/src/supervisor.js +217 -0
- package/src/sync.js +677 -0
- package/src/version.js +7 -0
- package/src/web-accounts.js +122 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Brian Zhou
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
# agentlog
|
|
2
|
+
|
|
3
|
+
Local-first archive and recall for agent coding sessions.
|
|
4
|
+
|
|
5
|
+
Core capabilities:
|
|
6
|
+
|
|
7
|
+
- raw source-file backup before normalization, so provider history can be
|
|
8
|
+
re-parsed later
|
|
9
|
+
- markdown-primary, redacted local archive under `~/.agentlog/data/agentlog/`
|
|
10
|
+
- canonical event JSONL alongside each transcript for provider-independent search
|
|
11
|
+
- canonical repo keying from git remotes, first commits, or path hashes
|
|
12
|
+
- Codex CLI, Codex Desktop, ChatGPT export, Claude Code CLI, Claude Code
|
|
13
|
+
Desktop, Claude Workspace, Claude.ai export, Gemini CLI, Antigravity,
|
|
14
|
+
Devin CLI, and Cursor imports
|
|
15
|
+
- event-first `agentlog history` search with markdown/transcript fallback
|
|
16
|
+
- `agentlog-recall` MCP stdio server exposing `search_past_sessions`
|
|
17
|
+
- installable recall commands, workflows, skills, and MCP hooks for common
|
|
18
|
+
coding agents
|
|
19
|
+
- local web viewer for full conversation history inspection
|
|
20
|
+
- device-scoped S3-compatible upload sync for backup and future multi-device recall
|
|
21
|
+
- lifecycle, config, autostart, and MCP config helper commands
|
|
22
|
+
- local reset command for starting init from a clean archive/config state
|
|
23
|
+
|
|
24
|
+
The local HTTP OTLP collector, S3-compatible remote sync, and team deployment
|
|
25
|
+
surfaces are configurable extension points for environments that install those
|
|
26
|
+
services.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
Install the CLI globally so agent-facing recall commands can call `agentlog`
|
|
31
|
+
from PATH:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
npm install -g agentlogs
|
|
35
|
+
agentlog init
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
You can also install directly from the GitHub repository. Use a tag or commit
|
|
39
|
+
ref for repeatable installs:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
npm install -g brianlzhou/agentlog
|
|
43
|
+
# or
|
|
44
|
+
npm install -g brianlzhou/agentlog#v0.2.0
|
|
45
|
+
agentlog init
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
You can also install it into a project and run it through npm/npx:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
npm install agentlogs
|
|
52
|
+
npx agentlogs init
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Or run the published package without keeping a local install:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
npx agentlogs init
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Requirements:
|
|
62
|
+
|
|
63
|
+
- Node.js 20 or newer
|
|
64
|
+
- `sqlite3` for Codex, Cursor, and Devin local database imports
|
|
65
|
+
- `rg`/ripgrep for faster history search
|
|
66
|
+
- `unzip` for ZIP web exports
|
|
67
|
+
- `zstd` or `unzstd` for compressed Codex session files
|
|
68
|
+
|
|
69
|
+
Run `agentlog doctor` after install to check optional tools and configured
|
|
70
|
+
sources.
|
|
71
|
+
|
|
72
|
+
## Try From Source
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
npm install
|
|
76
|
+
npm test
|
|
77
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js init --yes --skip-import --no-autostart --no-claude --no-recall --no-telemetry
|
|
78
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source codex-cli --since 30d
|
|
79
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source codex-desktop --since all
|
|
80
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import chatgpt ~/Downloads/chatgpt-export.zip --username you@example.com
|
|
81
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import claude-web ~/Downloads/claude-export --username you --display-name "Personal Claude"
|
|
82
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source claude --since 30d
|
|
83
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source claude-code-desktop --since all
|
|
84
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source claude-workspace --since all
|
|
85
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source gemini-cli --since all
|
|
86
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source antigravity --since all
|
|
87
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source devin-cli --since all
|
|
88
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source cursor --since all
|
|
89
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source cline --since all
|
|
90
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source opencode --since all
|
|
91
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source aider --since all
|
|
92
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js history "database migration issue"
|
|
93
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js reset --yes
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Use `AGENTLOG_HOME=/tmp/agentlog-demo` to test without touching the default
|
|
97
|
+
`~/.agentlog` directory. The `--no-autostart --no-claude --no-recall --no-telemetry`
|
|
98
|
+
flags avoid editing launch-agent, Claude, Codex, Gemini, or Cline settings while
|
|
99
|
+
running from source.
|
|
100
|
+
|
|
101
|
+
Install the source checkout globally while developing:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
npm install -g .
|
|
105
|
+
# or, while developing from this repo:
|
|
106
|
+
npm link
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Then run:
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
agentlog init
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Before publishing a release, run:
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
npm run check
|
|
119
|
+
npm test
|
|
120
|
+
npm run pack:dry
|
|
121
|
+
npm run smoke:pack
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Recall
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
agentlog recall add-to codex
|
|
128
|
+
agentlog recall add-to claude
|
|
129
|
+
agentlog recall add-to gemini
|
|
130
|
+
agentlog recall add-to antigravity
|
|
131
|
+
agentlog recall add-to devin
|
|
132
|
+
agentlog recall add-to cursor
|
|
133
|
+
agentlog recall add-to cline
|
|
134
|
+
agentlog recall add-to opencode
|
|
135
|
+
agentlog recall add-to aider
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
`recall add-to codex` installs the MCP server plus a Codex recall skill.
|
|
139
|
+
`recall add-to claude` installs the MCP server plus a Claude `/recall`
|
|
140
|
+
command plus a Claude skill under `~/.claude/skills/agentlog-recall/SKILL.md`.
|
|
141
|
+
`recall add-to gemini` installs the MCP server plus a Gemini `/recall` command
|
|
142
|
+
under `~/.gemini/commands/recall.toml`.
|
|
143
|
+
|
|
144
|
+
Additional native surfaces are installed where the client exposes one:
|
|
145
|
+
|
|
146
|
+
| Agent | Recall surface |
|
|
147
|
+
| --- | --- |
|
|
148
|
+
| Antigravity | MCP config in `~/.gemini/antigravity/mcp_config.json` plus an Agent Skill at `~/.gemini/antigravity/skills/recall/SKILL.md` |
|
|
149
|
+
| Devin | MCP config in `~/.config/devin/config.json` plus `/recall` skill at `~/.config/devin/skills/recall/SKILL.md` |
|
|
150
|
+
| Cursor | MCP config in `~/.cursor/mcp.json` plus project files `.cursor/commands/recall.md` and `.cursor/rules/agentlog-recall.mdc` |
|
|
151
|
+
| Cline | MCP config in `~/.cline/data/settings/cline_mcp_settings.json` plus `/recall.md` workflow at `~/Documents/Cline/Workflows/recall.md` |
|
|
152
|
+
| OpenCode | MCP config in `~/.config/opencode/opencode.json` plus `/recall` command at `~/.config/opencode/commands/recall.md` |
|
|
153
|
+
| Aider | Loadable recall instructions under `~/.agentlog/aider/`; Aider does not expose a documented custom slash-command registry, so load them with `/load ~/.agentlog/aider/load-recall.aider` or configure the generated markdown as `read:` in `.aider.conf.yml` |
|
|
154
|
+
|
|
155
|
+
The generated recall files use a skill-style layout with command tables,
|
|
156
|
+
workflow steps, query-selection guidance, archive layout notes, and
|
|
157
|
+
troubleshooting. They ask the agent to infer a focused search query, then call
|
|
158
|
+
`agentlog history` and `agentlog show`, so agents do not need direct filesystem
|
|
159
|
+
access to `~/.agentlog`. Users can ask for context naturally, such as `/recall
|
|
160
|
+
the migration bug and update the test`.
|
|
161
|
+
|
|
162
|
+
Skill/command files can also be installed directly:
|
|
163
|
+
|
|
164
|
+
```sh
|
|
165
|
+
agentlog recall install-skill codex
|
|
166
|
+
agentlog recall install-skill claude
|
|
167
|
+
agentlog recall install-skill gemini
|
|
168
|
+
agentlog recall install-skill antigravity
|
|
169
|
+
agentlog recall install-skill devin
|
|
170
|
+
agentlog recall install-skill cursor
|
|
171
|
+
agentlog recall install-skill cline
|
|
172
|
+
agentlog recall install-skill opencode
|
|
173
|
+
agentlog recall install-skill aider
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
The standalone MCP binary remains available for clients that only need the
|
|
177
|
+
tool server:
|
|
178
|
+
|
|
179
|
+
```sh
|
|
180
|
+
agentlog-recall
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Daily CLI
|
|
184
|
+
|
|
185
|
+
`agentlog status`, `agentlog history`, `agentlog show`, `agentlog import`, `agentlog index`, and
|
|
186
|
+
`agentlog autostart` use styled human-readable output by default. Use `--json`
|
|
187
|
+
on `status`, `history`, and import status/results for script-friendly
|
|
188
|
+
structured output. `agentlog status` includes the most recently archived
|
|
189
|
+
conversation threads and the sources currently monitored by the supervisor;
|
|
190
|
+
`agentlog history` is for search and recall.
|
|
191
|
+
|
|
192
|
+
Useful history commands:
|
|
193
|
+
|
|
194
|
+
```sh
|
|
195
|
+
agentlog history
|
|
196
|
+
agentlog history "codebase explanation" --provider codex-cli --limit 10
|
|
197
|
+
agentlog history --repo github.com/acme/widgets --since 90d
|
|
198
|
+
agentlog show <session-id>
|
|
199
|
+
agentlog show <session-id> --path
|
|
200
|
+
agentlog history --web
|
|
201
|
+
agentlog history --web --no-open
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
`agentlog history --web` starts the local conversation viewer and opens it in
|
|
205
|
+
your default browser. Use `--no-open` when you only want to print the local URL
|
|
206
|
+
and keep the server running. The left rail is a
|
|
207
|
+
repo tree sorted by the latest updated session, each folder pages through
|
|
208
|
+
sessions with a load-more control, search results reuse the same session
|
|
209
|
+
reader, and the transcript pane can switch between readable chat bubbles and
|
|
210
|
+
the raw markdown archive. The static viewer uses shadcn/ui-style design tokens
|
|
211
|
+
and compact button/input/select/sidebar patterns without requiring a frontend
|
|
212
|
+
build step. Archives still keep stable `path:<hash>` keys for folders without
|
|
213
|
+
git identity, but the UI displays the local path.
|
|
214
|
+
|
|
215
|
+
Provider filters use one stable order: OpenAI (`codex-cli`, `codex-desktop`,
|
|
216
|
+
`chatgpt`), Anthropic (`claude`, `claude-code-desktop`, `claude-workspace`,
|
|
217
|
+
`claude-web`, `claude-sdk`), Google (`gemini-cli`, `antigravity`), Cognition
|
|
218
|
+
(`devin-cli`), then other local tools (`cursor`, `cline`, `opencode`,
|
|
219
|
+
`aider`).
|
|
220
|
+
|
|
221
|
+
When running, the supervisor polls the watcher source list chosen during init
|
|
222
|
+
every 30 seconds using the configured import window, defaulting to the last 30
|
|
223
|
+
days. The default watcher choices are Codex CLI, Codex Desktop, Claude Code CLI,
|
|
224
|
+
Claude Code Desktop, Claude Workspace, Gemini CLI, Antigravity, Devin CLI,
|
|
225
|
+
Cursor, Cline, OpenCode, and Aider. New configs still support
|
|
226
|
+
`imports.autoDiscoverSources=true`, but init records the chosen watcher list
|
|
227
|
+
exactly by setting `imports.autoDiscoverSources=false`.
|
|
228
|
+
Cursor raw SQLite recovery is intentionally left to explicit imports such as
|
|
229
|
+
`agentlog import --source cursor --since all`; the supervisor handles
|
|
230
|
+
incremental Cursor logs going forward and prunes duplicate transcript snapshots.
|
|
231
|
+
The detailed watcher/import contract, including sourcePath replacement rules for
|
|
232
|
+
multi-session stores such as Cursor SQLite and Devin `sessions.db`, lives in
|
|
233
|
+
[`docs/history-source-handling.md`](docs/history-source-handling.md).
|
|
234
|
+
|
|
235
|
+
Remote sync can be configured during init or from the CLI. Local storage remains
|
|
236
|
+
canonical. Current sync is upload-only: this machine pushes changed archive
|
|
237
|
+
objects to the remote target and never deletes objects from the bucket just
|
|
238
|
+
because they are missing locally.
|
|
239
|
+
|
|
240
|
+
```sh
|
|
241
|
+
agentlog sync \
|
|
242
|
+
--endpoint https://<account-id>.r2.cloudflarestorage.com/<bucket> \
|
|
243
|
+
--device-name "work-laptop" \
|
|
244
|
+
--access-key-id <id> \
|
|
245
|
+
--secret-access-key <key>
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
If you prefer to split the values manually, use
|
|
249
|
+
`--endpoint https://<account-id>.r2.cloudflarestorage.com --bucket <bucket>`.
|
|
250
|
+
|
|
251
|
+
The same values can be supplied with `AGENTLOG_REMOTE_ENDPOINT`,
|
|
252
|
+
`AGENTLOG_REMOTE_BUCKET`, `AGENTLOG_REMOTE_ACCESS_KEY_ID`, and
|
|
253
|
+
`AGENTLOG_REMOTE_SECRET_ACCESS_KEY`. R2 also accepts `R2_ENDPOINT`,
|
|
254
|
+
`R2_BUCKET`, `R2_ACCESS_KEY_ID`, and `R2_SECRET_ACCESS_KEY`.
|
|
255
|
+
|
|
256
|
+
The bucket should already exist before running sync. For Cloudflare R2, copy the
|
|
257
|
+
S3 API URL from the bucket's Settings > General page. Cloudflare may include the
|
|
258
|
+
bucket in that URL, such as
|
|
259
|
+
`https://<account-id>.r2.cloudflarestorage.com/<bucket>`; agentlog accepts that
|
|
260
|
+
and derives the bucket automatically. Create an R2 API token from the R2 Object
|
|
261
|
+
Storage overview with Manage API Tokens, scoped to the agentlog bucket with
|
|
262
|
+
read, write, and list permissions. For AWS S3, use an IAM access key scoped to
|
|
263
|
+
the bucket or `agentlog/` prefix with `ListBucket` and object read/write
|
|
264
|
+
permissions.
|
|
265
|
+
|
|
266
|
+
During `agentlog init`, a configured cloud destination is uploaded immediately
|
|
267
|
+
after the initial backfill. If auto-start is enabled, init also asks for a cloud
|
|
268
|
+
autosync cadence; the background supervisor then uploads new archive changes on
|
|
269
|
+
that interval.
|
|
270
|
+
|
|
271
|
+
Remote objects are namespaced by device so multiple machines can upload into
|
|
272
|
+
one bucket without overwriting each other's archive roots:
|
|
273
|
+
|
|
274
|
+
```text
|
|
275
|
+
s3://<bucket>/agentlog/
|
|
276
|
+
devices/
|
|
277
|
+
work-laptop/
|
|
278
|
+
sessions/...
|
|
279
|
+
raw-sources/...
|
|
280
|
+
indexes/...
|
|
281
|
+
snapshots/
|
|
282
|
+
20260504T173000Z/
|
|
283
|
+
work-laptop/
|
|
284
|
+
sessions/...
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Use `agentlog snapshot` to upload a redundant point-in-time copy under
|
|
288
|
+
`agentlog/snapshots/<timestamp>/<device>/...`:
|
|
289
|
+
|
|
290
|
+
```sh
|
|
291
|
+
agentlog snapshot --name before-reimport
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Receive-only and two-way sync are intentionally not active yet. The intended v1
|
|
295
|
+
shape is to read other device namespaces and merge normalized session metadata
|
|
296
|
+
without treating absence on one machine as a deletion. Remote deletes should be
|
|
297
|
+
an explicit garbage-collection command, not a side effect of sync. For extra
|
|
298
|
+
protection, enable provider-native versioning, retention, or lifecycle rules
|
|
299
|
+
where available so accidental overwrites remain recoverable outside agentlog too.
|
|
300
|
+
|
|
301
|
+
Archived sessions are stored as readable markdown first, with metadata, raw
|
|
302
|
+
transcript JSONL, normalized canonical event JSONL, and a raw source-file folder
|
|
303
|
+
alongside it:
|
|
304
|
+
|
|
305
|
+
```text
|
|
306
|
+
~/.agentlog/data/agentlog/
|
|
307
|
+
sessions/
|
|
308
|
+
repo=<encoded_repo>/
|
|
309
|
+
provider=<provider>/
|
|
310
|
+
year=2026/
|
|
311
|
+
month=04/
|
|
312
|
+
day=27/
|
|
313
|
+
session=<id>.conversation.md
|
|
314
|
+
session=<id>.metadata.json
|
|
315
|
+
session=<id>.transcript.jsonl
|
|
316
|
+
session=<id>.events.jsonl
|
|
317
|
+
session=<id>.raw/
|
|
318
|
+
manifest.json
|
|
319
|
+
001-<original-file-name>
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
For large multi-session stores such as Cursor SQLite, the per-session raw
|
|
323
|
+
manifest may reference one shared copy under `raw-sources/` instead of copying
|
|
324
|
+
the same database into every session folder.
|
|
325
|
+
|
|
326
|
+
`events.jsonl` uses the local `agentlog.events.v1` canonical event shape:
|
|
327
|
+
`session.started`, `prompt.submitted`, `response.generated`, `tool.called`, and
|
|
328
|
+
`tool.completed`. Parser versions are stamped by source type so importer output
|
|
329
|
+
changes can trigger reimport with a new fingerprint. Recall/search builds a
|
|
330
|
+
keyword index over event text first and falls back to transcript/markdown for
|
|
331
|
+
legacy archives without events.
|
|
332
|
+
|
|
333
|
+
Stats are import-time metadata, not viewer-time transcript repair. Archive
|
|
334
|
+
metadata stores message counts, user-message counts, token usage, and models for
|
|
335
|
+
each session, and the web stats view reads those fields directly. During pre-v1
|
|
336
|
+
development, if those stats fields or parser semantics change, rebuild the local
|
|
337
|
+
archive with `agentlog reset --yes`, `agentlog init`, and
|
|
338
|
+
`agentlog import --source all --since all`.
|
|
339
|
+
|
|
340
|
+
ChatGPT and Claude.ai web exports are imported manually from an official `.zip`,
|
|
341
|
+
an unzipped export folder, or a direct JSON file. These imports are stored as
|
|
342
|
+
local scoped web-chat archives and displayed through virtual conversation roots
|
|
343
|
+
such as `[chatgpt]conversations/<account-id>` and
|
|
344
|
+
`[claude]conversations/<account-id>/<project>`. The importer records account
|
|
345
|
+
metadata in `~/.agentlog/state/web-accounts.json`; use
|
|
346
|
+
`agentlog accounts list` to inspect mappings and
|
|
347
|
+
`agentlog accounts rename <provider> <account-id-or-username> --display-name <name>`
|
|
348
|
+
to change the viewer display name. Repeated manual uploads are incremental:
|
|
349
|
+
unchanged conversations are skipped, and updated conversations replace the
|
|
350
|
+
stable session for that provider/account/conversation id. Existing malformed
|
|
351
|
+
pre-v1 web-chat archives are not migrated automatically; reimport from the
|
|
352
|
+
original export after a reset or cleanup.
|
|
353
|
+
|
|
354
|
+
Tool calls and tool results are normalized before archive write where provider
|
|
355
|
+
data is available. For example, Devin tool calls live in
|
|
356
|
+
`message.metadata.toolCalls[]` and render as tool cards in the viewer without
|
|
357
|
+
being appended to assistant prose as synthetic `Grep(...)` text. Canonical
|
|
358
|
+
tool events also carry viewer-facing `category`, `categoryLabel`, `icon`,
|
|
359
|
+
`inputPreview`, and `target` fields so the web viewer can render Bash, edit,
|
|
360
|
+
read, search, web, task, skill, and MCP calls consistently across providers.
|
|
361
|
+
|
|
362
|
+
Use `agentlog reset` to stop agentlog, disable autostart, and remove agentlog's
|
|
363
|
+
local home, config, state, cache, logs, and archive objects. Source application
|
|
364
|
+
histories and MCP configuration files are not changed. Add `--keep-autostart`
|
|
365
|
+
to leave the login item in place.
|
|
366
|
+
|
|
367
|
+
## Import Windows
|
|
368
|
+
|
|
369
|
+
`agentlog init` starts with interactive setup: choose archive destinations,
|
|
370
|
+
choose the full local archive/cache path, choose background service behavior and
|
|
371
|
+
recall commands or skills, then discover sources and optionally backfill history.
|
|
372
|
+
After backfill, init asks which sources the background watcher should keep
|
|
373
|
+
polling, then offers local OTel bridges for Claude Code, Gemini CLI, and Cline.
|
|
374
|
+
Local archive storage is always enabled; R2, S3, and custom remote sync targets
|
|
375
|
+
can be added as upload-only optional destinations with a device name for the
|
|
376
|
+
remote namespace. Discovery and import phases show progress bars while they scan
|
|
377
|
+
local stores.
|
|
378
|
+
|
|
379
|
+
After discovery, init offers a checkbox-style source picker. Claude SDK jobs
|
|
380
|
+
are shown as a separate opt-in source because batch SDK traffic can exceed
|
|
381
|
+
interactive sessions. The selected sources are saved in config and used by
|
|
382
|
+
later `agentlog import --source all` runs unless `--sources` is provided
|
|
383
|
+
explicitly.
|
|
384
|
+
|
|
385
|
+
Default init sources:
|
|
386
|
+
|
|
387
|
+
- Codex CLI sessions and Codex Desktop sessions from Codex state, shown as
|
|
388
|
+
separate toggles
|
|
389
|
+
- Claude Code CLI transcripts from `~/.claude/projects`
|
|
390
|
+
- Claude Code Desktop metadata and Claude Workspace/local-agent sessions from
|
|
391
|
+
the Claude app data, shown as separate toggles
|
|
392
|
+
- Gemini CLI saved chats/checkpoints under `~/.gemini/tmp`, plus session/export JSONL stores with tool, usage, and checkpoint metadata
|
|
393
|
+
- Antigravity task/plan/walkthrough artifacts under `~/.gemini/antigravity/brain`
|
|
394
|
+
- Devin for Terminal sessions from `~/.local/share/devin/cli/sessions.db`
|
|
395
|
+
- Cursor chats from older workspace `state.vscdb` SQLite stores and global
|
|
396
|
+
`cursorDiskKV` Composer/Agent rows, including `aiService` prompt/generation
|
|
397
|
+
fallbacks, raw SQLite salvage from Cursor global/workspace backups and WAL
|
|
398
|
+
files, conservative matching of raw assistant/tool companion fragments back
|
|
399
|
+
to same-project workspace sessions, duplicate prefix pruning, and newer
|
|
400
|
+
`~/.cursor/projects/<project>/agent-transcripts` files
|
|
401
|
+
- Cline task folders from VS Code/JetBrains globalStorage, including checkpoint diffs when present
|
|
402
|
+
- OpenCode JSON session/message/part storage under `~/.local/share/opencode`
|
|
403
|
+
- Aider repo-local `.aider.chat.history.md` transcripts, with `.aider.llm.history`
|
|
404
|
+
model/usage enrichment, `.aider.input.history` backups, and matching auto-commit diffs
|
|
405
|
+
|
|
406
|
+
The Claude Code desktop registry mostly stores metadata pointing back to the
|
|
407
|
+
standard Claude Code transcript, so agentlog imports the transcript when it exists
|
|
408
|
+
and only imports Claude Workspace sessions that contain actual prompt
|
|
409
|
+
content.
|
|
410
|
+
|
|
411
|
+
Windsurf import is disabled for now. Current Cascade transcripts are encrypted
|
|
412
|
+
binary stores, so agentlog can detect that a session exists but cannot archive
|
|
413
|
+
readable conversation text from it yet.
|
|
414
|
+
|
|
415
|
+
For the full source-by-source implementation map, see
|
|
416
|
+
[History Source Handling](docs/history-source-handling.md).
|
|
417
|
+
For the current module and function map, see
|
|
418
|
+
[Code Reference](docs/code-reference.md).
|
|
419
|
+
|
|
420
|
+
`agentlog init` also includes a numbered history-import window picker:
|
|
421
|
+
|
|
422
|
+
- `1` last 30 days
|
|
423
|
+
- `2` last 90 days
|
|
424
|
+
- `3` last 180 days
|
|
425
|
+
- `4` everything
|
|
426
|
+
- `5` custom interval such as `7d`, `12h`, `60m`, or `all`
|
|
427
|
+
- `6` skip
|
|
428
|
+
|
|
429
|
+
The same choices can be run directly:
|
|
430
|
+
|
|
431
|
+
```sh
|
|
432
|
+
agentlog import --source all --since all
|
|
433
|
+
agentlog import --sources codex-cli,codex-desktop,claude,claude-code-desktop,claude-workspace,gemini-cli,antigravity,devin-cli,cursor,cline,opencode,aider --since all
|
|
434
|
+
agentlog import --source codex-desktop --since 90d
|
|
435
|
+
agentlog import --source codex-cli --since 30d
|
|
436
|
+
agentlog import chatgpt ~/Downloads/chatgpt-export.zip --username you@example.com
|
|
437
|
+
agentlog import claude-web ~/Downloads/claude-export --username you --display-name "Personal Claude"
|
|
438
|
+
agentlog import --source claude --since 30d
|
|
439
|
+
agentlog import --source claude-code-desktop --since all
|
|
440
|
+
agentlog import --source claude-workspace --since all
|
|
441
|
+
agentlog import --source gemini-cli --since all
|
|
442
|
+
agentlog import --source antigravity --since all
|
|
443
|
+
agentlog import --source devin-cli --since all
|
|
444
|
+
agentlog import --source cursor --since all
|
|
445
|
+
agentlog import --source cursor --since all --explain-skips
|
|
446
|
+
agentlog import --source cline --since all
|
|
447
|
+
agentlog import --source opencode --since all
|
|
448
|
+
agentlog import --source aider --since all
|
|
449
|
+
agentlog import --source claude-sdk --since all
|
|
450
|
+
agentlog accounts list
|
|
451
|
+
agentlog accounts rename claude-web you --display-name "Personal Claude"
|
|
452
|
+
```
|