context-forge-cli 0.4.14__tar.gz → 0.4.16__tar.gz

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.
Files changed (79) hide show
  1. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/AGENTS.md +4 -4
  2. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/PKG-INFO +81 -49
  3. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/README.md +79 -47
  4. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/adapters/codex.py +94 -12
  5. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/adapters/pi.py +40 -1
  6. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/cli.py +51 -24
  7. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/core/db.py +130 -2
  8. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/core/scanner.py +4 -1
  9. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/core/token_analyzer.py +20 -1
  10. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/mcp_server.py +15 -1
  11. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/tui/widgets/session_detail.py +1 -1
  12. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/tui/widgets/session_table.py +125 -25
  13. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/tui/widgets/status_bar.py +13 -2
  14. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/tui/widgets/tokens_panel.py +2 -2
  15. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/utils/display.py +69 -11
  16. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/pyproject.toml +6 -3
  17. context_forge_cli-0.4.16/tests/adapters/test_codex.py +205 -0
  18. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/adapters/test_pi.py +28 -0
  19. context_forge_cli-0.4.16/tests/core/test_db.py +228 -0
  20. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/core/test_display.py +58 -3
  21. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/core/test_token_analyzer.py +8 -2
  22. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/test_mcp_server.py +4 -1
  23. context_forge_cli-0.4.16/tests/test_tui_table.py +128 -0
  24. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/uv.lock +2 -2
  25. context_forge_cli-0.4.14/tests/core/test_db.py +0 -76
  26. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/.contextforge.toml +0 -0
  27. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/.github/workflows/publish.yml +0 -0
  28. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/.gitignore +0 -0
  29. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/.python-version +0 -0
  30. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/PLAN.md +0 -0
  31. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/__init__.py +0 -0
  32. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/adapters/__init__.py +0 -0
  33. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/adapters/altimate_code.py +0 -0
  34. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/adapters/antigravity.py +0 -0
  35. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/adapters/base.py +0 -0
  36. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/adapters/claude_code.py +0 -0
  37. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/adapters/claude_desktop.py +0 -0
  38. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/adapters/cursor.py +0 -0
  39. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/adapters/datatzis.py +0 -0
  40. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/adapters/gemini.py +0 -0
  41. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/adapters/registry.py +0 -0
  42. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/core/__init__.py +0 -0
  43. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/core/analytics.py +0 -0
  44. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/core/compactor.py +0 -0
  45. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/core/injector.py +0 -0
  46. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/core/summarizer.py +0 -0
  47. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/models/__init__.py +0 -0
  48. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/models/config.py +0 -0
  49. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/models/session.py +0 -0
  50. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/tui/__init__.py +0 -0
  51. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/tui/app.py +0 -0
  52. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/tui/clipboard.py +0 -0
  53. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/tui/styles.tcss +0 -0
  54. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/tui/widgets/__init__.py +0 -0
  55. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/tui/widgets/stats_panel.py +0 -0
  56. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/tui/widgets/transfer_panel.py +0 -0
  57. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/utils/__init__.py +0 -0
  58. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/contextforge/utils/tokens.py +0 -0
  59. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/__init__.py +0 -0
  60. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/adapters/__init__.py +0 -0
  61. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/adapters/test_antigravity.py +0 -0
  62. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/adapters/test_claude_code.py +0 -0
  63. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/adapters/test_cursor.py +0 -0
  64. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/adapters/test_datatzis.py +0 -0
  65. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/conftest.py +0 -0
  66. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/core/__init__.py +0 -0
  67. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/core/test_compactor.py +0 -0
  68. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/core/test_injector.py +0 -0
  69. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/core/test_summarizer.py +0 -0
  70. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/fixtures/claude_session_sample.jsonl +0 -0
  71. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/fixtures/datatzis/my-repo/.datatzis/tasks/22222222222222222222222222222222.json +0 -0
  72. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/fixtures/datatzis/my-repo/.datatzis/tasks/33333333333333333333333333333333.json +0 -0
  73. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/fixtures/datatzis/my-repo/.datatzis/workspaces/11111111111111111111111111111111.json +0 -0
  74. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/fixtures/datatzis/my-repo/.datatzis/workspaces/99999999999999999999999999999999.json +0 -0
  75. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/fixtures/pi/--home-dev-project-a-/2026-01-15T10-30-00-000Z_a1b2c3d4-0000-4000-8000-000000000001/e5f61122-3333-4444-5555-666677778888/run-0/session.jsonl +0 -0
  76. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/fixtures/pi/--home-dev-project-a-/2026-01-15T10-30-00-000Z_a1b2c3d4-0000-4000-8000-000000000001/e5f61122-3333-4444-5555-666677778888/run-1/session.jsonl +0 -0
  77. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/fixtures/pi/--home-dev-project-a-/2026-01-15T10-30-00-000Z_a1b2c3d4-0000-4000-8000-000000000001.jsonl +0 -0
  78. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/fixtures/pi/--home-dev-project-a-/2026-01-15T11-20-00-000Z_c9d8e7f6-0000-4000-8000-000000000003.jsonl +0 -0
  79. {context_forge_cli-0.4.14 → context_forge_cli-0.4.16}/tests/test_tui_detail.py +0 -0
