context-mule 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +104 -2
- package/dist/cli/index.js +4010 -0
- package/dist/public/assets/index-BJ_K99FZ.css +1 -0
- package/dist/public/assets/index-BUIbAVL-.js +165 -0
- package/dist/public/index.html +24 -0
- package/package.json +55 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Subash Thiruppathy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,105 @@
|
|
|
1
|
-
#
|
|
1
|
+
# context-mule (`cmem`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Local-first working-memory engine and instant quota-switch handoff CLI for multi-tool coding workflows (`agy`, Claude Code, Codex CLI, Gemini CLI, Cursor).
|
|
4
|
+
|
|
5
|
+
When a model hits a 5-hour or weekly usage cap mid-task, `cmem` extracts your active goal, Git branch/line-level progress, locked decisions, collapsed dead ends (already-tried errors), and remaining checklist into a deterministic `<1,500`-token **Context Capsule** stored in local SQLite (`~/.cmem/cmem.db`, WAL + FTS5).
|
|
6
|
+
|
|
7
|
+
Requires **Node.js >= 24.0.0** (uses built-in `node:sqlite`, zero native C++ compilation).
|
|
8
|
+
|
|
9
|
+
## Quickstart
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Install globally
|
|
13
|
+
npm i -g context-mule
|
|
14
|
+
|
|
15
|
+
# Or initialize directly via npx
|
|
16
|
+
npx context-mule init
|
|
17
|
+
|
|
18
|
+
# Capture current workspace/session state into SQLite
|
|
19
|
+
cmem capture
|
|
20
|
+
|
|
21
|
+
# Hand off to another CLI or account (prompt-first by default, clean git tree)
|
|
22
|
+
cmem handoff --to claude
|
|
23
|
+
cmem resume --to codex --exec
|
|
24
|
+
|
|
25
|
+
# Search past decisions and dead ends across projects (FTS5 BM25)
|
|
26
|
+
cmem search "SKIP LOCKED"
|
|
27
|
+
|
|
28
|
+
# Boot the local control plane (http://127.0.0.1:4319)
|
|
29
|
+
cmem ui
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Core CLI Commands
|
|
33
|
+
|
|
34
|
+
| Command | Purpose |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `cmem init [--seed]` | Initialize `~/.cmem/cmem.db` (WAL + FTS5) and register the current Git repo. Pass `--seed` for multi-CLI demo data. |
|
|
37
|
+
| `cmem capture [-m <note>] [--cli <src>]` | Sync local CLI session logs (`agy`, `claude`, `gemini`, `codex`, `cursor`), capture Git diff hunks, and compile a `<1,500`-token capsule. |
|
|
38
|
+
| `cmem handoff --to <cli> [--account <name>] [--inject-file]` | Stage and copy a target-ready Context Capsule prompt. Uses startup prompt delivery by default; `--inject-file` writes bounded `CMEM:CAPSULE` markers into `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, or `.cursor/rules/`. |
|
|
39
|
+
| `cmem resume --to <cli> [--exec] [--dry-run]` | Deliver the capsule and optionally launch the target CLI (`claude`, `codex`, `gemini`, `agy`, `cursor`). |
|
|
40
|
+
| `cmem search <query> [--cli <src>] [--limit 20]` | Full-text BM25 search across capsules, locked decisions, and dead ends. |
|
|
41
|
+
| `cmem checkpoint -m <note> [--type <cat>]` | Pin an architectural decision, constraint, dead end, or next step manually. |
|
|
42
|
+
| `cmem copy` / `cmem clean` | Copy active capsule to clipboard / remove injected `CMEM:CAPSULE` blocks from repo files. |
|
|
43
|
+
| `cmem ui [--port 4319]` | Start background session watcher + local Web Control Plane on `127.0.0.1:4319`. |
|
|
44
|
+
| `cmem mcp` | Start the stdio MCP server (`get_active_context`, `search_past_decisions`, `log_checkpoint`, `prepare_handoff`). |
|
|
45
|
+
|
|
46
|
+
## MCP Server Configuration (`cmem mcp`)
|
|
47
|
+
|
|
48
|
+
If installed globally (`npm i -g context-mule`), configure each CLI with `"command": "cmem"` and `"args": ["mcp"]` (or use `"npx"`, `["-y", "context-mule", "mcp"]` without global install).
|
|
49
|
+
|
|
50
|
+
### Antigravity CLI (`~/.gemini/antigravity/mcp_config.json`)
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"cmem": {
|
|
56
|
+
"command": "cmem",
|
|
57
|
+
"args": ["mcp"]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Claude Code (`~/.claude.json` or `.mcp.json`)
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"mcpServers": {
|
|
68
|
+
"cmem": {
|
|
69
|
+
"command": "cmem",
|
|
70
|
+
"args": ["mcp"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Codex CLI (`~/.codex/config.toml`)
|
|
77
|
+
|
|
78
|
+
```toml
|
|
79
|
+
[mcp_servers.cmem]
|
|
80
|
+
command = "cmem"
|
|
81
|
+
args = ["mcp"]
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Cursor (`.cursor/mcp.json` or `~/.cursor/mcp.json`)
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"mcpServers": {
|
|
89
|
+
"cmem": {
|
|
90
|
+
"command": "cmem",
|
|
91
|
+
"args": ["mcp"]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Security & Privacy
|
|
98
|
+
|
|
99
|
+
- **100% Local:** Database (`~/.cmem/cmem.db`) and web dashboard (`127.0.0.1:4319`) never bind externally or call cloud APIs during Tier-1 distillation.
|
|
100
|
+
- **Pre-Persistence Redaction:** API keys, Bearer tokens, DB connection strings, PEM blocks, and high-entropy secrets are masked as `[REDACTED:<KIND>:<hash>]` before SQLite insertion or capsule export.
|
|
101
|
+
- **Read-Only Host Logs:** Host CLI stores (`~/.claude`, `~/.gemini`, `~/.codex`, Cursor `state.vscdb`) are never modified or write-locked.
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
MIT
|