chasm-cli 2.0.0

Universal chat session manager - harvest, merge, and analyze AI chat history from VS Code, Cursor, and other editors
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
# CLI Reference


Complete reference for every `chasm` command, organized by function.

## Global Options


```
chasm [OPTIONS] <COMMAND>

Options:
  --verbose, -v       Enable verbose output
  --quiet, -q         Suppress non-essential output
  --help, -h          Show help
  --version, -V       Show version
```

---

## Session Recovery


Commands for recovering lost or orphaned chat sessions.

| Command | Description |
|---|---|
| `chasm fetch path <path>` | Recover sessions for a project path |
| `chasm detect orphaned <path>` | Find orphaned sessions in old workspace hashes |
| `chasm detect orphaned -r <path>` | Recover orphaned sessions to active workspace |
| `chasm detect all <path>` | Full workspace detection and analysis |
| `chasm register all --path <path>` | Register on-disk sessions in VS Code's index |
| `chasm recover extract <path>` | Extract sessions from VS Code recording state |
| `chasm recover upgrade <path>` | Upgrade session format from JSON to JSONL |

### Examples


```bash
# Full recovery workflow

chasm detect orphaned /path/to/project
chasm detect orphaned --recover /path/to/project
chasm register all --force --path /path/to/project

# Quick fetch

chasm fetch path /path/to/project --verbose
```

---

## Listing & Discovery


Commands for browsing workspaces and sessions.

| Command | Description |
|---|---|
| `chasm list workspaces` | List all discovered workspaces |
| `chasm list sessions` | List sessions (optionally filtered) |
| `chasm list orphaned` | List unregistered sessions on disk |
| `chasm find workspace <pattern>` | Search workspaces by name |
| `chasm find session <pattern>` | Search sessions by content |

### Examples


```bash
# List all workspaces

chasm list workspaces

# Filter sessions by workspace

chasm list sessions --workspace abc123

# Search by pattern

chasm find workspace "my-project"
chasm find session "authentication"
```

---

## Viewing Sessions


Commands for inspecting session content.

| Command | Description |
|---|---|
| `chasm show session <id>` | Display full session content |
| `chasm show path <path>` | Show sessions for a project path |

### Examples


```bash
# View a specific session

chasm show session abc123-def4-5678

# View sessions for a project

chasm show path /path/to/project
```

---

## Export & Import


Commands for moving data in and out of Chasm.

| Command | Description |
|---|---|
| `chasm export session <id>` | Export session to file |
| `chasm export path <dest> <path>` | Export sessions for a project |
| `chasm export batch <dest> <paths...>` | Batch export from multiple projects |
| `chasm import <file>` | Import sessions from file |

### Supported Formats


| Format | Extension | Description |
|---|---|---|
| JSON | `.json` | Full session structure |
| JSONL | `.jsonl` | Streaming-friendly line-delimited JSON |
| Markdown | `.md` | Human-readable conversation format |

### Examples


```bash
# Export to markdown

chasm export session abc123 --format markdown --output chat.md

# Batch export

chasm export batch ./backup /project1 /project2 /project3

# Import

chasm import ./backup/session.json
```

---

## Merge & Sync


Commands for combining and synchronizing sessions.

| Command | Description |
|---|---|
| `chasm merge workspace <name>` | Merge sessions from a workspace |
| `chasm sync --pull` | Pull sessions from workspaces to database |
| `chasm sync --push` | Push sessions from database to workspaces |

### Examples


```bash
# Sync all sessions into the database

chasm sync --pull

# Push database sessions back to workspaces

chasm sync --push

# Merge a specific workspace

chasm merge workspace my-project
```

---

## Harvesting


Commands for scanning, collecting, and searching across provider data.

| Command | Description |
|---|---|
| `chasm harvest scan` | Scan for available providers and sessions |
| `chasm harvest run` | Collect sessions from all providers |
| `chasm harvest run --providers <list>` | Collect from specific providers |
| `chasm harvest status` | Show harvest database status |
| `chasm harvest search <query>` | Full-text search across harvested sessions |

### Examples


```bash
# Scan what's available

chasm harvest scan

# Harvest everything

chasm harvest run

# Harvest from specific providers

chasm harvest run --providers copilot,cursor

# Search

chasm harvest search "react component"
chasm harvest search "authentication" --limit 10
```