@@ -5,15 +5,15 @@ safely and effectively on this repository.
5
5
 
6
6
  ## Project Overview
7
7
 
8
- ContextForge is a Python CLI/TUI tool. Entry point: `contextforge/cli.py` (command: `cf`).
8
+ ContextForge is a Python CLI/TUI tool. Entry point: `contextforge/cli.py` (command: `cforge` / `cfg`).
9
9
  Core modules: `adapters/`, `core/`, `models/`, `tui/`. Tests: `tests/`.
10
10
 
11
11
  ## Setup
12
12
 
13
13
  ```bash
14
- uv sync # install all dependencies
15
- uv run pytest # run the test suite
16
- uv run cf --help # run the CLI locally
14
+ uv sync # install all dependencies
15
+ uv run pytest # run the test suite
16
+ uv run cforge --help # run the CLI locally
17
17
  ```
18
18
 
19
19
  ## Hard Invariants — Never Violate These
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: context-forge-cli
3
- Version: 0.4.14
3
+ Version: 0.4.16
4
4
  Summary: Session manager and context bridge for agentic CLI tools
5
5
  Project-URL: Homepage, https://github.com/emmver/contextforge
6
6
  Project-URL: Repository, https://github.com/emmver/contextforge
@@ -18,7 +18,7 @@ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
18
18
  Classifier: Topic :: Utilities
19
19
  Requires-Python: >=3.13
20
20
  Requires-Dist: anthropic>=0.89.0
21
- Requires-Dist: mcp>=1.9.0
21
+ Requires-Dist: mcp<2,>=1.9.0
22
22
  Requires-Dist: pydantic>=2.12.5
23
23
  Requires-Dist: rich>=14.3.3
24
24
  Requires-Dist: sqlite-utils>=3.39
@@ -31,7 +31,7 @@ Description-Content-Type: text/markdown
31
31
 
32
32
  **Session manager and context bridge for agentic CLI tools.**
33
33
 
34
- ContextForge (`cf`) tracks sessions from Claude Code, Claude Desktop, Codex, Gemini, altimate-code, and other
34
+ ContextForge (`cforge` / `cfg`) tracks sessions from Claude Code, Claude Desktop, Codex, Gemini, altimate-code, and other
35
35
  agentic CLI tools. It generates plain-English summaries of each session and can compact
36
36
  and transfer context from one or more sessions into a new session — within the same tool
37
37
  or across different tools.
@@ -67,79 +67,81 @@ pipx install context-forge-cli
67
67
  git clone https://github.com/emmver/contextforge.git
68
68
  cd contextforge
69
69
  uv sync
70
- uv run cf --help
70
+ uv run cforge --help
71
71
  ```
72
72
 
73
73
  ### Verify installation
74
74
  ```bash
75
- cf --help # Should show the CLI with all commands
76
- cf config # Show or edit configuration
75
+ cforge --help # Should show the CLI with all commands
76
+ cforge config # Show or edit configuration
77
77
  ```
78
78
 
79
+ > **Note**: `cforge`, `cfg`, and `contextforge` are all installed as entrypoints. You can use whichever prefix you prefer (`cforge` or `cfg`).
80
+
79
81
  ## Quick Start
80
82
 
81
83
  ### 1. Scan for sessions
82
84
  ```bash
