Connect
CLI
Install the hm command-line tool, sign in, set up your agents and work with memory from the shell
hm (hypermemory-cli) is HyperMemory’s command-line tool. It does three jobs:
- Sets up your agents — Claude Code, Codex, Hermes Agent, Kimi Code and OpenClaw — with the HyperMemory skill, hooks and memory-writer, in one command.
- Reads and writes memory from scripts and shells, with every MCP tool available as a command.
- Gives agents a shell interface to memory, with machine-readable
--jsonoutput and stable exit codes.
Install
Requires Python 3.10 or newer.
Check it with hm version.
Sign in
- Browser (OAuth)
- API key
- Environment variable
Opens your browser to sign in to HyperMemory. Over SSH or without a display, hm login switches to a paste-back flow automatically; force it with --no-browser.
Credentials are stored in your operating system’s keyring (service hypermemory-cli). Without a keyring — or with HYPERMEMORY_NO_KEYRING=1 — they go in ~/.config/hypermemory/config.json with 0600 permissions.
hm logout clears OAuth tokens and keeps any stored API key; hm config --clear-key removes the key.
Set up your agents
hm setup installs the HyperMemory protocol into the agents on your machine: the skill, the hooks that make the agent recall and save every turn, and the memory-writer.
hm setup all # every supported agent it finds
hm setup claude hermes kimi # only these
hm setup codex --scope project # this project only, not your whole user
hm setup all --dry-run # show what would change
| Agent | What hm setup installs |
|---|---|
claude (Claude Code) | Hooks in ~/.claude/settings.json, the hypermemory-cli skill, the hypermemory-memory-writer agent and a marked block in ~/.claude/CLAUDE.md. |
codex (Codex) | The skill, hooks and memory-writer for Codex. |
hermes (Hermes Agent) | A HyperMemory memory provider in $HERMES_HOME/plugins/hypermemory/, the skill, and memory.provider set to hypermemory. |
kimi (Kimi Code) | The skill, hooks and memory-writer for Kimi Code. |
openclaw (OpenClaw) | A native hypermemory-cli plugin that recalls before each prompt and saves after each run. |
Options: --scope user|project (default user), --dry-run, --no-hooks (install the skill without hooks).
hm doctor # check every installed agent and your connection
hm uninstall kimi # remove HyperMemory from one agent
hm uninstall all # remove it everywhere
For Claude Code and Codex, the plugins are the recommended install: they update through the marketplace and connect over MCP. hm setup is the alternative when you prefer the CLI or can’t use a marketplace.
Organizations
If you belong to several organizations, bind each project to one so recall includes the right organization’s memory:
hm org list # your organizations
hm org use org_8c1f… # bind this project (git work tree, else directory)
hm org use none # personal memory only for this project
hm org show # the current binding
hm org clear # remove the binding
Bindings are stored in ~/.config/hypermemory/projects.json and shared with the plugins. Override one call with hm recall "query" --org ID|none.
hm org, hm recall --org and hm skill install need hypermemory-cli 2.3.0 or newer.
Memory commands
Every MCP tool has a command.
| Command | Tool | Example |
|---|---|---|
hm recall QUERY | hm_recall | hm recall "release plan" -n 5 |
hm store KEY DESC | hm_store | hm store fact_launch "Launch is 2 Nov" -t fact -r '[{"to_key":"project_web","relationship":"launch date of the web project"}]' |
hm update KEY | hm_update | hm update fact_launch --desc "Launch moved to 9 Nov" |
hm forget KEY | hm_forget | hm forget fact_old or hm forget --edge-id ID |
hm nodes KEY... | hm_get_nodes | hm nodes fact_launch project_web --relationship-detail full |
hm find KEY | hm_find_related | hm find project_web --depth 2 -q "decisions" |
hm relate | hm_add_relationships | hm relate --from person_alice --to project_web --rel "Alice leads the web project" |
hm relationships KEY | — | List a node’s relationships. |
hm ingest TEXT | hm_ingest | hm ingest "$(cat notes.md)" -c "Platform sync" |
hm orphans | hm_list_orphans | hm orphans -l 100 |
hm overview | hm_get_overview | |
hm timeline | hm_timeline | hm timeline -p 7d -q "deploy" |
hm timeline-write SUMMARY | hm_timeline_write | hm timeline-write "Shipped 2.4" |
hm upload FILE | hm_upload_file | hm upload report.pdf -d "Q3 board report" |
hm files | hm_list_files | hm files -t document -s report |
hm tabular outline|range|search|trace | hm_tabular | hm tabular range FILE_ID -s Sheet1 -r A1:D20 |
hm hm_tokens JSON | hm_tokens | hm hm_tokens @turn.json |
hm skill list|get|check|install | hm_skill | hm skill get -v general -o SKILL.md |
hm export | — | hm export -o backup.json (waits for the export to finish) |
Any option that takes JSON also accepts @path/to/file.json.
Output for scripts and agents
Add --json anywhere on the command line. Standard output is then the server’s JSON on one line, and errors go to standard error as JSON with error, detail, exit_code, status, retryable and request_id.
hm --json overview | jq '.type_counts'
hm --json recall "decisions about auth" | jq -r '.results[].key'
hm export -o "backup-$(date +%F).json"
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Usage error |
| 3 | Not signed in or credentials rejected (401) |
| 4 | Forbidden or plan limit reached (402, 403) |
| 5 | Not found (404, 410) |
| 6 | Request rejected (400, 409, 413, 415, 422) |
| 7 | Rate limited (429) — retry later |
| 8 | Server error (5xx) |
| 9 | Network error |
| 10 | Export incomplete |
Configuration
| Setting | Default | How to change |
|---|---|---|
| API URL | https://api.hypermemory.io | HYPERMEMORY_API_URL or hm config --set-url URL |
| API key | — | HYPERMEMORY_API_KEY, hm login --api-key, or hm config --set-key KEY |
| Keyring | on | HYPERMEMORY_NO_KEYRING=1 |
Credentials are resolved in this order: environment variable, stored API key, stored OAuth token.
| File | Contents |
|---|---|
~/.config/hypermemory/config.json | Settings, and credentials when no keyring is available |
~/.config/hypermemory/projects.json | Project → organization bindings |
~/.config/hypermemory/setup-manifest.json | What hm setup installed, so hm uninstall can remove exactly that |
hm health checks that the API is reachable; hm ready also checks its dependencies (exit code 8 when not ready).