重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
supermemory-cli by supermemoryai/skills
npx skills add https://github.com/supermemoryai/skills --skill supermemory-cliSupermemory CLI 是终端中访问 Supermemory 的完整接口。它允许你以编程方式添加记忆、搜索、管理文档、配置项目、连接外部数据源以及管理团队。
# 全局安装
npm install -g @supermemory/cli
# 认证(打开浏览器 OAuth 流程)
supermemory login
# 或直接使用 API 密钥
supermemory login --api-key sm_abc_xxx
# 检查认证状态
supermemory whoami
CLI 支持三种配置作用域:
| 作用域 | 文件 | 使用场景 |
|---|---|---|
project | .supermemory/config.json (被 git 忽略) | 每台机器的密钥、API 密钥 |
team | .supermemory/team.json (提交到仓库) |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 共享标签、团队范围的默认设置 |
global | ~/.config/supermemory/config.json | 本机上的所有项目 |
# 交互式设置向导
supermemory init
# 非交互式
supermemory init --scope project --tag my-bot
supermemory init --scope team --tag shared-project
supermemory init --scope global --output json
# 查看/设置配置值
supermemory config
supermemory config set tag my-project
supermemory config set verbose true
supermemory config get tag
| 变量 | 描述 |
|---|---|
SUPERMEMORY_API_KEY | 用于认证的 API 密钥 |
SUPERMEMORY_TAG | 覆盖默认容器标签 |
OTEL_EXPORTER_OTLP_ENDPOINT | OpenTelemetry 收集器端点 |
| 标志 | 描述 |
|---|---|
--json | 强制 JSON 输出(机器可读) |
--tag | 为此命令覆盖默认容器标签 |
--help | 显示任何命令的帮助 |
add — 摄取内容摄取文本、文件或 URL,并将提取的记忆存入容器标签。
# 添加文本
supermemory add "用户更喜欢 TypeScript 而不是 JavaScript"
# 添加文件(PDF、markdown、文本等)
supermemory add ./meeting-notes.pdf --tag meetings
# 添加 URL
supermemory add https://docs.example.com/api --tag docs
# 从 stdin 读取
cat file.txt | supermemory add --stdin
echo "some content" | supermemory add --stdin --tag notes
# 带元数据
supermemory add "设计文档 v2" --metadata '{"category": "engineering", "priority": "high"}'
# 自定义文档 ID
supermemory add "我的文档" --id custom-doc-id --tag project
# 批处理模式(从 stdin 读取 JSONL,每行:{"content": "...", "tag": "..."})
cat batch.jsonl | supermemory add --batch
选项:
--tag <string> — 容器标签--stdin — 从 stdin 读取内容--title <string> — 文档标题--metadata <json> — JSON 元数据对象--id <string> — 自定义文档 ID--batch — 批处理模式,从 stdin 读取 JSONLsearch — 搜索记忆跨记忆进行语义搜索,支持过滤和重新排序。
# 基本搜索
supermemory search "认证模式"
# 限定在特定标签并限制数量
supermemory search "auth" --tag api --limit 5
# 使用重新排序以获得更好的相关性
supermemory search "数据库迁移" --rerank
# 查询重写(LLM 重写查询以获得更好结果)
supermemory search "我们如何处理认证" --rewrite
# 不同的搜索模式
supermemory search "用户偏好" --mode memories # 仅提取的记忆
supermemory search "用户偏好" --mode hybrid # 记忆 + 文档块
supermemory search "用户偏好" --mode documents # 仅完整文档
# 包含特定字段
supermemory search "api 设计" --include summary,chunks,memories
# 元数据过滤
supermemory search "设计" --filter '{"AND": [{"key": "category", "value": "engineering"}]}'
# 相似度阈值(0-1)
supermemory search "偏好" --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 — 直接存储记忆存储特定的事实或记忆,而无需摄取完整文档。
# 存储一个记忆
supermemory remember "用户偏好深色模式" --tag user_123
# 标记为永久/静态(不会衰减)
supermemory remember "用户是 Acme Corp 的高级工程师" --static --tag user_123
# 带元数据
supermemory remember "讨论了 Q3 路线图" --tag meetings --metadata '{"type": "decision"}'
选项:
--tag <string> — 容器标签--static — 标记为永久记忆--metadata <json> — JSON 元数据forget — 删除记忆# 通过记忆 ID 遗忘
supermemory forget mem_abc123 --tag default
# 通过内容匹配遗忘
supermemory forget --content "过时的偏好" --tag default
# 带原因
supermemory forget mem_abc123 --reason "用户更正了此信息"
选项:
--tag <string> — 容器标签--reason <string> — 遗忘原因--content <string> — 通过内容匹配而非 ID 遗忘update — 更新现有记忆supermemory update mem_123 "更新的偏好:更喜欢 Bun 而不是 Node"
supermemory update mem_123 "新内容" --metadata '{"updated": true}'
选项:
--tag <string> — 容器标签--metadata <json> — 更新的元数据--reason <string> — 更新原因profile — 获取用户档案检索容器标签的自动生成的用户档案。
# 获取默认标签的档案
supermemory profile
# 获取特定标签的档案
supermemory profile user_123
# 在档案内搜索
supermemory profile user_123 --query "编程偏好"
返回静态事实(长期)和动态上下文(近期活动)。
docs — 管理文档# 列出文档
supermemory docs list --tag default --limit 20
# 获取特定文档
supermemory docs get doc_abc123
# 检查处理状态
supermemory docs status doc_abc123
# 查看文档块
supermemory docs chunks doc_abc123
# 删除文档
supermemory docs delete doc_abc123 --yes
子命令: list, get, delete, chunks, status
tags — 管理容器标签容器标签将记忆限定在用户、项目或任何逻辑分组内。
# 列出所有标签
supermemory tags list
# 获取标签信息(记忆数量、文档数量等)
supermemory tags info user_123
# 创建新标签
supermemory tags create my-new-project
# 在标签上设置上下文(注入到档案响应中)
supermemory tags context user_123 --set "此用户是高级客户"
# 清除上下文
supermemory tags context user_123 --clear
# 合并标签(将所有记忆从源移动到目标)
supermemory tags merge old-tag --into new-tag --yes
# 删除标签
supermemory tags delete old-tag --yes
子命令: list, info, create, delete, context, merge
keys — 管理 API 密钥# 列出所有密钥
supermemory keys list
# 创建新密钥
supermemory keys create --name my-agent --permission write
# 创建限定范围的密钥(仅限于一个容器标签)
supermemory keys create --name bot-key --tag user_123 --expires 30
# 撤销密钥
supermemory keys revoke key_abc123 --yes
# 切换密钥开关状态
supermemory keys toggle key_abc123
子命令: list, create, revoke, toggle
connectors — 外部数据源连接 Google Drive、Notion、OneDrive 和其他服务,以自动同步文档。
# 列出已连接的服务
supermemory connectors list
# 连接服务(打开 OAuth 流程)
supermemory connectors connect google-drive --tag docs
supermemory connectors connect notion --tag notes
# 触发同步
supermemory connectors sync conn_abc123
# 查看同步历史
supermemory connectors history conn_abc123 --limit 10
# 列出已同步的资源
supermemory connectors resources conn_abc123
# 断开连接
supermemory connectors disconnect conn_abc123 --yes
子命令: list, connect, sync, history, disconnect, resources
plugins — IDE 和工具集成将 CLI 连接到 Claude Code、Cursor 和其他工具。
# 列出可用插件
supermemory plugins list
# 连接插件(带自动配置)
supermemory plugins connect claude-code --auto-configure
supermemory plugins connect cursor --auto-configure
# 检查插件状态
supermemory plugins status claude-code
# 撤销插件连接
supermemory plugins revoke claude-code --yes
子命令: list, connect, revoke, status
team — 管理团队成员# 列出团队成员
supermemory team list
# 邀请成员
supermemory team invite user@example.com --role admin
supermemory team invite user@example.com --role member
# 更改成员角色
supermemory team role member_123 admin
# 移除成员
supermemory team remove member_123 --yes
# 查看待处理邀请
supermemory team invitations
子命令: list, invite, remove, role, invitations
status — 账户仪表板supermemory status
supermemory status --period 7d # 24h, 7d, 30d, all
显示记忆数量、文档数量、API 使用情况和存储情况。
logs — 请求日志# 近期日志
supermemory logs
# 按时间段过滤
supermemory logs --period 7d
# 按状态过滤
supermemory logs --status error
# 按请求类型过滤
supermemory logs --type search
# 获取特定日志条目
supermemory logs get req_abc123
billing — 使用情况和计费supermemory billing # 概览
supermemory billing usage # 详细使用情况细分
supermemory billing invoices # 历史发票
# 在浏览器中打开 Supermemory 控制台
supermemory open
supermemory open graph # 记忆图视图
supermemory open billing
supermemory open settings
supermemory open docs
supermemory open keys
# 机器可读的帮助(对 LLM 代理有用)
supermemory help --json
supermemory help --all
# 每个命令的帮助
supermemory search --help
supermemory tags --help --json
当使用限定范围的 API 密钥(仅限于单个容器标签)时,只有以下命令可用:
search, add, remember, forget, update, profile, whoami
标签会自动从密钥的作用域设置 — 无需传递 --tag。
# 摄取 git 日志
git log --oneline -20 | supermemory add --stdin --tag git-history
# 摄取命令输出
curl -s https://api.example.com/docs | supermemory add --stdin --tag api-docs
# 将搜索结果管道传输到 jq
supermemory search "auth" --json | jq '.results[].memory'
# 所有命令都支持 --json 以获得机器可读的输出
supermemory search "query" --json
supermemory tags list --json
supermemory profile user_123 --json
supermemory status --json
# 使用环境变量进行认证
export SUPERMEMORY_API_KEY=sm_abc_xxx
# 部署时摄取文档
supermemory add ./docs/api-reference.md --tag api-docs --id api-ref-latest
# 检查状态
supermemory status --json | jq '.memoryCount'
每周安装次数
61
仓库
GitHub 星标数
2
首次出现
7 天前
安全审计
安装于
cline61
gemini-cli61
warp61
cursor61
opencode61
codex61
The 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.
# Install globally
npm install -g @supermemory/cli
# Authenticate (opens browser OAuth flow)
supermemory login
# Or use an API key directly
supermemory login --api-key sm_abc_xxx
# Check auth status
supermemory whoami
The CLI supports three config scopes:
| Scope | File | Use Case |
|---|---|---|
project | .supermemory/config.json (gitignored) | Per-machine secrets, API keys |
team | .supermemory/team.json (committed) | Shared tag, team-wide defaults |
global | ~/.config/supermemory/config.json | All projects on this machine |
# Interactive setup wizard
supermemory init
# Non-interactive
supermemory init --scope project --tag my-bot
supermemory init --scope team --tag shared-project
supermemory init --scope global --output json
# View/set config values
supermemory config
supermemory config set tag my-project
supermemory config set verbose true
supermemory config get tag
| Variable | Description |
|---|---|
SUPERMEMORY_API_KEY | API key for authentication |
SUPERMEMORY_TAG | Override default container tag |
OTEL_EXPORTER_OTLP_ENDPOINT | OpenTelemetry collector endpoint |
| Flag | Description |
|---|---|
--json | Force JSON output (machine-readable) |
--tag | Override default container tag for this command |
--help | Show help for any command |
add — Ingest contentIngest text, files, or URLs and extract memories into a container tag.
# Add text
supermemory add "User prefers TypeScript over JavaScript"
# Add a file (PDF, markdown, text, etc.)
supermemory add ./meeting-notes.pdf --tag meetings
# Add a URL
supermemory add https://docs.example.com/api --tag docs
# Read from stdin
cat file.txt | supermemory add --stdin
echo "some content" | supermemory add --stdin --tag notes
# With metadata
supermemory add "Design doc v2" --metadata '{"category": "engineering", "priority": "high"}'
# Custom document ID
supermemory add "My doc" --id custom-doc-id --tag project
# 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 stdinsearch — Search memoriesSemantic search across memories with filtering and reranking.
# Basic search
supermemory search "authentication patterns"
# Scoped to a tag with limit
supermemory search "auth" --tag api --limit 5
# With reranking for better relevance
supermemory search "database migrations" --rerank
# Query rewriting (LLM rewrites query for better results)
supermemory search "how do we handle auth" --rewrite
# 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
# Include specific fields
supermemory search "api design" --include summary,chunks,memories
# Metadata filtering
supermemory search "design" --filter '{"AND": [{"key": "category", "value": "engineering"}]}'
# 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, documentremember — Store a memory directlyStore a specific fact or memory without ingesting a full document.
# Store a memory
supermemory remember "User prefers dark mode" --tag user_123
# Mark as permanent/static (won't decay)
supermemory remember "User is a senior engineer at Acme Corp" --static --tag user_123
# 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 metadataforget — Delete a memory# Forget by memory ID
supermemory forget mem_abc123 --tag default
# Forget by content match
supermemory forget --content "outdated preference" --tag default
# 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 IDupdate — Update an existing memorysupermemory update mem_123 "Updated preference: prefers Bun over Node"
supermemory update mem_123 "New content" --metadata '{"updated": true}'
Options:
--tag <string> — Container tag--metadata <json> — Updated metadata--reason <string> — Reason for updateprofile — Get user profileRetrieve the auto-generated user profile for a container tag.
# Get profile for default tag
supermemory profile
# Get profile for specific tag
supermemory profile user_123
# Search within the profile
supermemory profile user_123 --query "programming preferences"
Returns static facts (long-term) and dynamic context (recent activity).
docs — Manage documents# List documents
supermemory docs list --tag default --limit 20
# Get a specific document
supermemory docs get doc_abc123
# Check processing status
supermemory docs status doc_abc123
# View document chunks
supermemory docs chunks doc_abc123
# Delete a document
supermemory docs delete doc_abc123 --yes
Subcommands: list, get, delete, chunks, status
tags — Manage container tagsContainer tags scope memories to users, projects, or any logical grouping.
# List all tags
supermemory tags list
# Get tag info (memory count, doc count, etc.)
supermemory tags info user_123
# Create a new tag
supermemory tags create my-new-project
# Set context on a tag (injected into profile responses)
supermemory tags context user_123 --set "This user is a premium customer"
# Clear context
supermemory tags context user_123 --clear
# Merge tags (moves all memories from source to target)
supermemory tags merge old-tag --into new-tag --yes
# Delete a tag
supermemory tags delete old-tag --yes
Subcommands: list, info, create, delete, context, merge
keys — Manage API keys# List all keys
supermemory keys list
# Create a new key
supermemory keys create --name my-agent --permission write
# Create a scoped key (restricted to one container tag)
supermemory keys create --name bot-key --tag user_123 --expires 30
# Revoke a key
supermemory keys revoke key_abc123 --yes
# Toggle a key on/off
supermemory keys toggle key_abc123
Subcommands: list, create, revoke, toggle
connectors — External data sourcesConnect Google Drive, Notion, OneDrive, and other services to automatically sync documents.
# List connected services
supermemory connectors list
# Connect a service (opens OAuth flow)
supermemory connectors connect google-drive --tag docs
supermemory connectors connect notion --tag notes
# Trigger a sync
supermemory connectors sync conn_abc123
# View sync history
supermemory connectors history conn_abc123 --limit 10
# List synced resources
supermemory connectors resources conn_abc123
# Disconnect
supermemory connectors disconnect conn_abc123 --yes
Subcommands: list, connect, sync, history, disconnect, resources
plugins — IDE and tool integrationsConnect the CLI to Claude Code, Cursor, and other tools.
# List available plugins
supermemory plugins list
# Connect a plugin (with auto-configuration)
supermemory plugins connect claude-code --auto-configure
supermemory plugins connect cursor --auto-configure
# Check plugin status
supermemory plugins status claude-code
# Revoke a plugin connection
supermemory plugins revoke claude-code --yes
Subcommands: list, connect, revoke, status
team — Manage team members# List team members
supermemory team list
# Invite a member
supermemory team invite user@example.com --role admin
supermemory team invite user@example.com --role member
# Change a member's role
supermemory team role member_123 admin
# Remove a member
supermemory team remove member_123 --yes
# View pending invitations
supermemory team invitations
Subcommands: list, invite, remove, role, invitations
status — Account dashboardsupermemory status
supermemory status --period 7d # 24h, 7d, 30d, all
Shows memory count, document count, API usage, and storage.
logs — Request logs# Recent logs
supermemory logs
# Filter by time period
supermemory logs --period 7d
# Filter by status
supermemory logs --status error
# Filter by request type
supermemory logs --type search
# Get a specific log entry
supermemory logs get req_abc123
billing — Usage and billingsupermemory billing # Overview
supermemory billing usage # Detailed usage breakdown
supermemory billing invoices # Past invoices
# 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
# Machine-readable help (useful for LLM agents)
supermemory help --json
supermemory help --all
# Per-command help
supermemory search --help
supermemory tags --help --json
When using a scoped API key (restricted to a single container tag), only these commands are available:
search, add, remember, forget, update, profile, whoami
The tag is automatically set from the key's scope — no need to pass --tag.
# Ingest git log
git log --oneline -20 | supermemory add --stdin --tag git-history
# Ingest command output
curl -s https://api.example.com/docs | supermemory add --stdin --tag api-docs
# Pipe search results to jq
supermemory search "auth" --json | jq '.results[].memory'
# All commands support --json for machine-readable output
supermemory search "query" --json
supermemory tags list --json
supermemory profile user_123 --json
supermemory status --json
# Use env var for auth
export SUPERMEMORY_API_KEY=sm_abc_xxx
# Ingest docs on deploy
supermemory add ./docs/api-reference.md --tag api-docs --id api-ref-latest
# Check status
supermemory status --json | jq '.memoryCount'
Weekly Installs
61
Repository
GitHub Stars
2
First Seen
7 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
cline61
gemini-cli61
warp61
cursor61
opencode61
codex61
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
53,700 周安装
--filter <json> — Metadata filter object