83
- cf scan # discover and index sessions from all installed tools
85
+ cforge scan # discover and index sessions from all installed tools
84
86
  ```
85
87
  This reads tool-native storage and builds a local SQLite index at `~/.contextforge/contextforge.db`.
86
88
  First run typically takes a few seconds depending on session count.
87
89
 
88
90
  ### 2. List and explore sessions
89
91
  ```bash
90
- cf ls # list all recent sessions (with summaries if available)
91
- cf ls --format json # machine-readable output
92
- cf show <id> # show full detail + summary for a specific session
92
+ cforge ls # list all recent sessions (with summaries if available)
93
+ cforge ls --format json # machine-readable output
94
+ cforge show <id> # show full detail + summary for a specific session
93
95
  ```
94
96
 
95
97
  ### 3. Generate summaries (optional)
96
98
  ```bash
97
- cf summarize --all # generate summaries for all unsummarized sessions
98
- cf summarize <id> # refresh summary for a single session
99
- cf summarize --all --force # regenerate all summaries (e.g., after config change)
99
+ cforge summarize --all # generate summaries for all unsummarized sessions
100
+ cforge summarize <id> # refresh summary for a single session
101
+ cforge summarize --all --force # regenerate all summaries (e.g., after config change)
100
102
  ```
101
103
  Summaries require an Anthropic API key (see [Configuration](#configuration) below).
102
104
 
103
105
  ### 4. Launch the dashboard
104
106
  ```bash
105
- cf dashboard # interactive TUI with live session browser
107
+ cforge dashboard # interactive TUI with live session browser
106
108
  ```
107
109
 
108
110
  ### 5. Transfer context to a new session
109
111
  ```bash
110
112
  # Preview the context bundle
111
- cf compact <session-id>
113
+ cforge compact <session-id>
112
114
 
113
115
  # Inject context into a new Claude Code session
114
- cf transfer <session-id> --to claude_code --execute
116
+ cforge transfer <session-id> --to claude_code --execute
115
117
 
116
118
  # Inject into Codex with richer context
117
- cf transfer <session-id> --to codex --strategy key_messages --execute
119
+ cforge transfer <session-id> --to codex --strategy key_messages --execute
118
120
  ```
119
121
 
120
122
  ## Context Transfer
121
123
 
122
124
  ```bash
123
125
  # Preview: compact a session into a ContextBundle and display it
124
- cf compact <session-id>
126
+ cforge compact <session-id>
125
127
 
126
128
  # Save a bundle to the DB for later reuse
127
- cf compact <session-id> --save
129
+ cforge compact <session-id> --save
128
130
 
129
131
  # Preview: show the exact command that would inject context into a new Codex session
130
- cf transfer <session-id> --to codex
132
+ cforge transfer <session-id> --to codex
131
133
 
132
134
  # Execute: launch a new Codex session with context injected
133
- cf transfer <session-id> --to codex --execute
135
+ cforge transfer <session-id> --to codex --execute
134
136
 
135
137
  # Multi-session bundle → altimate-code, richer key_messages strategy
136
- cf transfer <id1> <id2> --to altimate-code --strategy key_messages --execute
138
+ cforge transfer <id1> <id2> --to altimate-code --strategy key_messages --execute
137
139
 
138
140
  # Resume an existing session with injected context
139
- cf transfer <id> --to claude_code --session <existing-session-id> --execute
141
+ cforge transfer <id> --to claude_code --session <existing-session-id> --execute
140
142
 
141
143
  # Machine-readable output
142
- cf transfer <id> --to codex --format json
144
+ cforge transfer <id> --to codex --format json
143
145
  ```
144
146
 
145
147
  ### Injection methods
@@ -180,7 +182,10 @@ Notes:
180
182
  - **Sub-agent tracking** — sessions spawned by sub-agents are tracked and cross-linked: Pi
181
183
  (`pi-subagents`) child transcripts get `subagent` + `parent:<session-id>` tags naming the
182
184
  parent session; the datatzis harness's orchestrator tasks (one per user prompt) get
183
- `subagent` + `workspace:<session-id>` tags.
185
+ `subagent` + `workspace:<session-id>` tags. Surfaces are parent-first: `cforge ls` shows only
186
+ main sessions unless `--all` is passed, and in the TUI dashboard sub-agents stay hidden
187
+ until you select their parent row, which nests them underneath as an indented `↳` list —
188
+ selecting the parent again collapses them.
184
189
  - **datatzis discovery** — per-repo storage: ContextForge scans repository roots for
185
190
  `*/.datatzis/workspaces/` (up to two levels deep). Configure roots via the
186
191
  `DATATZIS_SEARCH_ROOTS` environment variable (colon-separated; default `~/Documents/Github`).
@@ -192,12 +197,12 @@ Notes:
192
197
  ContextForge generates plain-English summaries of what each session accomplished.
193
198
 
194
199
  ```bash
