context-forge-cli 0.4.15__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.
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/AGENTS.md +4 -4
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/PKG-INFO +78 -49
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/README.md +76 -47
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/adapters/codex.py +94 -12
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/adapters/pi.py +40 -1
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/cli.py +45 -27
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/core/db.py +130 -2
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/core/scanner.py +4 -1
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/core/token_analyzer.py +20 -1
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/mcp_server.py +15 -1
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/tui/widgets/session_detail.py +1 -1
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/tui/widgets/session_table.py +23 -10
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/tui/widgets/status_bar.py +13 -2
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/tui/widgets/tokens_panel.py +2 -2
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/utils/display.py +58 -10
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/pyproject.toml +6 -3
- context_forge_cli-0.4.16/tests/adapters/test_codex.py +205 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/adapters/test_pi.py +28 -0
- context_forge_cli-0.4.16/tests/core/test_db.py +228 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/core/test_display.py +35 -3
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/core/test_token_analyzer.py +8 -2
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/test_mcp_server.py +4 -1
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/uv.lock +2 -2
- context_forge_cli-0.4.15/tests/core/test_db.py +0 -76
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/.contextforge.toml +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/.github/workflows/publish.yml +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/.gitignore +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/.python-version +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/PLAN.md +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/__init__.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/adapters/__init__.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/adapters/altimate_code.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/adapters/antigravity.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/adapters/base.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/adapters/claude_code.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/adapters/claude_desktop.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/adapters/cursor.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/adapters/datatzis.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/adapters/gemini.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/adapters/registry.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/core/__init__.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/core/analytics.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/core/compactor.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/core/injector.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/core/summarizer.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/models/__init__.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/models/config.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/models/session.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/tui/__init__.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/tui/app.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/tui/clipboard.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/tui/styles.tcss +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/tui/widgets/__init__.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/tui/widgets/stats_panel.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/tui/widgets/transfer_panel.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/utils/__init__.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/contextforge/utils/tokens.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/__init__.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/adapters/__init__.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/adapters/test_antigravity.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/adapters/test_claude_code.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/adapters/test_cursor.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/adapters/test_datatzis.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/conftest.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/core/__init__.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/core/test_compactor.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/core/test_injector.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/core/test_summarizer.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/fixtures/claude_session_sample.jsonl +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/fixtures/datatzis/my-repo/.datatzis/tasks/22222222222222222222222222222222.json +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/fixtures/datatzis/my-repo/.datatzis/tasks/33333333333333333333333333333333.json +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/fixtures/datatzis/my-repo/.datatzis/workspaces/11111111111111111111111111111111.json +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/fixtures/datatzis/my-repo/.datatzis/workspaces/99999999999999999999999999999999.json +0 -0
- {context_forge_cli-0.4.15 → 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
- {context_forge_cli-0.4.15 → 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
- {context_forge_cli-0.4.15 → 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
- {context_forge_cli-0.4.15 → 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
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/test_tui_detail.py +0 -0
- {context_forge_cli-0.4.15 → context_forge_cli-0.4.16}/tests/test_tui_table.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: `
|
|
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
|
|
15
|
-
uv run pytest
|
|
16
|
-
uv run
|
|
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.
|
|
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
|
|
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 (`
|
|
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
|
|
70
|
+
uv run cforge --help
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
### Verify installation
|
|
74
74
|
```bash
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
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
|
-
|
|
113
|
+
cforge compact <session-id>
|
|
112
114
|
|
|
113
115
|
# Inject context into a new Claude Code session
|
|
114
|
-
|
|
116
|
+
cforge transfer <session-id> --to claude_code --execute
|
|
115
117
|
|
|
116
118
|
# Inject into Codex with richer context
|
|
117
|
-
|
|
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
|
-
|
|
126
|
+
cforge compact <session-id>
|
|
125
127
|
|
|
126
128
|
# Save a bundle to the DB for later reuse
|
|
127
|
-
|
|
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
|
-
|
|
132
|
+
cforge transfer <session-id> --to codex
|
|
131
133
|
|
|
132
134
|
# Execute: launch a new Codex session with context injected
|
|
133
|
-
|
|
135
|
+
cforge transfer <session-id> --to codex --execute
|
|
134
136
|
|
|
135
137
|
# Multi-session bundle → altimate-code, richer key_messages strategy
|
|
136
|
-
|
|
138
|
+
cforge transfer <id1> <id2> --to altimate-code --strategy key_messages --execute
|
|
137
139
|
|
|
138
140
|
# Resume an existing session with injected context
|
|
139
|
-
|
|
141
|
+
cforge transfer <id> --to claude_code --session <existing-session-id> --execute
|
|
140
142
|
|
|
141
143
|
# Machine-readable output
|
|
142
|
-
|
|
144
|
+
cforge transfer <id> --to codex --format json
|
|
143
145
|
```
|
|
144
146
|
|
|
145
147
|
### Injection methods
|
|
@@ -180,7 +182,7 @@ 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. Surfaces are parent-first: `
|
|
185
|
+
`subagent` + `workspace:<session-id>` tags. Surfaces are parent-first: `cforge ls` shows only
|
|
184
186
|
main sessions unless `--all` is passed, and in the TUI dashboard sub-agents stay hidden
|
|
185
187
|
until you select their parent row, which nests them underneath as an indented `↳` list —
|
|
186
188
|
selecting the parent again collapses them.
|
|
@@ -195,12 +197,12 @@ Notes:
|
|
|
195
197
|
ContextForge generates plain-English summaries of what each session accomplished.
|
|
196
198
|
|
|
197
199
|
```bash
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
|
201
203
|
|
|
202
204
|
# Scan + summarize in one step
|
|
203
|
-
|
|
205
|
+
cforge scan --summarize
|
|
204
206
|
```
|
|
205
207
|
|
|
206
208
|
**How summaries work:**
|
|
@@ -208,7 +210,7 @@ cf scan --summarize
|
|
|
208
210
|
2. **All tools** — calls the Claude API (Haiku model) to produce a 3–5 sentence summary
|
|
209
211
|
3. **No API key** — falls back to showing the first user message as a preview
|
|
210
212
|
|
|
211
|
-
Summaries are cached in the local SQLite index and shown in `
|
|
213
|
+
Summaries are cached in the local SQLite index and shown in `cforge ls` and `cforge show`.
|
|
212
214
|
|
|
213
215
|
## Configuration
|
|
214
216
|
|
|
@@ -216,9 +218,9 @@ Config file: `~/.contextforge/config.toml` (created on first run)
|
|
|
216
218
|
|
|
217
219
|
### Manage config from CLI
|
|
218
220
|
```bash
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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
|
|
222
224
|
```
|
|
223
225
|
|
|
224
226
|
### Full reference
|
|
@@ -252,9 +254,9 @@ It **never modifies** tool-native storage. All source files are read-only.
|
|
|
252
254
|
All structured commands support `--format json`:
|
|
253
255
|
|
|
254
256
|
```bash
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
cforge ls --format json
|
|
258
|
+
cforge show <id> --format json
|
|
259
|
+
cforge compact <id> --format json
|
|
258
260
|
```
|
|
259
261
|
|
|
260
262
|
See [AGENTS.md](AGENTS.md) for contribution guidelines and [PLAN.md](PLAN.md) for development status.
|
|
@@ -262,7 +264,7 @@ See [AGENTS.md](AGENTS.md) for contribution guidelines and [PLAN.md](PLAN.md) fo
|
|
|
262
264
|
## TUI Dashboard
|
|
263
265
|
|
|
264
266
|
```bash
|
|
265
|
-
|
|
267
|
+
cforge dashboard
|
|
266
268
|
```
|
|
267
269
|
|
|
268
270
|
A full-screen Textual dashboard with live session browsing, filtering, and analytics.
|
|
@@ -332,7 +334,7 @@ ContextForge ships a [Model Context Protocol](https://modelcontextprotocol.io) s
|
|
|
332
334
|
|
|
333
335
|
```bash
|
|
334
336
|
# Run directly (after installation)
|
|
335
|
-
cf-mcp
|
|
337
|
+
cforge-mcp # or the legacy alias: cf-mcp
|
|
336
338
|
|
|
337
339
|
# From source
|
|
338
340
|
uv run python -m contextforge.mcp_server
|
|
@@ -390,22 +392,49 @@ Add to `~/.gemini/settings.json` (global) or `.gemini/settings.json` (project):
|
|
|
390
392
|
}
|
|
391
393
|
```
|
|
392
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
|
+
|
|
393
413
|
#### Antigravity
|
|
394
414
|
|
|
395
|
-
|
|
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`:
|
|
396
421
|
```json
|
|
397
422
|
{
|
|
398
423
|
"servers": [
|
|
399
424
|
{
|
|
400
425
|
"name": "contextforge",
|
|
401
426
|
"transport": "stdio",
|
|
402
|
-
"command": "
|
|
427
|
+
"command": "cforge-mcp",
|
|
403
428
|
"enabled": true
|
|
404
429
|
}
|
|
405
430
|
]
|
|
406
431
|
}
|
|
407
432
|
```
|
|
408
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
|
+
|
|
409
438
|
### Tools
|
|
410
439
|
|
|
411
440
|
| Tool | Description |
|
|
@@ -431,36 +460,36 @@ All tools are **read-only** and accept a `window` parameter of `7d`, `30d`, `6m`
|
|
|
431
460
|
|
|
432
461
|
## Troubleshooting
|
|
433
462
|
|
|
434
|
-
### `command not found:
|
|
463
|
+
### `command not found: cforge`
|
|
435
464
|
- **Cause**: Tool not in PATH after installation
|
|
436
465
|
- **Fix**: Restart your shell, or reinstall: `uv tool install contextforge --force`
|
|
437
466
|
|
|
438
|
-
### `RuntimeError: no sessions found` or empty `
|
|
467
|
+
### `RuntimeError: no sessions found` or empty `cforge ls`
|
|
439
468
|
- **Cause**: No sessions discovered from installed tools
|
|
440
|
-
- **Fix**: Run `
|
|
469
|
+
- **Fix**: Run `cforge scan` first; check that you have Claude Code/Codex/altimate-code with session history
|
|
441
470
|
|
|
442
471
|
### `ANTHROPIC_API_KEY not set` warning
|
|
443
472
|
- **Cause**: No API key configured for summaries
|
|
444
|
-
- **Fix**: Set it via `
|
|
473
|
+
- **Fix**: Set it via `cforge config set llm.api_key sk-ant-...` or set `ANTHROPIC_API_KEY` env var
|
|
445
474
|
- **Note**: Summaries are optional; you can still use ContextForge without API keys
|
|
446
475
|
|
|
447
476
|
### Session not appearing after tool update
|
|
448
477
|
- **Cause**: Tool storage location changed or was not yet indexed
|
|
449
|
-
- **Fix**: Run `
|
|
478
|
+
- **Fix**: Run `cforge scan` again to reindex all tools
|
|
450
479
|
|
|
451
|
-
### `
|
|
480
|
+
### `cforge dashboard` crashes or displays incorrectly
|
|
452
481
|
- **Cause**: Terminal size too small or unsupported terminal type
|
|
453
482
|
- **Fix**: Resize terminal to at least 80x24; try a different terminal emulator
|
|
454
483
|
|
|
455
484
|
### Database locked / concurrent access error
|
|
456
|
-
- **Cause**: Two `
|
|
457
|
-
- **Fix**: Wait for the first command to finish, or delete `~/.contextforge/contextforge.db` and run `
|
|
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
|
|
458
487
|
|
|
459
488
|
## Development
|
|
460
489
|
|
|
461
490
|
```bash
|
|
462
491
|
uv sync # install all dependencies including dev
|
|
463
492
|
uv run pytest # run tests
|
|
464
|
-
uv run
|
|
493
|
+
uv run cforge --help # run CLI locally
|
|
465
494
|
uv tool install . --force # test local installation
|
|
466
495
|
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Session manager and context bridge for agentic CLI tools.**
|
|
4
4
|
|
|
5
|
-
ContextForge (`
|
|
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
|
|
41
|
+
uv run cforge --help
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
### Verify installation
|
|
45
45
|
```bash
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
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
|
-
|
|
84
|
+
cforge compact <session-id>
|
|
83
85
|
|
|
84
86
|
# Inject context into a new Claude Code session
|
|
85
|
-
|
|
87
|
+
cforge transfer <session-id> --to claude_code --execute
|
|
86
88
|
|
|
87
89
|
# Inject into Codex with richer context
|
|
88
|
-
|
|
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
|
-
|
|
97
|
+
cforge compact <session-id>
|
|
96
98
|
|
|
97
99
|
# Save a bundle to the DB for later reuse
|
|
98
|
-
|
|
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
|
-
|
|
103
|
+
cforge transfer <session-id> --to codex
|
|
102
104
|
|
|
103
105
|
# Execute: launch a new Codex session with context injected
|
|
104
|
-
|
|
106
|
+
cforge transfer <session-id> --to codex --execute
|
|
105
107
|
|
|
106
108
|
# Multi-session bundle → altimate-code, richer key_messages strategy
|
|
107
|
-
|
|
109
|
+
cforge transfer <id1> <id2> --to altimate-code --strategy key_messages --execute
|
|
108
110
|
|
|
109
111
|
# Resume an existing session with injected context
|
|
110
|
-
|
|
112
|
+
cforge transfer <id> --to claude_code --session <existing-session-id> --execute
|
|
111
113
|
|
|
112
114
|
# Machine-readable output
|
|
113
|
-
|
|
115
|
+
cforge transfer <id> --to codex --format json
|
|
114
116
|
```
|
|
115
117
|
|
|
116
118
|
### Injection methods
|
|
@@ -151,7 +153,7 @@ 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. Surfaces are parent-first: `
|
|
156
|
+
`subagent` + `workspace:<session-id>` tags. Surfaces are parent-first: `cforge ls` shows only
|
|
155
157
|
main sessions unless `--all` is passed, and in the TUI dashboard sub-agents stay hidden
|
|
156
158
|
until you select their parent row, which nests them underneath as an indented `↳` list —
|
|
157
159
|
selecting the parent again collapses them.
|
|
@@ -166,12 +168,12 @@ Notes:
|
|
|
166
168
|
ContextForge generates plain-English summaries of what each session accomplished.
|
|
167
169
|
|
|
168
170
|
```bash
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
|
172
174
|
|
|
173
175
|
# Scan + summarize in one step
|
|
174
|
-
|
|
176
|
+
cforge scan --summarize
|
|
175
177
|
```
|
|
176
178
|
|
|
177
179
|
**How summaries work:**
|
|
@@ -179,7 +181,7 @@ cf scan --summarize
|
|
|
179
181
|
2. **All tools** — calls the Claude API (Haiku model) to produce a 3–5 sentence summary
|
|
180
182
|
3. **No API key** — falls back to showing the first user message as a preview
|
|
181
183
|
|
|
182
|
-
Summaries are cached in the local SQLite index and shown in `
|
|
184
|
+
Summaries are cached in the local SQLite index and shown in `cforge ls` and `cforge show`.
|
|
183
185
|
|
|
184
186
|
## Configuration
|
|
185
187
|
|
|
@@ -187,9 +189,9 @@ Config file: `~/.contextforge/config.toml` (created on first run)
|
|
|
187
189
|
|
|
188
190
|
### Manage config from CLI
|
|
189
191
|
```bash
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
|
193
195
|
```
|
|
194
196
|
|
|
195
197
|
### Full reference
|
|
@@ -223,9 +225,9 @@ It **never modifies** tool-native storage. All source files are read-only.
|
|
|
223
225
|
All structured commands support `--format json`:
|
|
224
226
|
|
|
225
227
|
```bash
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
228
|
+
cforge ls --format json
|
|
229
|
+
cforge show <id> --format json
|
|
230
|
+
cforge compact <id> --format json
|
|
229
231
|
```
|
|
230
232
|
|
|
231
233
|
See [AGENTS.md](AGENTS.md) for contribution guidelines and [PLAN.md](PLAN.md) for development status.
|
|
@@ -233,7 +235,7 @@ See [AGENTS.md](AGENTS.md) for contribution guidelines and [PLAN.md](PLAN.md) fo
|
|
|
233
235
|
## TUI Dashboard
|
|
234
236
|
|
|
235
237
|
```bash
|
|
236
|
-
|
|
238
|
+
cforge dashboard
|
|
237
239
|
```
|
|
238
240
|
|
|
239
241
|
A full-screen Textual dashboard with live session browsing, filtering, and analytics.
|
|
@@ -303,7 +305,7 @@ ContextForge ships a [Model Context Protocol](https://modelcontextprotocol.io) s
|
|
|
303
305
|
|
|
304
306
|
```bash
|
|
305
307
|
# Run directly (after installation)
|
|
306
|
-
cf-mcp
|
|
308
|
+
cforge-mcp # or the legacy alias: cf-mcp
|
|
307
309
|
|
|
308
310
|
# From source
|
|
309
311
|
uv run python -m contextforge.mcp_server
|
|
@@ -361,22 +363,49 @@ Add to `~/.gemini/settings.json` (global) or `.gemini/settings.json` (project):
|
|
|
361
363
|
}
|
|
362
364
|
```
|
|
363
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
|
+
|
|
364
384
|
#### Antigravity
|
|
365
385
|
|
|
366
|
-
|
|
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`:
|
|
367
392
|
```json
|
|
368
393
|
{
|
|
369
394
|
"servers": [
|
|
370
395
|
{
|
|
371
396
|
"name": "contextforge",
|
|
372
397
|
"transport": "stdio",
|
|
373
|
-
"command": "
|
|
398
|
+
"command": "cforge-mcp",
|
|
374
399
|
"enabled": true
|
|
375
400
|
}
|
|
376
401
|
]
|
|
377
402
|
}
|
|
378
403
|
```
|
|
379
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
|
+
|
|
380
409
|
### Tools
|
|
381
410
|
|
|
382
411
|
| Tool | Description |
|
|
@@ -402,36 +431,36 @@ All tools are **read-only** and accept a `window` parameter of `7d`, `30d`, `6m`
|
|
|
402
431
|
|
|
403
432
|
## Troubleshooting
|
|
404
433
|
|
|
405
|
-
### `command not found:
|
|
434
|
+
### `command not found: cforge`
|
|
406
435
|
- **Cause**: Tool not in PATH after installation
|
|
407
436
|
- **Fix**: Restart your shell, or reinstall: `uv tool install contextforge --force`
|
|
408
437
|
|
|
409
|
-
### `RuntimeError: no sessions found` or empty `
|
|
438
|
+
### `RuntimeError: no sessions found` or empty `cforge ls`
|
|
410
439
|
- **Cause**: No sessions discovered from installed tools
|
|
411
|
-
- **Fix**: Run `
|
|
440
|
+
- **Fix**: Run `cforge scan` first; check that you have Claude Code/Codex/altimate-code with session history
|
|
412
441
|
|
|
413
442
|
### `ANTHROPIC_API_KEY not set` warning
|
|
414
443
|
- **Cause**: No API key configured for summaries
|
|
415
|
-
- **Fix**: Set it via `
|
|
444
|
+
- **Fix**: Set it via `cforge config set llm.api_key sk-ant-...` or set `ANTHROPIC_API_KEY` env var
|
|
416
445
|
- **Note**: Summaries are optional; you can still use ContextForge without API keys
|
|
417
446
|
|
|
418
447
|
### Session not appearing after tool update
|
|
419
448
|
- **Cause**: Tool storage location changed or was not yet indexed
|
|
420
|
-
- **Fix**: Run `
|
|
449
|
+
- **Fix**: Run `cforge scan` again to reindex all tools
|
|
421
450
|
|
|
422
|
-
### `
|
|
451
|
+
### `cforge dashboard` crashes or displays incorrectly
|
|
423
452
|
- **Cause**: Terminal size too small or unsupported terminal type
|
|
424
453
|
- **Fix**: Resize terminal to at least 80x24; try a different terminal emulator
|
|
425
454
|
|
|
426
455
|
### Database locked / concurrent access error
|
|
427
|
-
- **Cause**: Two `
|
|
428
|
-
- **Fix**: Wait for the first command to finish, or delete `~/.contextforge/contextforge.db` and run `
|
|
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
|
|
429
458
|
|
|
430
459
|
## Development
|
|
431
460
|
|
|
432
461
|
```bash
|
|
433
462
|
uv sync # install all dependencies including dev
|
|
434
463
|
uv run pytest # run tests
|
|
435
|
-
uv run
|
|
464
|
+
uv run cforge --help # run CLI locally
|
|
436
465
|
uv tool install . --force # test local installation
|
|
437
466
|
```
|