@memstack/cli 0.7.3 → 0.8.1
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/README.md +46 -3
- package/dist/cli.js +1411 -58
- package/dist/cli.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @memstack/cli
|
|
2
2
|
|
|
3
|
-
CLI for MemStack — shell-based agent memory.
|
|
3
|
+
CLI for MemStack — shell-based agent memory. Connect Claude Code and Codex to one shared memory per project, or use it from bash scripts, CI pipelines, or any subprocess-capable agent.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,9 +10,41 @@ npm install -g @memstack/cli
|
|
|
10
10
|
npx @memstack/cli [command]
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
## Claude Code and Codex
|
|
14
|
+
|
|
15
|
+
Give both agents one persistent memory per project. MemStack never installs
|
|
16
|
+
storage drivers; install the one for your store with the MCP server:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g @memstack/cli @memstack/mcp better-sqlite3@^11.10.0
|
|
20
|
+
memstack init # LLM provider + store → ~/.memstack/config.json
|
|
21
|
+
memstack connect claude-code
|
|
22
|
+
memstack connect codex # then approve the MemStack hook once in Codex with /hooks
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
| Command | What it does |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `init` | Choose an LLM provider and store; verifies the key with a real request. Non-interactive: `--provider openai-compatible\|anthropic --base-url <url> --model <name> --api-key-env <VAR> --store <type> [--path <file> \| --url <url>] --yes`. |
|
|
28
|
+
| `connect <claude-code\|codex>` | Registers your installed `memstack-mcp`, adds a session-start hook that loads project memories, and for Codex a marked block in `~/.codex/AGENTS.md`. Checks the server first and undoes everything if a step fails. `--dry-run`, `--no-hooks`, `--no-agents-md`. |
|
|
29
|
+
| `disconnect <claude-code\|codex>` | Removes everything `connect` added, restoring each file exactly. Memories are kept. |
|
|
30
|
+
| `status` | Config, storage, the current project, and each agent's connection, hook, and guidance. |
|
|
31
|
+
| `doctor` | Diagnoses problems and prints the fix for each. `--live` tests the LLM key. Exits non-zero when it finds a problem. |
|
|
32
|
+
| `memories [query]` | Lists or searches the current project's memories. `--global`, `--limit <n>`, `--delete <id>`. |
|
|
33
|
+
| `project` | Shows the current project ID. `project pin <id>` writes `.memstack.json`; `project merge <old-id>` moves memories from an old ID. |
|
|
34
|
+
|
|
35
|
+
These commands print readable text, not JSON, and read
|
|
36
|
+
`~/.memstack/config.json` (or `$MEMSTACK_HOME/config.json`) overlaid with the
|
|
37
|
+
environment variables below. Projects are identified by the repository's
|
|
38
|
+
first commit, so clones, worktrees, and renamed remotes share memories. See
|
|
39
|
+
[Harness Memory](https://github.com/isiomaC/memstack#harness-memory-claude-code--codex)
|
|
40
|
+
for details.
|
|
41
|
+
|
|
13
42
|
## Configuration
|
|
14
43
|
|
|
15
|
-
|
|
44
|
+
Every command reads `~/.memstack/config.json` (written by `memstack init`),
|
|
45
|
+
overlaid with these environment variables: any LLM variable replaces the
|
|
46
|
+
file's LLM settings, and `MEMSTACK_STORAGE` replaces its storage settings.
|
|
47
|
+
`memstack status` shows which source is in use. Same scheme as @memstack/mcp.
|
|
16
48
|
|
|
17
49
|
| Variable | Purpose | Default |
|
|
18
50
|
|---|---|---|
|
|
@@ -29,7 +61,18 @@ All via environment variables. Same scheme as @memstack/mcp.
|
|
|
29
61
|
|
|
30
62
|
## Commands
|
|
31
63
|
|
|
32
|
-
|
|
64
|
+
The memory commands below print JSON to stdout. Errors go to stderr.
|
|
65
|
+
`memstack <command> --help` prints a command's flags; `memstack --version`
|
|
66
|
+
prints the installed version.
|
|
67
|
+
|
|
68
|
+
Inside a code repository, `--project` can replace `--actor` on any of them. It
|
|
69
|
+
uses the repository's project, the same memory Claude Code and Codex share
|
|
70
|
+
through `memstack connect`:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
memstack store --project --content "Deploy with fly deploy" --type instruction
|
|
74
|
+
memstack retrieve --project --query "deploy"
|
|
75
|
+
```
|
|
33
76
|
|
|
34
77
|
### store
|
|
35
78
|
```bash
|