195
- cf summarize <id> # generate or refresh summary for one session
196
- cf summarize --all # bulk-generate summaries for all sessions
197
- cf summarize --all --force # regenerate even existing ones
200
+ cforge summarize <id> # generate or refresh summary for one session
201
+ cforge summarize --all # bulk-generate summaries for all sessions
202
+ cforge summarize --all --force # regenerate even existing ones
198
203
 
199
204
  # Scan + summarize in one step
200
- cf scan --summarize
205
+ cforge scan --summarize
201
206
  ```
202
207
 
203
208
  **How summaries work:**
@@ -205,7 +210,7 @@ cf scan --summarize
205
210
  2. **All tools** — calls the Claude API (Haiku model) to produce a 3–5 sentence summary
206
211
  3. **No API key** — falls back to showing the first user message as a preview
207
212
 
208
- Summaries are cached in the local SQLite index and shown in `cf ls` and `cf show`.
213
+ Summaries are cached in the local SQLite index and shown in `cforge ls` and `cforge show`.
209
214
 
210
215
  ## Configuration
211
216
 
@@ -213,9 +218,9 @@ Config file: `~/.contextforge/config.toml` (created on first run)
213
218
 
214
219
  ### Manage config from CLI
215
220
  ```bash
216
- cf config show # display current config
217
- cf config set llm.api_key sk-ant-...
218
- cf config set compactor.default_strategy key_messages
221
+ cforge config show # display current config
222
+ cforge config set llm.api_key sk-ant-...
223
+ cforge config set compactor.default_strategy key_messages
219
224
  ```
220
225
 
221
226
  ### Full reference
@@ -249,9 +254,9 @@ It **never modifies** tool-native storage. All source files are read-only.
249
254
  All structured commands support `--format json`:
250
255
 
251
256
  ```bash
252
- cf ls --format json
253
- cf show <id> --format json
254
- cf compact <id> --format json
257
+ cforge ls --format json
258
+ cforge show <id> --format json
259
+ cforge compact <id> --format json
255
260
  ```
256
261
 
257
262
  See [AGENTS.md](AGENTS.md) for contribution guidelines and [PLAN.md](PLAN.md) for development status.
@@ -259,7 +264,7 @@ See [AGENTS.md](AGENTS.md) for contribution guidelines and [PLAN.md](PLAN.md) fo
259
264
  ## TUI Dashboard
260
265
 
261
266
  ```bash
262
- cf dashboard
267
+ cforge dashboard
263
268
  ```
264
269
 
265
270
  A full-screen Textual dashboard with live session browsing, filtering, and analytics.
@@ -329,7 +334,7 @@ ContextForge ships a [Model Context Protocol](https://modelcontextprotocol.io) s
329
334
 
330
335
  ```bash
331
336
  # Run directly (after installation)
332
- cf-mcp
337
+ cforge-mcp # or the legacy alias: cf-mcp
333
338
 
334
339
  # From source
335
340
  uv run python -m contextforge.mcp_server
@@ -387,22 +392,49 @@ Add to `~/.gemini/settings.json` (global) or `.gemini/settings.json` (project):
387
392
  }
388
393
  ```
389
394
 
395
+ #### pi
396
+
397
+ ```bash
398
+ pi mcp add contextforge -- cforge-mcp
399
+ pi mcp list # → contextforge: connected, 7 tools
400
+ ```
401
+
402
+ Or add to `~/.pi/agent/mcp.json`:
403
+ ```json
404
+ {
405
+ "mcpServers": {
406
+ "contextforge": {
407
+ "command": "cforge-mcp"
408
+ }
409
+ }
410
+ }
411
+ ```
412
+
390
413
  #### Antigravity
391
414
 
392
- Add to `mcp_servers.json` in your project root:
415
+ ```bash
416
+ agy mcp add contextforge cforge-mcp
417
+ agy mcp list
418
+ ```
419
+
420
+ This writes to `~/.gemini/config/mcp_config.json`. Equivalently, in a project-level `mcp_servers.json`:
393
421
  ```json