---

## Agency (Agent Development Kit)


Commands for building and running AI agents.

| Command | Description |
|---|---|
| `chasm agency list` | List available agents and roles |
| `chasm agency list --verbose` | Detailed agent listing |
| `chasm agency info <agent>` | Get detailed agent information |
| `chasm agency run --agent <name> <prompt>` | Run an agent with a prompt |
| `chasm agency run --orchestration <mode> <prompt>` | Multi-agent orchestration |
| `chasm agency create <name>` | Create a custom agent |
| `chasm agency tools` | List available tools |
| `chasm agency templates` | List agent templates |
| `chasm agency modes` | List orchestration modes |

### Agent Roles


| Role | Icon | Description |
|---|---|---|
| `coordinator` | `[C]` | Manages and delegates tasks |
| `researcher` | `[R]` | Gathers information and analyzes data |
| `coder` | `[D]` | Writes and modifies code |
| `reviewer` | `[V]` | Reviews code and provides feedback |
| `executor` | `[E]` | Executes commands and tools |
| `writer` | `[W]` | Creates documentation and content |
| `tester` | `[T]` | Writes and runs tests |
| `analyst` | `[A]` | Data analysis and insights |
| `household` | `[H]` | Home automation and management |
| `business` | `[B]` | Business process automation |
| `custom` | `[X]` | User-defined agent |

### Orchestration Modes


| Mode | Pattern | Description |
|---|---|---|
| `single` | `[1]` | Traditional single-agent response |
| `sequential` | `[>]` | Agents execute one after another |
| `parallel` | `[‖]` | Multiple agents work simultaneously |
| `loop` | `[O]` | Agent repeats until condition met |
| `hierarchical` | `[H]` | Lead agent delegates to sub-agents |
| `swarm` | `[S]` | Multiple agents collaborate with a coordinator |

### Examples


```bash
# Single agent

chasm agency run --agent researcher "Latest trends in AI safety"
chasm agency run --agent coder --model gpt-4o "Write a REST API in Rust"

# Multi-agent

chasm agency run --orchestration sequential "Build and test a web scraper"
chasm agency run --orchestration parallel "Research AI, blockchain, and quantum"
chasm agency run --orchestration swarm "Design a microservices architecture"

# Custom agent

chasm agency create my-rust-expert --role coder \
  --instruction "You are a Rust expert"
```

---

## Run (Provider Chat)


Interactive chat commands that route to specific AI providers.

| Command | Description |
|---|---|
| `chasm run ollama` | Chat with local Ollama |
| `chasm run claude` | Chat with Claude (Anthropic) |
| `chasm run chatgpt` | Chat with ChatGPT (OpenAI) |
| `chasm run gemini` | Chat with Gemini (Google) |
| `chasm run perplexity` | Chat with Perplexity |
| `chasm run lmstudio` | Chat with LM Studio |
| `chasm run gpt4all` | Chat with GPT4All |
| `chasm run localai` | Chat with LocalAI |
| `chasm run llamafile` | Chat with llamafile |

### Examples


```bash
# Local chat with Ollama

chasm run ollama --model mistral

# Cloud chat

chasm run claude --model claude-sonnet-4-20250514
chasm run chatgpt --model gpt-4o
```

---

## Server


Commands for running Chasm as a service.

| Command | Description |
|---|---|
| `chasm api serve` | Start the REST API server |
| `chasm api serve --port <port>` | Start on a specific port |
| `chasm api serve --host <host>` | Bind to a specific host |
| `chasm mcp serve` | Start the MCP tool server |

### Examples


```bash
# Start API server

chasm api serve --host 0.0.0.0 --port 8787

# Start MCP server

chasm mcp serve
```

---

## Interactive Tools


| Command | Description |
|---|---|
| `chasm tui` | Launch the terminal UI browser |
| `chasm browse` | Open interactive session browser |

---

## Git Integration


| Command | Description |
|---|---|
| `chasm git init <path>` | Initialize git versioning for sessions |
| `chasm git commit <path>` | Commit current session state |
| `chasm git log <path>` | View session version history |
| `chasm git diff <path>` | Compare session versions |

### Examples


```bash
# Version your chat sessions with git

chasm git init /path/to/project
chasm git commit /path/to/project -m "After auth implementation"
chasm git log /path/to/project
```

