Command line
Memory from your terminal
Store and search agent memory without writing a client. Twenty-one commands, a JSON mode built for agent tool loops, and no dependencies at all.
Needs Node 18 or newer. Works on macOS, Linux and Windows.
Install it globally.
npm install -g memorysync-cli
Or try it without installing.
npx memorysync-cli help
- 21
- Commands
- 0
- Dependencies
- 39 kB
- Packed size
- 5
- Output formats
- 4
- Shells completed
First run
Four commands to useful
Sign in once, store something, read it back. Memory is always scoped to an end user, so every command names one.
memorysync initmemorysync add "I prefer TypeScript over JavaScript" --user alicememorysync search "language preference" --user alicememorysync list --user alice -o table
init verifies the key against the API before saving it, so a bad paste fails immediately rather than turning into a puzzle three commands later.
It also stores nothing in plain text. The key goes to your OS keychain where one is reachable, and otherwise to a file only you can read, encrypted at rest.
In CI, skip all of it and set MEMORYSYNC_API_KEY. Nothing is written to disk.
For agents
A JSON mode that does not surprise you
Put --json before any command. One envelope, always, whether the command worked or not.
Ask for it.
memorysync --json search "preferences" --user alice
Results are an array under data for every command, so .data[] works everywhere rather than only on the commands that happen to return a list.
memorysync help --json returns the whole command tree, so an agent discovers the surface itself instead of being told about it in a prompt that goes stale.
Get this back.
{"status": "success","command": "search","duration_ms": 134,"scope": { "user": "alice" },"count": 1,"data": [{"id": "m_60632","text": "Prefers TypeScript","score": 0.97}],"quota": {"metric": "retrieval_requests","used": 12,"limit": 1000,"exhausted": false}}
Surface
Twenty-one commands
Every one accepts every output format, and help <command> prints its flags and examples.
Memory
- add
- Store a fact. Reads stdin, so it composes with pipes.
- search
- Natural-language search.
- list
- Recent memories for a user.
- get
- One memory, including its ingestion state.
- delete
- Previews by default; changes nothing without --yes.
- import
- Bulk load JSON or JSONL, validated before anything is sent.
- export
- Write out as json, jsonl or csv.
Operations
- quota
- Plan usage and when the cycle resets.
- status
- Credential, API reachability and active scope.
- doctor
- Diagnose setup and say what to fix.
- event
- Track asynchronous ingestion, including a blocking wait.
- source
- Inspect and control connected knowledge sources.
- project
- List projects, or set a default.
Setup
- init
- Store a credential and pick defaults.
- config
- Local configuration and profiles.
- whoami
- The identity and scope in use.
- completion
- bash, zsh, fish and PowerShell.
- mcp
- Connect MemorySync MCP to your AI clients.
- help
- With --json, the whole command tree.
Design
What makes it different
Decisions taken because a CLI is scripted and automated, not only typed.
Built for agent tool loops
One JSON envelope for every command, successes and failures alike, always with results as an array under data. Errors go to stdout beside a non-zero exit, so a tool loop parses both outcomes through one code path.
It tells an agent when it is out of credit
Over a plan limit the API returns success having stored nothing, on purpose, so an assistant never repeats your billing state to an end user. Every billable command carries a quota block so an agent can tell an empty result from a refused one.
Exit codes you can branch on
Distinct codes for usage, authentication, quota, network and not-found, rather than 1 for everything. A CI job reacts to the cause without parsing stderr.
Your key is not sitting in a JSON file
Credentials go to the OS keychain where one is reachable, and otherwise to a file readable only by you, encrypted at rest. The environment always wins, so CI stores nothing.
Nothing to audit
Zero dependencies and 39 kB packed. No transitive tree, no native module, no compile step. npx starts immediately.
It knows about your connectors
GitHub, Slack, Notion, Google Drive, OneDrive, Granola, Amazon S3 and crawled sites: list them, check sync state, trigger a run, pause one. No other memory CLI reaches connectors at all.
In a pipeline
Fails in a way a script can read
Six distinct exit codes instead of one. The quota code matters most: over a plan limit the API succeeds while storing nothing, so this is how a job notices.
memorysync add "$FACT" --user "$USER_ID"case $? in0) echo "stored" ;;3) echo "credential problem"; exit 1 ;;4) echo "out of quota, nothing stored"; exit 1 ;;5) echo "network problem, will retry"; sleep 5 ;;esac
| Code | Meaning |
|---|---|
| 0 | Success |
| 2 | Usage: unknown command or bad flag |
| 3 | Authentication |
| 4 | Plan limit reached |
| 5 | Network or timeout |
| 6 | Not found |
Command line
Try it in one line
No install, no dependencies, nothing to clean up afterwards.
npx memorysync-cli help
Free to start. No credit card.