394
422
  {
395
423
  "servers": [
396
424
  {
397
425
  "name": "contextforge",
398
426
  "transport": "stdio",
399
- "command": "cf-mcp",
427
+ "command": "cforge-mcp",
400
428
  "enabled": true
401
429
  }
402
430
  ]
403
431
  }
404
432
  ```
405
433
 
434
+ > **Note:** the server uses the `FastMCP` API from `mcp` 1.x, so `pyproject.toml` pins `mcp>=1.9.0,<2`.
435
+ > If an existing install fails with `ModuleNotFoundError: mcp.server.fastmcp`, reinstall with
436
+ > `uv tool install --force --editable .`.
437
+
406
438
  ### Tools
407
439
 
408
440
  | Tool | Description |
@@ -428,36 +460,36 @@ All tools are **read-only** and accept a `window` parameter of `7d`, `30d`, `6m`
428
460
 
429
461
  ## Troubleshooting
430
462
 
431
- ### `command not found: cf`
463
+ ### `command not found: cforge`
432
464
  - **Cause**: Tool not in PATH after installation
433
465
  - **Fix**: Restart your shell, or reinstall: `uv tool install contextforge --force`
434
466
 
435
- ### `RuntimeError: no sessions found` or empty `cf ls`
467
+ ### `RuntimeError: no sessions found` or empty `cforge ls`
436
468
  - **Cause**: No sessions discovered from installed tools
437
- - **Fix**: Run `cf scan` first; check that you have Claude Code/Codex/altimate-code with session history
469
+ - **Fix**: Run `cforge scan` first; check that you have Claude Code/Codex/altimate-code with session history
438
470
 
439
471
  ### `ANTHROPIC_API_KEY not set` warning
440
472
  - **Cause**: No API key configured for summaries
441
- - **Fix**: Set it via `cf config set llm.api_key sk-ant-...` or set `ANTHROPIC_API_KEY` env var
473
+ - **Fix**: Set it via `cforge config set llm.api_key sk-ant-...` or set `ANTHROPIC_API_KEY` env var
442
474
  - **Note**: Summaries are optional; you can still use ContextForge without API keys
443
475
 
444
476
  ### Session not appearing after tool update
445
477
  - **Cause**: Tool storage location changed or was not yet indexed
446
- - **Fix**: Run `cf scan` again to reindex all tools
478
+ - **Fix**: Run `cforge scan` again to reindex all tools
447
479
 
448
- ### `cf dashboard` crashes or displays incorrectly
480
+ ### `cforge dashboard` crashes or displays incorrectly
449
481
  - **Cause**: Terminal size too small or unsupported terminal type
450
482
  - **Fix**: Resize terminal to at least 80x24; try a different terminal emulator
451
483
 
452
484
  ### Database locked / concurrent access error
453
- - **Cause**: Two `cf` commands running at once
454
- - **Fix**: Wait for the first command to finish, or delete `~/.contextforge/contextforge.db` and run `cf scan` again
485
+ - **Cause**: Two `cforge` commands running at once
486
+ - **Fix**: Wait for the first command to finish, or delete `~/.contextforge/contextforge.db` and run `cforge scan` again
455
487
 
456
488
  ## Development
457
489
 
458
490
  ```bash
459
491
  uv sync # install all dependencies including dev
460
492
  uv run pytest # run tests
461
- uv run cf --help # run CLI locally
493
+ uv run cforge --help # run CLI locally
462
494
  uv tool install . --force # test local installation
463
495
  ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Session manager and context bridge for agentic CLI tools.**
4
4
 
5
- ContextForge (`cf`) tracks sessions from Claude Code, Claude Desktop, Codex, Gemini, altimate-code, and other
5
+ ContextForge (`cforge` / `cfg`) tracks sessions from Claude Code, Claude Desktop, Codex, Gemini, altimate-code, and other
6
6
  agentic CLI tools. It generates plain-English summaries of each session and can compact
7
7
  and transfer context from one or more sessions into a new session — within the same tool
8
8
  or across different tools.
@@ -38,79 +38,81 @@ pipx install context-forge-cli
38
38
  git clone https://github.com/emmver/contextforge.git
39
39
  cd contextforge
40
40
  uv sync
