supermemory-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseThe Supermemory CLI is the complete interface to Supermemory from the terminal. It lets you add memories, search, manage documents, configure projects, connect external data sources, and administer teams — all programmatically.
Supermemory CLI是从终端访问Supermemory的完整接口,支持以编程方式添加记忆、执行搜索、管理文档、配置项目、连接外部数据源以及管理团队。
Installation & Auth
安装与身份验证
bash
undefinedbash
undefinedInstall globally
Install globally
npm install -g @supermemory/cli
npm install -g @supermemory/cli
Authenticate (opens browser OAuth flow)
Authenticate (opens browser OAuth flow)
supermemory login
supermemory login
Or use an API key directly
Or use an API key directly
supermemory login --api-key sm_abc_xxx
supermemory login --api-key sm_abc_xxx
Check auth status
Check auth status
supermemory whoami
undefinedsupermemory whoami
undefinedConfiguration
配置
The CLI supports three config scopes:
| Scope | File | Use Case |
|---|---|---|
| | Per-machine secrets, API keys |
| | Shared tag, team-wide defaults |
| | All projects on this machine |
bash
undefined该CLI支持三种配置作用域:
| 作用域 | 文件 | 适用场景 |
|---|---|---|
| | 单机器密钥、API密钥 |
| | 共享标签、团队级默认配置 |
| | 本机所有项目 |
bash
undefinedInteractive setup wizard
Interactive setup wizard
supermemory init
supermemory init
Non-interactive
Non-interactive
supermemory init --scope project --tag my-bot
supermemory init --scope team --tag shared-project
supermemory init --scope global --output json
supermemory init --scope project --tag my-bot
supermemory init --scope team --tag shared-project
supermemory init --scope global --output json
View/set config values
View/set config values
supermemory config
supermemory config set tag my-project
supermemory config set verbose true
supermemory config get tag
undefinedsupermemory config
supermemory config set tag my-project
supermemory config set verbose true
supermemory config get tag
undefinedEnvironment Variables
环境变量
| Variable | Description |
|---|---|
| API key for authentication |
| Override default container tag |
| OpenTelemetry collector endpoint |
| 变量 | 描述 |
|---|---|
| 用于身份验证的API密钥 |
| 覆盖默认容器标签 |
| OpenTelemetry收集器端点 |
Global Flags
全局标志
| Flag | Description |
|---|---|
| Force JSON output (machine-readable) |
| Override default container tag for this command |
| Show help for any command |
| 标志 | 描述 |
|---|---|
| 强制输出JSON格式(机器可读) |
| 覆盖本次命令的默认容器标签 |
| 显示任意命令的帮助信息 |
Core Commands
核心命令
add
— Ingest content
addadd
— 导入内容
addIngest text, files, or URLs and extract memories into a container tag.
bash
undefined导入文本、文件或URL,并将记忆提取到容器标签中。
bash
undefinedAdd text
Add text
supermemory add "User prefers TypeScript over JavaScript"
supermemory add "User prefers TypeScript over JavaScript"
Add a file (PDF, markdown, text, etc.)
Add a file (PDF, markdown, text, etc.)
supermemory add ./meeting-notes.pdf --tag meetings
supermemory add ./meeting-notes.pdf --tag meetings
Add a URL
Add a URL
supermemory add https://docs.example.com/api --tag docs
supermemory add https://docs.example.com/api --tag docs
Read from stdin
Read from stdin
cat file.txt | supermemory add --stdin
echo "some content" | supermemory add --stdin --tag notes
cat file.txt | supermemory add --stdin
echo "some content" | supermemory add --stdin --tag notes
With metadata
With metadata
supermemory add "Design doc v2" --metadata '{"category": "engineering", "priority": "high"}'
supermemory add "Design doc v2" --metadata '{"category": "engineering", "priority": "high"}'
Custom document ID
Custom document ID
supermemory add "My doc" --id custom-doc-id --tag project
supermemory add "My doc" --id custom-doc-id --tag project
Batch mode (JSONL from stdin, each line: {"content": "...", "tag": "..."})
Batch mode (JSONL from stdin, each line: {"content": "...", "tag": "..."})
cat batch.jsonl | supermemory add --batch
**Options:**
- `--tag <string>` — Container tag
- `--stdin` — Read content from stdin
- `--title <string>` — Document title
- `--metadata <json>` — JSON metadata object
- `--id <string>` — Custom document ID
- `--batch` — Batch mode, reads JSONL from stdincat batch.jsonl | supermemory add --batch
**选项:**
- `--tag <string>` — 容器标签
- `--stdin` — 从标准输入读取内容
- `--title <string>` — 文档标题
- `--metadata <json>` — JSON元数据对象
- `--id <string>` — 自定义文档ID
- `--batch` — 批量模式,从标准输入读取JSONL格式数据search
— Search memories
searchsearch
— 搜索记忆
searchSemantic search across memories with filtering and reranking.
bash
undefined对记忆执行语义搜索,支持过滤和重排序。
bash
undefinedBasic search
Basic search
supermemory search "authentication patterns"
supermemory search "authentication patterns"
Scoped to a tag with limit
Scoped to a tag with limit
supermemory search "auth" --tag api --limit 5
supermemory search "auth" --tag api --limit 5
With reranking for better relevance
With reranking for better relevance
supermemory search "database migrations" --rerank
supermemory search "database migrations" --rerank
Query rewriting (LLM rewrites query for better results)
Query rewriting (LLM rewrites query for better results)
supermemory search "how do we handle auth" --rewrite
supermemory search "how do we handle auth" --rewrite
Different search modes
Different search modes
supermemory search "user prefs" --mode memories # extracted memories only
supermemory search "user prefs" --mode hybrid # memories + document chunks
supermemory search "user prefs" --mode documents # full documents only
supermemory search "user prefs" --mode memories # extracted memories only
supermemory search "user prefs" --mode hybrid # memories + document chunks
supermemory search "user prefs" --mode documents # full documents only
Include specific fields
Include specific fields
supermemory search "api design" --include summary,chunks,memories
supermemory search "api design" --include summary,chunks,memories
Metadata filtering
Metadata filtering
supermemory search "design" --filter '{"AND": [{"key": "category", "value": "engineering"}]}'
supermemory search "design" --filter '{"AND": [{"key": "category", "value": "engineering"}]}'
Similarity threshold (0-1)
Similarity threshold (0-1)
supermemory search "preferences" --threshold 0.5
**Options:**
- `--tag <string>` — Filter by container tag
- `--limit <number>` — Max results (default: 10)
- `--threshold <number>` — Similarity threshold 0-1 (default: 0)
- `--rerank` — Enable reranking for better relevance
- `--rewrite` — Rewrite query using LLM
- `--mode <string>` — `memories` | `hybrid` | `documents` (default: memories)
- `--include <string>` — Fields: summary, chunks, memories, document
- `--filter <json>` — Metadata filter objectsupermemory search "preferences" --threshold 0.5
**选项:**
- `--tag <string>` — 按容器标签过滤
- `--limit <number>` — 最大结果数(默认:10)
- `--threshold <number>` — 相似度阈值0-1(默认:0)
- `--rerank` — 启用重排序以提升相关性
- `--rewrite` — 使用LLM重写查询
- `--mode <string>` — `memories` | `hybrid` | `documents`(默认:memories)
- `--include <string>` — 字段:summary、chunks、memories、document
- `--filter <json>` — 元数据过滤对象remember
— Store a memory directly
rememberremember
— 直接存储记忆
rememberStore a specific fact or memory without ingesting a full document.
bash
undefined无需导入完整文档,直接存储特定事实或记忆。
bash
undefinedStore a memory
Store a memory
supermemory remember "User prefers dark mode" --tag user_123
supermemory remember "User prefers dark mode" --tag user_123
Mark as permanent/static (won't decay)
Mark as permanent/static (won't decay)
supermemory remember "User is a senior engineer at Acme Corp" --static --tag user_123
supermemory remember "User is a senior engineer at Acme Corp" --static --tag user_123
With metadata
With metadata
supermemory remember "Discussed Q3 roadmap" --tag meetings --metadata '{"type": "decision"}'
**Options:**
- `--tag <string>` — Container tag
- `--static` — Mark as permanent memory
- `--metadata <json>` — JSON metadatasupermemory remember "Discussed Q3 roadmap" --tag meetings --metadata '{"type": "decision"}'
**选项:**
- `--tag <string>` — 容器标签
- `--static` — 标记为永久记忆
- `--metadata <json>` — JSON元数据forget
— Delete a memory
forgetforget
— 删除记忆
forgetbash
undefinedbash
undefinedForget by memory ID
Forget by memory ID
supermemory forget mem_abc123 --tag default
supermemory forget mem_abc123 --tag default
Forget by content match
Forget by content match
supermemory forget --content "outdated preference" --tag default
supermemory forget --content "outdated preference" --tag default
With reason
With reason
supermemory forget mem_abc123 --reason "User corrected this information"
**Options:**
- `--tag <string>` — Container tag
- `--reason <string>` — Reason for forgetting
- `--content <string>` — Forget by content match instead of IDsupermemory forget mem_abc123 --reason "User corrected this information"
**选项:**
- `--tag <string>` — 容器标签
- `--reason <string>` — 删除原因
- `--content <string>` — 根据内容匹配删除,而非IDupdate
— Update an existing memory
updateupdate
— 更新现有记忆
updatebash
supermemory update mem_123 "Updated preference: prefers Bun over Node"
supermemory update mem_123 "New content" --metadata '{"updated": true}'Options:
- — Container tag
--tag <string> - — Updated metadata
--metadata <json> - — Reason for update
--reason <string>
bash
supermemory update mem_123 "Updated preference: prefers Bun over Node"
supermemory update mem_123 "New content" --metadata '{"updated": true}'选项:
- — 容器标签
--tag <string> - — 更新后的元数据
--metadata <json> - — 更新原因
--reason <string>
profile
— Get user profile
profileprofile
— 获取用户配置文件
profileRetrieve the auto-generated user profile for a container tag.
bash
undefined检索容器标签对应的自动生成用户配置文件。
bash
undefinedGet profile for default tag
Get profile for default tag
supermemory profile
supermemory profile
Get profile for specific tag
Get profile for specific tag
supermemory profile user_123
supermemory profile user_123
Search within the profile
Search within the profile
supermemory profile user_123 --query "programming preferences"
Returns static facts (long-term) and dynamic context (recent activity).
---supermemory profile user_123 --query "programming preferences"
返回静态事实(长期)和动态上下文(近期活动)。
---Document Management
文档管理
docs
— Manage documents
docsdocs
— 管理文档
docsbash
undefinedbash
undefinedList documents
List documents
supermemory docs list --tag default --limit 20
supermemory docs list --tag default --limit 20
Get a specific document
Get a specific document
supermemory docs get doc_abc123
supermemory docs get doc_abc123
Check processing status
Check processing status
supermemory docs status doc_abc123
supermemory docs status doc_abc123
View document chunks
View document chunks
supermemory docs chunks doc_abc123
supermemory docs chunks doc_abc123
Delete a document
Delete a document
supermemory docs delete doc_abc123 --yes
**Subcommands:** `list`, `get`, `delete`, `chunks`, `status`
---supermemory docs delete doc_abc123 --yes
**子命令:** `list`, `get`, `delete`, `chunks`, `status`
---Container Tags
容器标签
tags
— Manage container tags
tagstags
— 管理容器标签
tagsContainer tags scope memories to users, projects, or any logical grouping.
bash
undefined容器标签用于将记忆按用户、项目或任意逻辑分组。
bash
undefinedList all tags
List all tags
supermemory tags list
supermemory tags list
Get tag info (memory count, doc count, etc.)
Get tag info (memory count, doc count, etc.)
supermemory tags info user_123
supermemory tags info user_123
Create a new tag
Create a new tag
supermemory tags create my-new-project
supermemory tags create my-new-project
Set context on a tag (injected into profile responses)
Set context on a tag (injected into profile responses)
supermemory tags context user_123 --set "This user is a premium customer"
supermemory tags context user_123 --set "This user is a premium customer"
Clear context
Clear context
supermemory tags context user_123 --clear
supermemory tags context user_123 --clear
Merge tags (moves all memories from source to target)
Merge tags (moves all memories from source to target)
supermemory tags merge old-tag --into new-tag --yes
supermemory tags merge old-tag --into new-tag --yes
Delete a tag
Delete a tag
supermemory tags delete old-tag --yes
**Subcommands:** `list`, `info`, `create`, `delete`, `context`, `merge`
---supermemory tags delete old-tag --yes
**子命令:** `list`, `info`, `create`, `delete`, `context`, `merge`
---API Keys
API密钥
keys
— Manage API keys
keyskeys
— 管理API密钥
keysbash
undefinedbash
undefinedList all keys
List all keys
supermemory keys list
supermemory keys list
Create a new key
Create a new key
supermemory keys create --name my-agent --permission write
supermemory keys create --name my-agent --permission write
Create a scoped key (restricted to one container tag)
Create a scoped key (restricted to one container tag)
supermemory keys create --name bot-key --tag user_123 --expires 30
supermemory keys create --name bot-key --tag user_123 --expires 30
Revoke a key
Revoke a key
supermemory keys revoke key_abc123 --yes
supermemory keys revoke key_abc123 --yes
Toggle a key on/off
Toggle a key on/off
supermemory keys toggle key_abc123
**Subcommands:** `list`, `create`, `revoke`, `toggle`
---supermemory keys toggle key_abc123
**子命令:** `list`, `create`, `revoke`, `toggle`
---Connectors
连接器
connectors
— External data sources
connectorsconnectors
— 外部数据源
connectorsConnect Google Drive, Notion, OneDrive, and other services to automatically sync documents.
bash
undefined连接Google Drive、Notion、OneDrive等服务,自动同步文档。
bash
undefinedList connected services
List connected services
supermemory connectors list
supermemory connectors list
Connect a service (opens OAuth flow)
Connect a service (opens OAuth flow)
supermemory connectors connect google-drive --tag docs
supermemory connectors connect notion --tag notes
supermemory connectors connect google-drive --tag docs
supermemory connectors connect notion --tag notes
Trigger a sync
Trigger a sync
supermemory connectors sync conn_abc123
supermemory connectors sync conn_abc123
View sync history
View sync history
supermemory connectors history conn_abc123 --limit 10
supermemory connectors history conn_abc123 --limit 10
List synced resources
List synced resources
supermemory connectors resources conn_abc123
supermemory connectors resources conn_abc123
Disconnect
Disconnect
supermemory connectors disconnect conn_abc123 --yes
**Subcommands:** `list`, `connect`, `sync`, `history`, `disconnect`, `resources`
---supermemory connectors disconnect conn_abc123 --yes
**子命令:** `list`, `connect`, `sync`, `history`, `disconnect`, `resources`
---Plugins
插件
plugins
— IDE and tool integrations
pluginsplugins
— IDE与工具集成
pluginsConnect the CLI to Claude Code, Cursor, and other tools.
bash
undefined将CLI连接到Claude Code、Cursor等工具。
bash
undefinedList available plugins
List available plugins
supermemory plugins list
supermemory plugins list
Connect a plugin (with auto-configuration)
Connect a plugin (with auto-configuration)
supermemory plugins connect claude-code --auto-configure
supermemory plugins connect cursor --auto-configure
supermemory plugins connect claude-code --auto-configure
supermemory plugins connect cursor --auto-configure
Check plugin status
Check plugin status
supermemory plugins status claude-code
supermemory plugins status claude-code
Revoke a plugin connection
Revoke a plugin connection
supermemory plugins revoke claude-code --yes
**Subcommands:** `list`, `connect`, `revoke`, `status`
---supermemory plugins revoke claude-code --yes
**子命令:** `list`, `connect`, `revoke`, `status`
---Team Management
团队管理
team
— Manage team members
teamteam
— 管理团队成员
teambash
undefinedbash
undefinedList team members
List team members
supermemory team list
supermemory team list
Invite a member
Invite a member
supermemory team invite user@example.com --role admin
supermemory team invite user@example.com --role member
supermemory team invite user@example.com --role admin
supermemory team invite user@example.com --role member
Change a member's role
Change a member's role
supermemory team role member_123 admin
supermemory team role member_123 admin
Remove a member
Remove a member
supermemory team remove member_123 --yes
supermemory team remove member_123 --yes
View pending invitations
View pending invitations
supermemory team invitations
**Subcommands:** `list`, `invite`, `remove`, `role`, `invitations`
---supermemory team invitations
**子命令:** `list`, `invite`, `remove`, `role`, `invitations`
---Monitoring
监控
status
— Account dashboard
statusstatus
— 账户仪表板
statusbash
supermemory status
supermemory status --period 7d # 24h, 7d, 30d, allShows memory count, document count, API usage, and storage.
bash
supermemory status
supermemory status --period 7d # 24h, 7d, 30d, all显示记忆数量、文档数量、API使用情况和存储容量。
logs
— Request logs
logslogs
— 请求日志
logsbash
undefinedbash
undefinedRecent logs
Recent logs
supermemory logs
supermemory logs
Filter by time period
Filter by time period
supermemory logs --period 7d
supermemory logs --period 7d
Filter by status
Filter by status
supermemory logs --status error
supermemory logs --status error
Filter by request type
Filter by request type
supermemory logs --type search
supermemory logs --type search
Get a specific log entry
Get a specific log entry
supermemory logs get req_abc123
undefinedsupermemory logs get req_abc123
undefinedbilling
— Usage and billing
billingbilling
— 使用情况与账单
billingbash
supermemory billing # Overview
supermemory billing usage # Detailed usage breakdown
supermemory billing invoices # Past invoicesbash
supermemory billing # Overview
supermemory billing usage # Detailed usage breakdown
supermemory billing invoices # Past invoicesUtility Commands
实用命令
bash
undefinedbash
undefinedOpen Supermemory console in browser
Open Supermemory console in browser
supermemory open
supermemory open graph # Memory graph view
supermemory open billing
supermemory open settings
supermemory open docs
supermemory open keys
supermemory open
supermemory open graph # Memory graph view
supermemory open billing
supermemory open settings
supermemory open docs
supermemory open keys
Machine-readable help (useful for LLM agents)
Machine-readable help (useful for LLM agents)
supermemory help --json
supermemory help --all
supermemory help --json
supermemory help --all
Per-command help
Per-command help
supermemory search --help
supermemory tags --help --json
---supermemory search --help
supermemory tags --help --json
---Scoped Keys Mode
限定作用域密钥模式
When using a scoped API key (restricted to a single container tag), only these commands are available:
searchaddrememberforgetupdateprofilewhoamiThe tag is automatically set from the key's scope — no need to pass .
--tag使用限定作用域的API密钥(仅允许访问单个容器标签)时,仅以下命令可用:
searchaddrememberforgetupdateprofilewhoami标签会自动从密钥的作用域中获取,无需传入参数。
--tagCommon Patterns
常见使用模式
Pipe content from other tools
从其他工具管道传输内容
bash
undefinedbash
undefinedIngest git log
Ingest git log
git log --oneline -20 | supermemory add --stdin --tag git-history
git log --oneline -20 | supermemory add --stdin --tag git-history
Ingest command output
Ingest command output
curl -s https://api.example.com/docs | supermemory add --stdin --tag api-docs
curl -s https://api.example.com/docs | supermemory add --stdin --tag api-docs
Pipe search results to jq
Pipe search results to jq
supermemory search "auth" --json | jq '.results[].memory'
undefinedsupermemory search "auth" --json | jq '.results[].memory'
undefinedScripting with JSON output
使用JSON输出进行脚本编写
bash
undefinedbash
undefinedAll commands support --json for machine-readable output
All commands support --json for machine-readable output
supermemory search "query" --json
supermemory tags list --json
supermemory profile user_123 --json
supermemory status --json
undefinedsupermemory search "query" --json
supermemory tags list --json
supermemory profile user_123 --json
supermemory status --json
undefinedCI/CD integration
CI/CD集成
bash
undefinedbash
undefinedUse env var for auth
Use env var for auth
export SUPERMEMORY_API_KEY=sm_abc_xxx
export SUPERMEMORY_API_KEY=sm_abc_xxx
Ingest docs on deploy
Ingest docs on deploy
supermemory add ./docs/api-reference.md --tag api-docs --id api-ref-latest
supermemory add ./docs/api-reference.md --tag api-docs --id api-ref-latest
Check status
Check status
supermemory status --json | jq '.memoryCount'
undefinedsupermemory status --json | jq '.memoryCount'
undefined