MemorySync

Command line

Memory from your terminal

Store and search agent memory without writing a client. Twenty-four commands, a JSON mode built for agent tool loops, and no dependencies at all.

Needs Node 18 or newer, or Python 3.9 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
24
Commands
0
Dependencies
70 kB
Packed size
5
Output formats
4
Shells completed
01

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.

bash
# Sign in and store your API key securely
memorysync init
# Store a fact for a specific end user
memorysync add "I prefer TypeScript over JavaScript" --user alice
# Find memories by meaning, not exact words
memorysync search "language preference" --user alice
# See recent memories as a table
memorysync list --user alice -o table

A bad key fails now, not later

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.

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

Set MEMORYSYNC_API_KEY instead. Nothing is written to disk.

02

No signup

An agent can get its own key

No email, no verification code, nobody signing anything. The account is real, and stays unowned until a human claims it.

bash
# Create an anonymous account — no email, no verification
memorysync init --agent
# Store a memory (uses the generated end-user id)
memorysync add "I prefer TypeScript over JavaScript"
# Search it back
memorysync search "language preference"
# Later, claim the account with your email
memorysync init --email you@example.com

It arrives with an identity

A generated end-user id like swift-otter-4821, so the agent does not have to invent one and then forget which it used. identify renames it.

200 writes, 500 reads, 10 MB, 7 days

Every command on an unclaimed key prints one line on stderr saying it expires — on stderr, so piped --json stays clean.

Claiming keeps everything

It emails a code and upgrades the account in place: same key, same project, and everything already stored is still there. Add --password to sign in to the dashboard straight away, or set one from the link that is emailed to you.

03

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.

bash
# Put --json before any command for machine-readable output
memorysync --json search "preferences" --user alice

One shape, every command

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.

It describes itself

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.

json
{
"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
}
}
04

Surface

Twenty-four 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. --async for large files.
import-status
Progress of a background import. Lists recent ones, or cancels.
migrate
Move an account over from Mem0, Supermemory or Zep, into the right scope per user.
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, or mint one with --agent.
identify
Name the end user later commands default to.
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.
05

Design

What makes it different

Decisions taken because a CLI is scripted and automated, not only typed.

01

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.

02

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.

03

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.

04

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.

05

Nothing to audit

Zero dependencies and 70 kB packed. No transitive tree, no native module, no compile step. npx and pipx both start immediately.

06

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.

06

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.

bash
# Branch on the exit code — each cause has its own number
memorysync add "$FACT" --user "$USER_ID"
case $? in
0) 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
Exit codes
CodeMeaning
0Success
2Usage: unknown command or bad flag
3Authentication
4Plan limit reached
5Network or timeout
6Not 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.