41
- uv run cf --help
41
+ uv run cforge --help
42
42
  ```
43
43
 
44
44
  ### Verify installation
45
45
  ```bash
46
- cf --help # Should show the CLI with all commands
47
- cf config # Show or edit configuration
46
+ cforge --help # Should show the CLI with all commands
47
+ cforge config # Show or edit configuration
48
48
  ```
49
49
 
50
+ > **Note**: `cforge`, `cfg`, and `contextforge` are all installed as entrypoints. You can use whichever prefix you prefer (`cforge` or `cfg`).
51
+
50
52
  ## Quick Start
51
53
 
52
54
  ### 1. Scan for sessions
53
55
  ```bash
54
- cf scan # discover and index sessions from all installed tools
56
+ cforge scan # discover and index sessions from all installed tools
55
57
  ```
56
58
  This reads tool-native storage and builds a local SQLite index at `~/.contextforge/contextforge.db`.
57
59
  First run typically takes a few seconds depending on session count.
58
60
 
59
61
  ### 2. List and explore sessions
60
62
  ```bash
61
- cf ls # list all recent sessions (with summaries if available)
62
- cf ls --format json # machine-readable output
63
- cf show <id> # show full detail + summary for a specific session
63
+ cforge ls # list all recent sessions (with summaries if available)
64
+ cforge ls --format json # machine-readable output
65
+ cforge show <id> # show full detail + summary for a specific session
64
66
  ```
65
67
 
66
68
  ### 3. Generate summaries (optional)
67
69
  ```bash
68
- cf summarize --all # generate summaries for all unsummarized sessions
69
- cf summarize <id> # refresh summary for a single session
70
- cf summarize --all --force # regenerate all summaries (e.g., after config change)
70
+ cforge summarize --all # generate summaries for all unsummarized sessions
71
+ cforge summarize <id> # refresh summary for a single session
72
+ cforge summarize --all --force # regenerate all summaries (e.g., after config change)
71
73
  ```
72
74
  Summaries require an Anthropic API key (see [Configuration](#configuration) below).
73
75
 
74
76
  ### 4. Launch the dashboard
75
77
  ```bash
76
- cf dashboard # interactive TUI with live session browser
78
+ cforge dashboard # interactive TUI with live session browser
77
79
  ```
78
80
 
79
81
  ### 5. Transfer context to a new session
80
82
  ```bash
81
83
  # Preview the context bundle
82
- cf compact <session-id>
84
+ cforge compact <session-id>
83
85
 
84
86
  # Inject context into a new Claude Code session
85
- cf transfer <session-id> --to claude_code --execute
87
+ cforge transfer <session-id> --to claude_code --execute
86
88
 
87
89
  # Inject into Codex with richer context
88
- cf transfer <session-id> --to codex --strategy key_messages --execute
90
+ cforge transfer <session-id> --to codex --strategy key_messages --execute
89
91
  ```
90
92
 
91
93
  ## Context Transfer
92
94
 
93
95
  ```bash
94
96
  # Preview: compact a session into a ContextBundle and display it
95
- cf compact <session-id>
97
+ cforge compact <session-id>
96
98
 
97
99
  # Save a bundle to the DB for later reuse
98
- cf compact <session-id> --save
100
+ cforge compact <session-id> --save
99
101
 
100
102
  # Preview: show the exact command that would inject context into a new Codex session
101
- cf transfer <session-id> --to codex
103
+ cforge transfer <session-id> --to codex
102
104
 
103
105
  # Execute: launch a new Codex session with context injected
104
- cf transfer <session-id> --to codex --execute
106
+ cforge transfer <session-id> --to codex --execute
105
107
 
106
108
  # Multi-session bundle → altimate-code, richer key_messages strategy
107
- cf transfer <id1> <id2> --to altimate-code --strategy key_messages --execute
109
+ cforge transfer <id1> <id2> --to altimate-code --strategy key_messages --execute
108
110
 
109
111
  # Resume an existing session with injected context
110
- cf transfer <id> --to claude_code --session <existing-session-id> --execute
112
+ cforge transfer <id> --to claude_code --session <existing-session-id> --execute
111
113
 
112
114
  # Machine-readable output