---

## Watch (File-System Monitor)


Watch agent session directories for changes and auto-harvest new sessions.

| Command | Description |
|---|---|
| `chasm watch` | Watch all known agent directories for changes |
| `chasm watch --agent <name>` | Watch a specific agent's session directory |
| `chasm watch --path <dir>` | Watch a custom directory path |
| `chasm watch --no-harvest` | Detect changes without harvesting (dry-run) |

### Options


| Flag | Default | Description |
|---|---|---|
| `--agent, -a` || Watch a specific agent (e.g., `claude`, `gemini`, `codex`) |
| `--path, -p` || Watch a custom path instead of agent directories |
| `--debounce, -d` | `3` | Debounce interval in seconds before harvesting |
| `--no-harvest` | `false` | Detect changes without harvesting |
| `--verbose, -v` | `false` | Show detailed file change events |

### Examples


```bash
# Watch all agent directories

chasm watch

# Watch only Claude Code sessions

chasm watch --agent claude

# Watch a custom directory with verbose output

chasm watch --path /path/to/sessions --verbose

# Dry-run: see changes without harvesting

chasm watch --no-harvest --debounce 5
```

---

## Provider Management


Commands for managing LLM provider configuration and connectivity.

| Command | Description |
|---|---|
| `chasm provider list` | List all discovered LLM providers |
| `chasm provider info <name>` | Show detailed info about a provider |
| `chasm provider config <name>` | Configure a provider's settings |
| `chasm provider test <name>` | Test connection to a provider |
| `chasm provider import --from <name>` | Import sessions from another provider |

### Configuration Options


```bash
chasm provider config ollama \
  --endpoint http://localhost:11434 \
  --model mistral \
  --enabled true

chasm provider config openai \
  --api-key sk-... \
  --model gpt-4o
```

### Examples


```bash
# List all providers

chasm provider list

# Check a provider

chasm provider info ollama
chasm provider test ollama

# Import sessions from Cursor into current project

chasm provider import --from cursor --path .
```

---

## Shell Completions


Generate shell completions for your preferred shell.

| Command | Description |
|---|---|
| `chasm completions bash` | Generate Bash completions |
| `chasm completions zsh` | Generate Zsh completions |
| `chasm completions fish` | Generate Fish completions |
| `chasm completions powershell` | Generate PowerShell completions |
| `chasm completions elvish` | Generate Elvish completions |

### Installation


```bash
# Bash (add to ~/.bashrc)
chasm completions bash > ~/.local/share/bash-completion/completions/chasm


# Zsh (add to fpath)

chasm completions zsh > ~/.zfunc/_chasm

# Fish

chasm completions fish > ~/.config/fish/completions/chasm.fish

# PowerShell (add to $PROFILE)

chasm completions powershell >> $PROFILE
```

---

## Doctor (Diagnostics)


Check system environment, providers, and configuration health.

| Command | Description |
|---|---|
| `chasm doctor` | Run basic environment checks |
| `chasm doctor --full` | Run all checks including network connectivity |
| `chasm doctor --format json` | Output results as JSON |
| `chasm doctor --fix` | Attempt to fix detected issues automatically |

### Checks Performed


| Category | Check | Requires `--full` |
|---|---|---|
| System | Chasm version | No |
| System | Rust version | No |
| System | Operating system | No |
| Storage | VS Code session storage | No |
| Storage | Cursor session storage | No |
| Storage | Harvest database | No |
| Provider | Claude Code CLI | No |
| Provider | Codex CLI (OpenAI) | No |
| Provider | Gemini CLI (Google) | No |
| Tools | Git | No |
| Tools | SQLite | No |
| Network | Ollama server | Yes |
| Network | LM Studio server | Yes |
| Network | Chasm API server | Yes |

### Examples


```bash
# Quick check

chasm doctor

# Full check with network tests

chasm doctor --full

# JSON output for scripting

chasm doctor --format json

# Auto-fix issues

chasm doctor --fix
```

---

## Telemetry


| Command | Description |
|---|---|
| `chasm telemetry status` | Show telemetry status |
| `chasm telemetry enable` | Enable anonymous telemetry |
| `chasm telemetry disable` | Disable telemetry |

!!! info "Privacy"
    Telemetry is opt-in and anonymous. No session content is ever transmitted.