Supermemory Cli

supermemoryai/skills/supermemory-cli

作者 supermemoryai10d5e16780b4无许可证108 个星标收录于 2026年10月8日更新于 2026年10月8日仓库6天前更新

Use the Supermemory CLI to programmatically manage memories, documents, profiles, tags, connectors, keys, and teams from the terminal. Covers all commands, flags, and usage patterns.

AI 生成的概览

介绍 Supermemory CLI,用于在终端中管理记忆、文档、用户画像、标签、连接器、密钥和团队。

功能
说明如何安装并认证 Supermemory CLI,以及如何使用其命令摄取文本、文件或 URL,执行语义搜索,并存储、更新或删除单条记忆。内容还涵盖文档管理、容器标签、API 密钥、外部连接器、IDE 插件、团队管理、监控、账单以及用于脚本的 JSON 输出。其产出是关于命令、参数和用法模式的参考说明,而非生成文件。
适用场景
当智能体或开发者需要从终端操作 Supermemory 时使用,例如添加或搜索记忆、管理文档和标签,或在 CI/CD 中编写记忆操作脚本。也适合查询具体命令语法、参数和配置范围。不适用于与 Supermemory 服务无关的任务。
运行要求
需要先通过 npm 全局安装 Supermemory CLI(npm install -g @supermemory/cli),并具备 Node.js/npm 运行环境;认证方式为浏览器 OAuth 登录或 API 密钥(SUPERMEMORY_API_KEY)。所有命令都需要网络访问,该技能不附带脚本。

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.

Installation & Auth

bash
# Install globallynpm install -g @supermemory/cli
# Authenticate (opens browser OAuth flow)supermemory login
# Or use an API key directlysupermemory login --api-key sm_abc_xxx
# Check auth statussupermemory whoami

Configuration

The CLI supports three config scopes:

ScopeFileUse 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.jsonAll projects on this machine
bash
# Interactive setup wizardsupermemory init
# Non-interactivesupermemory init --scope project --tag my-botsupermemory init --scope team --tag shared-projectsupermemory init --scope global --output json
# View/set config valuessupermemory configsupermemory config set tag my-projectsupermemory config set verbose truesupermemory config get tag

Environment Variables

VariableDescription
SUPERMEMORY_API_KEYAPI key for authentication
SUPERMEMORY_TAGOverride default container tag
OTEL_EXPORTER_OTLP_ENDPOINTOpenTelemetry collector endpoint

Global Flags

FlagDescription
--jsonForce JSON output (machine-readable)
--tagOverride default container tag for this command
--helpShow help for any command

Core Commands

add — Ingest content

Ingest text, files, or URLs and extract memories into a container tag.

bash
# Add textsupermemory add "User prefers TypeScript over JavaScript"
# Add a file (PDF, markdown, text, etc.)supermemory add ./meeting-notes.pdf --tag meetings
# Add a URLsupermemory add https://docs.example.com/api --tag docs
# Read from stdincat file.txt | supermemory add --stdinecho "some content" | supermemory add --stdin --tag notes
# With metadatasupermemory add "Design doc v2" --metadata '{"category": "engineering", "priority": "high"}'
# Custom document IDsupermemory 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 stdin

search — Search memories

Semantic search across memories with filtering and reranking.

bash
# Basic searchsupermemory search "authentication patterns"
# Scoped to a tag with limitsupermemory search "auth" --tag api --limit 5
# With reranking for better relevancesupermemory search "database migrations" --rerank
# Query rewriting (LLM rewrites query for better results)supermemory search "how do we handle auth" --rewrite
# Different search modessupermemory search "user prefs" --mode memories    # extracted memories onlysupermemory search "user prefs" --mode hybrid      # memories + document chunkssupermemory search "user prefs" --mode documents   # full documents only
# Include specific fieldssupermemory search "api design" --include summary,chunks,memories
# Metadata filteringsupermemory 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, document
  • --filter <json> — Metadata filter object

remember — Store a memory directly

Store a specific fact or memory without ingesting a full document.

bash
# Store a memorysupermemory 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 metadatasupermemory remember "Discussed Q3 roadmap" --tag meetings --metadata '{"type": "decision"}'

Options:

  • --tag <string> — Container tag
  • --static — Mark as permanent memory
  • --metadata <json> — JSON metadata

forget — Delete a memory

bash
# Forget by memory IDsupermemory forget mem_abc123 --tag default
# Forget by content matchsupermemory forget --content "outdated preference" --tag default
# With reasonsupermemory 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 ID

update — Update an existing memory

bash
supermemory 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 update

profile — Get user profile

Retrieve the auto-generated user profile for a container tag.

