You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update CLI invocations for unified @cortexkit/magic-context + add Discord
The CLI restructure (94d676a) moved setup/doctor/migrate from per-plugin
binaries (`bunx ... opencode-magic-context setup`, `magic-context-pi`)
into the unified @cortexkit/magic-context CLI with --harness flag.
Documentation still pointed users at the now-removed binaries — every
`bunx --bun @cortexkit/{opencode,pi}-magic-context@latest setup|doctor`
in the docs would fail because those packages no longer ship a bin entry.
Updated:
- README.md
- Quick Setup: `bunx --bun @cortexkit/magic-context@latest setup`
(with --harness flag note)
- Doctor section: unified `magic-context doctor` + new pass/warn/fail
summary description + DB integrity_check mention
- Pi section: `setup --harness pi` and `doctor --harness pi`
- Conflict warning: points at unified CLI
- Migration note: unified CLI for experimental.* → dreamer.* rewrite
- Added @cortexkit/magic-context CLI npm badge
- Added Discord badge + nav link (https://discord.gg/F2uWxjGnU)
- CONFIGURATION.md: setup wizard description + doctor section both
rewritten to use the unified CLI
- STRUCTURE.md: entry-point note clarifies CLI lives in
packages/cli/, no longer in packages/plugin/src/cli/
- packages/pi-plugin/README.md: install + doctor commands updated;
archecture table no longer claims a per-Pi CLI
- scripts/install.sh: updated stale comment showing the bun-fallback
re-run command
- tests/docker/test-pi-e2e.sh: header comment matches the new flag
Plugin entries inside JSONC `plugin` arrays correctly stay as
`@cortexkit/opencode-magic-context` — that's the runtime plugin
package name, not a CLI invocation.
Verified: lint + typecheck clean; all stale CLI references in
checked-in files now resolved (only refs left are in gitignored
.alfonso/.sisyphus/.claude scratch dirs and the gitignored
packages/plugin/README.md which is regenerated from this root
README at release time).
Project config always merges on top of user config in both harnesses. The setup wizards (`magic-context-pi setup` for Pi, `bunx ... opencode-magic-context setup` for OpenCode) write the user-level file with sensible defaults.
22
+
Project config always merges on top of user config in both harnesses. The unified setup wizard (`bunx --bun @cortexkit/magic-context@latest setup`) auto-detects which harnesses you have installed and writes the user-level file for each with sensible defaults; pass `--harness opencode` or `--harness pi` to target one.
23
23
24
24
### Cross-harness scoping
25
25
@@ -46,21 +46,22 @@ Both setup wizards add this automatically.
46
46
47
47
### Doctor
48
48
49
-
If something isn't working, run the appropriate doctor to auto-detect and fix common issues:
49
+
If something isn't working, run the unified doctor to auto-detect installed harnesses and fix common issues:
50
50
51
51
```bash
52
-
#OpenCode
53
-
bunx --bun @cortexkit/opencode-magic-context@latest doctor
52
+
#Auto-detect installed harnesses; if both, picks the first or asks
53
+
bunx --bun @cortexkit/magic-context@latest doctor
54
54
55
-
# Pi
56
-
bunx --bun @cortexkit/pi-magic-context@latest doctor
55
+
# Target a specific harness explicitly
56
+
bunx --bun @cortexkit/magic-context@latest doctor --harness opencode
57
+
bunx --bun @cortexkit/magic-context@latest doctor --harness pi
57
58
```
58
59
59
-
The OpenCode doctor checks: installation, plugin registration, `magic-context.jsonc`existence, conflicts (compaction, DCP, OMO hooks), and TUI sidebar configuration.
60
+
The OpenCode doctor checks: installation, CLI version vs npm latest, plugin registration (preserves local dev paths), `magic-context.jsonc`parses + loads through the schema, conflicts (compaction, DCP, OMO hooks), TUI sidebar configuration, embedding endpoint, shared-DB existence + `PRAGMA integrity_check` + row counts, plugin npm cache, and historian debug dumps.
60
61
61
-
The Pi doctor checks: Pi binary + version (requires `>= 0.71.0`), settings registration, config validity, embedding endpoint reachability, shared-DB integrity, and stale Pi extension caches.
62
+
The Pi doctor checks: Pi binary + version (requires `>= 0.71.0`), CLI version vs npm latest, settings registration, config validity, embedding endpoint reachability, shared-DB integrity, stale Pi extension caches, and historian debug dumps.
62
63
63
-
Both auto-fix what they can with `--force`and produce sanitized issue reports with `--issue`.
64
+
Both report `PASS X / WARN Y / FAIL Z` summary counts. Use `--force`to auto-fix what doctor can (clears stale plugin cache, repairs config) and `--issue` to produce a sanitized issue report.
@@ -63,7 +66,7 @@ Keep using the **same session** for **weeks**, **months**, or even **years**. **
63
66
64
67
**Key File Pinning (v0.14)** — under `dreamer.pin_key_files`, still opt-in. Dreamer analyzes which files your agent reads most frequently across the session. Core orientation files (architecture, config, types) that get re-read after every context drop are pinned into the system prompt as `<key-files>`, so the agent always has them without needing to re-read from disk. Files are read fresh on each cache-busting pass. Enable with `dreamer.pin_key_files.enabled: true`.
65
68
66
-
> Migrating from an earlier version? Running `bunx --bun @cortexkit/opencode-magic-context@latest doctor` rewrites old `experimental.user_memories.*` and `experimental.pin_key_files.*` keys into their new `dreamer.*` homes, preserving any `enabled` state you had.
69
+
> Migrating from an earlier version? Running `bunx --bun @cortexkit/magic-context@latest doctor` rewrites old `experimental.user_memories.*` and `experimental.pin_key_files.*` keys into their new `dreamer.*` homes, preserving any `enabled` state you had.
The unified setup wizard auto-detects which harnesses you have installed (OpenCode, Pi, or both) and configures each one. Use `--harness opencode` or `--harness pi` to target a specific harness.
105
+
101
106
The wizard will:
102
-
1.Check your OpenCode installation and available models
107
+
1.Detect installed harnesses and available models
103
108
2. Add the plugin and disable built-in compaction
104
109
3. Help you pick models for historian, dreamer, and sidekick
105
110
4. Handle oh-my-opencode compatibility if needed
@@ -161,21 +166,23 @@ The setup wizard handles this automatically if it detects an oh-my-openagent or
161
166
Already installed but something isn't working? Run the doctor to check and auto-fix configuration issues:
162
167
163
168
```bash
164
-
bunx --bun @cortexkit/opencode-magic-context@latest doctor
169
+
bunx --bun @cortexkit/magic-context@latest doctor
165
170
```
166
171
167
-
Doctor checks for conflicts (compaction, DCP, OMO hooks), ensures the TUI sidebar is configured, verifies the plugin is registered, and checks the npm cache — fixing what it can automatically.
172
+
Doctor auto-detects installed harnesses and runs the right checks for each. Pass `--harness opencode` or `--harness pi` to target a specific harness when you have both installed.
173
+
174
+
Doctor checks for conflicts (compaction, DCP, OMO hooks), ensures the TUI sidebar is configured (OpenCode), verifies the plugin is registered, validates the magic-context.jsonc, runs `PRAGMA integrity_check` on the shared SQLite DB, and checks the npm cache — fixing what it can automatically. The summary line reports `PASS X / WARN Y / FAIL Z` so you can scan results at a glance.
168
175
169
176
Use `--force` to force-clear the plugin cache even when versions match (fixes broken transitive dependencies):
170
177
171
178
```bash
172
-
bunx --bun @cortexkit/opencode-magic-context@latest doctor --force
179
+
bunx --bun @cortexkit/magic-context@latest doctor --force
173
180
```
174
181
175
182
Hit a real bug? Use `--issue` to collect environment, sanitized config, and the last 400 log lines into a ready-to-submit report. It can also open the issue directly via `gh` if you have it installed:
176
183
177
184
```bash
178
-
bunx --bun @cortexkit/opencode-magic-context@latest doctor --issue
185
+
bunx --bun @cortexkit/magic-context@latest doctor --issue
179
186
```
180
187
181
188
---
@@ -187,16 +194,16 @@ Magic Context is also available as a [Pi](https://github.com/mariozechner/pi-mon
187
194
> ⚠️ The Pi extension is published as **beta** while it accumulates real-world usage. Core flows are validated with end-to-end tests; report issues at [github.com/cortexkit/magic-context/issues](https://github.com/cortexkit/magic-context/issues).
188
195
189
196
```bash
190
-
# Setup wizard for Pi (analogous to the OpenCode flow above)
# Setup wizard for Pi (uses the same unified CLI as OpenCode)
198
+
bunx --bun @cortexkit/magic-context@latest setup --harness pi
192
199
```
193
200
194
201
Requires Pi `>= 0.71.0`. The wizard handles registration with Pi (`packages` array in `~/.pi/agent/settings.json`), writes `~/.pi/agent/magic-context.jsonc`, and prompts for historian/dreamer/sidekick model picks. Pi-specific docs and config notes live in [`packages/pi-plugin/README.md`](https://github.com/cortexkit/magic-context/blob/master/packages/pi-plugin/README.md).
195
202
196
203
For health checks:
197
204
198
205
```bash
199
-
bunx --bun @cortexkit/pi-magic-context@latest doctor
206
+
bunx --bun @cortexkit/magic-context@latest doctor --harness pi
200
207
```
201
208
202
209
---
@@ -358,7 +365,7 @@ The TUI plugin is configured automatically by the setup wizard and the `doctor`
358
365
359
366
### Startup conflict detection
360
367
361
-
On startup, Magic Context checks for common configuration problems — OpenCode's built-in compaction being enabled, DCP plugin being active alongside Magic Context, or conflicting oh-my-openagent hooks. When conflicts are detected, it warns the active session with a fix suggestion pointing to `bunx --bun @cortexkit/opencode-magic-context@latest doctor`.
368
+
On startup, Magic Context checks for common configuration problems — OpenCode's built-in compaction being enabled, DCP plugin being active alongside Magic Context, or conflicting oh-my-openagent hooks. When conflicts are detected, it warns the active session with a fix suggestion pointing to `bunx --bun @cortexkit/magic-context@latest doctor`.
Copy file name to clipboardExpand all lines: STRUCTURE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@
75
75
76
76
## Key File Locations
77
77
78
-
**Entry Points:**`src/index.ts`: Register the plugin, hidden agents, hooks, tools, and commands. `src/cli/index.ts`: CLI binary entry for `bunx --bun @cortexkit/opencode-magic-context setup`.
78
+
**Entry Points:**`src/index.ts`: Register the plugin, hidden agents, hooks, tools, and commands. The CLI now lives in the separate `@cortexkit/magic-context` package (`packages/cli/`) — see `packages/cli/src/index.ts` for the unified setup/doctor/migrate entry.
79
79
80
80
**Configuration:**`src/config/index.ts`: Load and merge config files; `src/config/schema/magic-context.ts`: define defaults and schema rules.
Copy file name to clipboardExpand all lines: packages/pi-plugin/README.md
+8-13Lines changed: 8 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,10 +28,10 @@ Magic Context is a context engine that keeps long Pi sessions productive by:
28
28
29
29
## Installation
30
30
31
-
The fastest path is the interactive setup wizard — it registers the extension with Pi, writes a sensible `magic-context.jsonc`, and verifies your model picks against Pi's CLI:
31
+
The fastest path is the unified Magic Context CLI — `--harness pi` selects the Pi-specific setup pipeline (registers the extension with Pi, writes a sensible `magic-context.jsonc`, and verifies your model picks):
bunx --bun @cortexkit/magic-context@latest setup --harness pi
35
35
```
36
36
37
37
This handles everything for you:
@@ -40,24 +40,18 @@ This handles everything for you:
40
40
3. Prompts you for historian, dreamer, sidekick, and embedding model choices
41
41
4. Warns about provider-specific gotchas (e.g. GitHub Copilot reasoning models need an explicit `thinking_level`)
42
42
43
-
If you'd rather install the npm package globally first:
44
-
45
-
```bash
46
-
npm install -g @cortexkit/pi-magic-context@latest
47
-
# or
48
-
bun add -g @cortexkit/pi-magic-context@latest
49
-
```
50
-
51
-
Then either run `magic-context-pi setup` or register the extension manually with Pi's own installer:
43
+
If you'd rather register the Pi extension package directly with Pi (skipping the wizard), use Pi's own installer:
52
44
53
45
```bash
54
46
pi install npm:@cortexkit/pi-magic-context
55
47
```
56
48
49
+
This adds the extension to `~/.pi/agent/settings.json` but won't write `magic-context.jsonc` for you — you'll need to create it manually (see Configuration below).
50
+
57
51
To check installation health later:
58
52
59
53
```bash
60
-
magic-context-pi doctor
54
+
bunx --bun @cortexkit/magic-context@latest doctor --harness pi
61
55
```
62
56
63
57
---
@@ -161,7 +155,8 @@ This package is part of the [magic-context monorepo](https://github.com/cortexki
161
155
|`dreamer/`| Pi-side adapter for the shared dreamer scheduler |
162
156
|`system-prompt.ts`| Pi `before_agent_start` injector for `<session-history>`, `<project-memory>`, `<project-docs>`|
|`cli/`|`magic-context-pi setup` and `magic-context-pi doctor`|
158
+
159
+
The CLI lives in the unified [`@cortexkit/magic-context`](https://www.npmjs.com/package/@cortexkit/magic-context) package — `setup --harness pi` and `doctor --harness pi` route to the Pi-specific code paths in `packages/cli/src/commands/`.
165
160
166
161
For deeper architectural detail, see the main repo's [ARCHITECTURE.md](https://github.com/cortexkit/magic-context/blob/master/ARCHITECTURE.md).
0 commit comments