113
- cf transfer <id> --to codex --format json
115
+ cforge transfer <id> --to codex --format json
114
116
  ```
115
117
 
116
118
  ### Injection methods
@@ -151,7 +153,10 @@ Notes:
151
153
  - **Sub-agent tracking** — sessions spawned by sub-agents are tracked and cross-linked: Pi
152
154
  (`pi-subagents`) child transcripts get `subagent` + `parent:<session-id>` tags naming the
153
155
  parent session; the datatzis harness's orchestrator tasks (one per user prompt) get
154
- `subagent` + `workspace:<session-id>` tags.
156
+ `subagent` + `workspace:<session-id>` tags. Surfaces are parent-first: `cforge ls` shows only
157
+ main sessions unless `--all` is passed, and in the TUI dashboard sub-agents stay hidden
158
+ until you select their parent row, which nests them underneath as an indented `↳` list —
159
+ selecting the parent again collapses them.
155
160
  - **datatzis discovery** — per-repo storage: ContextForge scans repository roots for
156
161
  `*/.datatzis/workspaces/` (up to two levels deep). Configure roots via the
157
162
  `DATATZIS_SEARCH_ROOTS` environment variable (colon-separated; default `~/Documents/Github`).
@@ -163,12 +168,12 @@ Notes:
163
168
  ContextForge generates plain-English summaries of what each session accomplished.
164
169
 
165
170
  ```bash
166
- cf summarize <id> # generate or refresh summary for one session
167
- cf summarize --all # bulk-generate summaries for all sessions
168
- cf summarize --all --force # regenerate even existing ones
171
+ cforge summarize <id> # generate or refresh summary for one session
172
+ cforge summarize --all # bulk-generate summaries for all sessions
173
+ cforge summarize --all --force # regenerate even existing ones
169
174
 
170
175
  # Scan + summarize in one step
171
- cf scan --summarize
176
+ cforge scan --summarize
172
177
  ```
173
178
 
174
179
  **How summaries work:**
@@ -176,7 +181,7 @@ cf scan --summarize
176
181
  2. **All tools** — calls the Claude API (Haiku model) to produce a 3–5 sentence summary
177
182
  3. **No API key** — falls back to showing the first user message as a preview
178
183
 
179
- Summaries are cached in the local SQLite index and shown in `cf ls` and `cf show`.
184
+ Summaries are cached in the local SQLite index and shown in `cforge ls` and `cforge show`.
180
185
 
181
186
  ## Configuration
182
187
 
@@ -184,9 +189,9 @@ Config file: `~/.contextforge/config.toml` (created on first run)
184
189
 
185
190
  ### Manage config from CLI
186
191
  ```bash
187
- cf config show # display current config
188
- cf config set llm.api_key sk-ant-...
189
- cf config set compactor.default_strategy key_messages
192
+ cforge config show # display current config
193
+ cforge config set llm.api_key sk-ant-...
194
+ cforge config set compactor.default_strategy key_messages
190
195
  ```
191
196
 
192
197
  ### Full reference
@@ -220,9 +225,9 @@ It **never modifies** tool-native storage. All source files are read-only.
220
225
  All structured commands support `--format json`:
221
226
 
222
227
  ```bash
223
- cf ls --format json
224
- cf show <id> --format json
225
- cf compact <id> --format json
228
+ cforge ls --format json
229
+ cforge show <id> --format json
230
+ cforge compact <id> --format json
226
231
  ```
227
232
 
228
233
  See [AGENTS.md](AGENTS.md) for contribution guidelines and [PLAN.md](PLAN.md) for development status.
@@ -230,7 +235,7 @@ See [AGENTS.md](AGENTS.md) for contribution guidelines and [PLAN.md](PLAN.md) fo
230
235
  ## TUI Dashboard
231
236
 
232
237
  ```bash
233
- cf dashboard
238
+ cforge dashboard
234
239
  ```
235
240
 
236
241
  A full-screen Textual dashboard with live session browsing, filtering, and analytics.
@@ -300,7 +305,7 @@ ContextForge ships a [Model Context Protocol](https://modelcontextprotocol.io) s
300
305
 
301
306
  ```bash
302
307
  # Run directly (after installation)
303
- cf-mcp
308
+ cforge-mcp # or the legacy alias: cf-mcp
304
309
 
305
310
  # From source
306
311
  uv run python -m contextforge.mcp_server
@@ -358,22 +363,49 @@ Add to `~/.gemini/settings.json` (global) or `.gemini/settings.json` (project):
358
363
  }