bash
# Get profile for default tagsupermemory profile
# Get profile for specific tagsupermemory profile user_123
# Search within the profilesupermemory profile user_123 --query "programming preferences"

Returns static facts (long-term) and dynamic context (recent activity).


Document Management

docs — Manage documents

bash
# List documentssupermemory docs list --tag default --limit 20
# Get a specific documentsupermemory docs get doc_abc123
# Check processing statussupermemory docs status doc_abc123
# View document chunkssupermemory docs chunks doc_abc123
# Delete a documentsupermemory docs delete doc_abc123 --yes

Subcommands: list, get, delete, chunks, status


Container Tags

tags — Manage container tags

Container tags scope memories to users, projects, or any logical grouping.

bash
# List all tagssupermemory tags list
# Get tag info (memory count, doc count, etc.)supermemory tags info user_123
# Create a new tagsupermemory 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 contextsupermemory 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 tagsupermemory tags delete old-tag --yes

Subcommands: list, info, create, delete, context, merge


API Keys

keys — Manage API keys

bash
# List all keyssupermemory keys list
# Create a new keysupermemory 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 keysupermemory keys revoke key_abc123 --yes
# Toggle a key on/offsupermemory keys toggle key_abc123

Subcommands: list, create, revoke, toggle


Connectors

connectors — External data sources

Connect Google Drive, Notion, OneDrive, and other services to automatically sync documents.

bash
# List connected servicessupermemory connectors list
# Connect a service (opens OAuth flow)supermemory connectors connect google-drive --tag docssupermemory connectors connect notion --tag notes
# Trigger a syncsupermemory connectors sync conn_abc123
# View sync historysupermemory connectors history conn_abc123 --limit 10
# List synced resourcessupermemory connectors resources conn_abc123
# Disconnectsupermemory connectors disconnect conn_abc123 --yes

Subcommands: list, connect, sync, history, disconnect, resources


Plugins

plugins — IDE and tool integrations

Connect the CLI to Claude Code, Cursor, and other tools.

bash
# List available pluginssupermemory plugins list
# Connect a plugin (with auto-configuration)supermemory plugins connect claude-code --auto-configuresupermemory plugins connect cursor --auto-configure
# Check plugin statussupermemory plugins status claude-code
# Revoke a plugin connectionsupermemory plugins revoke claude-code --yes

Subcommands: list, connect, revoke, status


Team Management

team — Manage team members

bash
# List team memberssupermemory team list
# Invite a membersupermemory team invite [email protected] --role adminsupermemory team invite [email protected] --role member
# Change a member's rolesupermemory team role member_123 admin
# Remove a membersupermemory team remove member_123 --yes
# View pending invitationssupermemory team invitations

Subcommands: list, invite, remove, role, invitations


Monitoring

status — Account dashboard

bash
supermemory statussupermemory status --period 7d    # 24h, 7d, 30d, all

Shows memory count, document count, API usage, and storage.

logs — Request logs

bash
# Recent logssupermemory logs
# Filter by time periodsupermemory logs --period 7d
# Filter by statussupermemory logs --status error
# Filter by request typesupermemory logs --type search
# Get a specific log entrysupermemory logs get req_abc123

billing — Usage and billing

bash
supermemory billing          # Overviewsupermemory billing usage    # Detailed usage breakdownsupermemory billing invoices # Past invoices

Utility Commands

bash
# Open Supermemory console in browsersupermemory opensupermemory open graph       # Memory graph viewsupermemory open billingsupermemory open settingssupermemory open docssupermemory open keys
# Machine-readable help (useful for LLM agents)supermemory help --jsonsupermemory help --all
# Per-command helpsupermemory search --helpsupermemory tags --help --json

Scoped Keys Mode

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.


Common Patterns

Pipe content from other tools

bash
# Ingest git loggit log --oneline -20 | supermemory add --stdin --tag git-history
# Ingest command outputcurl -s https://api.example.com/docs | supermemory add --stdin --tag api-docs
# Pipe search results to jqsupermemory search "auth" --json | jq '.results[].memory'

Scripting with JSON output

bash
# All commands support --json for machine-readable outputsupermemory search "query" --jsonsupermemory tags list --jsonsupermemory profile user_123 --jsonsupermemory status --json

CI/CD integration

bash
# Use env var for authexport SUPERMEMORY_API_KEY=sm_abc_xxx
# Ingest docs on deploysupermemory add ./docs/api-reference.md --tag api-docs --id api-ref-latest
# Check statussupermemory status --json | jq '.memoryCount'

来源与署名

来源:supermemoryai/skills位于supermemory-cli提交10d5e16

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架