359
364
  ```
360
365
 
366
+ #### pi
367
+
368
+ ```bash
369
+ pi mcp add contextforge -- cforge-mcp
370
+ pi mcp list # → contextforge: connected, 7 tools
371
+ ```
372
+
373
+ Or add to `~/.pi/agent/mcp.json`:
374
+ ```json
375
+ {
376
+ "mcpServers": {
377
+ "contextforge": {
378
+ "command": "cforge-mcp"
379
+ }
380
+ }
381
+ }
382
+ ```
383
+
361
384
  #### Antigravity
362
385
 
363
- Add to `mcp_servers.json` in your project root:
386
+ ```bash
387
+ agy mcp add contextforge cforge-mcp
388
+ agy mcp list
389
+ ```
390
+
391
+ This writes to `~/.gemini/config/mcp_config.json`. Equivalently, in a project-level `mcp_servers.json`:
364
392
  ```json
365
393
  {
366
394
  "servers": [
367
395
  {
368
396
  "name": "contextforge",
369
397
  "transport": "stdio",
370
- "command": "cf-mcp",
398
+ "command": "cforge-mcp",
371
399
  "enabled": true
372
400
  }
373
401
  ]
374
402
  }
375
403
  ```
376
404
 
405
+ > **Note:** the server uses the `FastMCP` API from `mcp` 1.x, so `pyproject.toml` pins `mcp>=1.9.0,<2`.
406
+ > If an existing install fails with `ModuleNotFoundError: mcp.server.fastmcp`, reinstall with
407
+ > `uv tool install --force --editable .`.
408
+
377
409
  ### Tools
378
410
 
379
411
  | Tool | Description |
@@ -399,36 +431,36 @@ All tools are **read-only** and accept a `window` parameter of `7d`, `30d`, `6m`
399
431
 
400
432
  ## Troubleshooting
401
433
 
402
- ### `command not found: cf`
434
+ ### `command not found: cforge`
403
435
  - **Cause**: Tool not in PATH after installation
404
436
  - **Fix**: Restart your shell, or reinstall: `uv tool install contextforge --force`
405
437
 
406
- ### `RuntimeError: no sessions found` or empty `cf ls`
438
+ ### `RuntimeError: no sessions found` or empty `cforge ls`
407
439
  - **Cause**: No sessions discovered from installed tools
408
- - **Fix**: Run `cf scan` first; check that you have Claude Code/Codex/altimate-code with session history
440
+ - **Fix**: Run `cforge scan` first; check that you have Claude Code/Codex/altimate-code with session history
409
441
 
410
442
  ### `ANTHROPIC_API_KEY not set` warning
411
443
  - **Cause**: No API key configured for summaries
412
- - **Fix**: Set it via `cf config set llm.api_key sk-ant-...` or set `ANTHROPIC_API_KEY` env var
444
+ - **Fix**: Set it via `cforge config set llm.api_key sk-ant-...` or set `ANTHROPIC_API_KEY` env var
413
445
  - **Note**: Summaries are optional; you can still use ContextForge without API keys
414
446
 
415
447
  ### Session not appearing after tool update
416
448
  - **Cause**: Tool storage location changed or was not yet indexed
417
- - **Fix**: Run `cf scan` again to reindex all tools
449
+ - **Fix**: Run `cforge scan` again to reindex all tools
418
450
 
419
- ### `cf dashboard` crashes or displays incorrectly
451
+ ### `cforge dashboard` crashes or displays incorrectly
420
452
  - **Cause**: Terminal size too small or unsupported terminal type
421
453
  - **Fix**: Resize terminal to at least 80x24; try a different terminal emulator
422
454
 
423
455
  ### Database locked / concurrent access error
424
- - **Cause**: Two `cf` commands running at once
425
- - **Fix**: Wait for the first command to finish, or delete `~/.contextforge/contextforge.db` and run `cf scan` again
456
+ - **Cause**: Two `cforge` commands running at once
457
+ - **Fix**: Wait for the first command to finish, or delete `~/.contextforge/contextforge.db` and run `cforge scan` again
426
458
 
427
459
  ## Development
428
460
 
429
461
  ```bash
430
462
  uv sync # install all dependencies including dev
431
463
  uv run pytest # run tests
432
- uv run cf --help # run CLI locally
464
+ uv run cforge --help # run CLI locally
433
465
  uv tool install . --force # test local installation
434
466
  ```