supermemory-cli について
supermemory-cli は Supermemory v5 API を使うコマンドラインツールで、ターミナルやスクリプトからメモリーとドキュメントを管理するユーザー向けです。検索、名前空間やコネクターの管理、チーム操作、ローカルサーバー制御を備えています。
主な機能
- 01テキスト、ファイル、URL の追加
- 02メモリーとソースチャンクの検索
- 03プロフィールの表示とメモリー管理
- 04名前空間とコネクターの管理
- 05スクリプト向け JSON 出力
- 06ローカルサーバーの導入と起動
活用シーン
- 01ターミナルから議事録やウェブページを登録
- 02コマンドラインでメモリーを検索または削除
- 03検索結果やプロフィールをスクリプトで処理
- 04プロジェクト用のローカル Supermemory サーバーの実行
MCP 対応
README には、この CLI による MCP サーバーへの接続や管理について記載がありません。
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ supermemoryai/ skills --skill supermemory-cliインストール後、Claude Code で/supermemory-cliを入力して読み込まれたか確認します。
詳細
CLI は supermemory npm パッケージに同梱されており、v5 API を呼び出します。すべてのコンテンツコマンドは、ユーザー ID、プロジェクト ID、または分離したい任意の境界である単一の名前空間内で動作します。
インストールと認証
# Run without installing
npx supermemory --version
# Or install globally
npm i -g supermemory
# Browser login, stores credentials in ~/.supermemory/credentials.json
supermemory login
# Or use an API key directly
supermemory login --api-key sm_xxx
# Show who you are, the key prefix and whether the key is scoped
supermemory whoami
supermemory logout
API を呼び出すコマンドには、ログインまたは SUPERMEMORY_API_KEY が必要です。help、local、plugin は不要です。
設定
スコープは 3 種類あります。init で書き込み、config set で編集します。
| スコープ | ファイル | 内容 |
|---|---|---|
project | ~/.supermemory/projects/<encoded-cwd>/config.json(マシンごとに保存され、git には含めません) | namespace、任意の apiKey |
team | <git root>/.supermemory/config.json(コミットします) | namespace |
global | ~/.supermemory/config.json | output、apiUrl、consoleUrl、telemetry |
名前空間の解決順序は、--namespace フラグ、SUPERMEMORY_NAMESPACE、チーム設定、プロジェクト設定です。いずれも設定されていない場合、コンテンツコマンドは「Namespace required」で停止します。
# Interactive wizard
supermemory init
# Non-interactive
supermemory init --scope project --namespace meetings-bot
supermemory init --scope team --namespace my-project
supermemory init --scope global --output json
# Show resolved config and where each value came from
supermemory config
# Set a value; keys: apiKey, namespace, output, apiUrl, consoleUrl, telemetry
supermemory config set namespace my-project --scope project
supermemory config set output json --scope global
supermemory config set telemetry off --scope global
# Read one resolved value; keys: apiKey, namespace, apiUrl, consoleUrl, output
supermemory config get namespace
環境変数
| 変数 | 効果 |
|---|---|
SUPERMEMORY_API_KEY | API キーです。保存済みの認証情報を上書きし、値が異なる場合は警告を表示します。 |
SUPERMEMORY_NAMESPACE | デフォルトの名前空間です。SUPERMEMORY_TAG から名称が変更されました。 |
SUPERMEMORY_API_URL | セルフホスト型サーバー向けの API ベース URL です。 |
SUPERMEMORY_CONSOLE_URL | open とログインで使用するコンソール URL です。 |
DO_NOT_TRACK=1 | 匿名の利用状況テレメトリを無効にします(コマンド名、結果、バージョン、OS。コンテンツやキーは含まれません)。 |
OTEL_EXPORTER_OTLP_ENDPOINT | CLI のトレースを OpenTelemetry コレクターにエクスポートします。 |
グローバルフラグ
| フラグ | 効果 |
|---|---|
--namespace <name> | このコマンドの名前空間を上書きします |
--json | JSON 出力を強制します |
--help | 任意のコマンドのヘルプを表示します。--help --json は機械可読なスキーマを出力します |
標準出力がターミナルでない場合、出力は自動的に JSON になります。そのため、パイプやエージェントでは --json を指定しなくても JSON が取得できます。supermemory config set output human --scope global を実行すると、テキスト出力に固定されます。
コアコマンド
add
テキスト、ファイル、または URL を名前空間に取り込みます。引数は自動判定されます。http:// または https:// で始まる場合は URL、既存のパスの場合はファイルとしてアップロードされ、それ以外はテキストとして扱われます。
supermemory add "User prefers TypeScript over JavaScript"
supermemory add ./meeting-notes.pdf --namespace meetings
supermemory add https://docs.example.com/api --namespace docs
# From stdin
cat notes.txt | supermemory add --stdin --namespace notes
# Metadata and a stable id; repeating the id updates the same document
supermemory add "Design doc v2" --metadata '{"category":"engineering"}' --id design-doc
# Memories ready right away instead of batched in the background
supermemory add "Alex moved to Berlin" --dreaming instant
# Index for retrieval only, no memory extraction
supermemory add ./handbook.md --task-type superrag
# Batch: JSON array on stdin, items {content, id?, metadata?, namespace?}
echo '[{"content":"first","id":"d1"},{"content":"second"}]' | supermemory add --batch
フラグ:--namespace、--stdin、--metadata <json>、--id <string>、--dreaming dynamic|instant(デフォルトは dynamic)、--task-type memory|superrag(デフォルトは memory)、--batch。
コマンドの実行後も処理は続行されます。docs status <id> で状態を確認してください。
search
supermemory search "authentication patterns"
supermemory search "auth" --namespace api --limit 5 --rerank order
supermemory search "how do we handle auth" --rewrite
# Modes: hybrid (default, memories + chunks), memories, chunks
supermemory search "user prefs" --mode memories
supermemory search "refund policy" --mode chunks --include documents
# Typed filter
supermemory search "design" --filter '{"field":"category","operator":"eq","value":"engineering"}'
supermemory search "design" --filter '{"operator":"and","operands":[{"field":"source","operator":"eq","value":"slack"},{"field":"priority","operator":"gte","value":3}]}'
supermemory search "preferences" --threshold 0.5
フラグ:--namespace、--limit(デフォルトは 10)、--threshold(0~1、デフォルトは 0.3)、--rerank none|order|aggregate(デフォルトは none)、--rewrite、--mode hybrid|memories|chunks(デフォルトは hybrid)、--include documents,related,forgotten、--filter <json>。
profile
名前空間の維持管理されるプロファイルです。static な事実、dynamic な最近のコンテキスト、名前付きの buckets で構成されます。クエリ引数はありません。順位付けされた結果には search を使ってください。
supermemory profile
supermemory profile --namespace user_alex
# Build the profile from matching memories only
supermemory profile --filter '{"field":"region","operator":"eq","value":"us-west"}'
forget
# By memory id, comma-separated for several
supermemory forget mem_abc123 --namespace user_alex
supermemory forget mem_1,mem_2
# By meaning: preview first, then run without --dry-run
supermemory forget --query "old office address" --dry-run
supermemory forget --query "old office address"
フラグ:--namespace、--query <text>、--dry-run。--reason やメモリへの直接書き込み機能はありません。メモリはドキュメントから作成されるため、メモリを変更するにはソースドキュメントを変更してください。
ドキュメント
supermemory docs list --namespace default --limit 20 --page 2
supermemory docs get doc_abc123
supermemory docs status doc_abc123 # pipeline stage: queued, extracting, chunking, embedding, indexing, done, failed
supermemory docs chunks doc_abc123
supermemory docs delete doc_abc123 --yes # comma-separated ids for several
サブコマンド:list、get、delete、chunks、status。フラグ:--namespace、--limit(デフォルトは 20)、--page、--yes。
名前空間
tags から名称が変更されました。名前空間は、その名前で初めてコンテンツを追加したときに作成されます。create サブコマンドはありません。
supermemory namespaces list
supermemory namespaces info user_alex
# Supporting context guides memory extraction in this namespace
supermemory namespaces context user_alex --set "Paying customer on the Pro plan"
supermemory namespaces context user_alex --clear
# Delete, or move everything into another namespace first (replaces tags merge)
supermemory namespaces delete old-project --yes
supermemory namespaces delete old-project --move-to new-project --yes
サブコマンド:list、info、delete、context。フラグ:--set <text>、--clear、--move-to <namespace>、--yes。
コネクター
プロバイダー:google-drive、notion、onedrive、gmail、github、web-crawler、s3、granola。OAuth プロバイダーではブラウザーが開きます。web-crawler と s3 は --config を受け取り、すぐに同期を開始します。
supermemory connectors list
supermemory connectors list --namespace docs
supermemory connectors connect google-drive --namespace docs
supermemory connectors connect notion --namespace notes --no-browser
supermemory connectors connect web-crawler --namespace docs --config '{"startUrl":"https://docs.example.com"}'
supermemory connectors connect github --namespace code --document-limit 500
supermemory connectors sync conn_abc123
supermemory connectors history conn_abc123
supermemory connectors picker conn_abc123 # choose what the connector syncs
supermemory connectors disconnect conn_abc123 --delete-documents --yes
サブコマンド:list、connect、sync、history、picker、disconnect。フラグ:--namespace、--document-limit <n>、--config <json>、--no-browser、--delete-documents、--yes。
API キー
supermemory keys list
supermemory keys create --name my-agent --permission write
# Scoped key: one or more namespaces, expires in 30 days
supermemory keys create --name bot-key --permission read --namespace user_123 --expires 30
supermemory keys revoke key_abc123 --yes
supermemory keys toggle key_abc123
サブコマンド:list、create、revoke、toggle。フラグ:--name(create で必須)、--permission read|write(デフォルトは write)、--namespace <a,b>、--expires <days>、--yes。
スコープ付きキー
名前空間にスコープを設定したキーでは、search、add、forget、profile、whoami のみ利用でき、名前空間はキーから設定されます。help にはこれらのコマンドのみが表示されます。
チーム
supermemory team list
supermemory team invite [email protected] --role admin
supermemory team role member_123 admin
supermemory team remove member_123 --yes
supermemory team invitations
サブコマンド:list、invite、remove、role、invitations。フラグ:--role admin|member(デフォルトは member)、--yes。
ステータス、ログ、請求
supermemory status --period 7d # 24h, 7d, 30d, all (default all)
supermemory logs # last 24h
supermemory logs --period 7d --status error --type search --limit 50 --page 2
supermemory logs get req_abc123
supermemory billing # plan and usage summary
supermemory billing usage
supermemory billing invoices
コーディングエージェント用プラグイン
plugin は、このマシン上のコーディングエージェントに Supermemory の連携機能をインストールし、ブラウザーの OAuth で接続します。plugins は、コンソール側から API キーベースの接続を管理します。
# Detect installed agents and pick interactively
supermemory plugin
# Non-interactive, targets: claude, cursor, opencode, codex
supermemory plugin --all
supermemory plugin --only claude,cursor --dry-run
supermemory plugin --all --no-auth # install only, connect later
supermemory plugin --only codex --force # run even if the app is not detected
supermemory plugin login --all
supermemory plugin login --only codex --no-browser
supermemory plugin uninstall --only cursor --dry-run
supermemory plugin uninstall --all
plugin のフラグ:--all、--only <list>、--dry-run、--force、--no-auth。plugin login:--all、--only、--no-browser。plugin uninstall:--all、--only、--dry-run。
# Key-based plugin connections; ids: claude-code, cursor, opencode, openclaw
supermemory plugins list
supermemory plugins connect claude-code --auto-configure
supermemory plugins status
supermemory plugins revoke claude-code --yes
setup と migrate
どちらもプロジェクトを検出してプロンプトを作成し、それを指定してコーディングエージェントを起動します。エージェント:claude-code、codex、cline、aider、opencode、goose、amp。
# Integrate Supermemory into this project
supermemory setup
supermemory setup --prompt # print the prompt instead
# Move this project from the v3/v4 API to v5
supermemory migrate
supermemory migrate --agent codex
supermemory migrate --prompt
migrate はレガシーパッケージと名前(containerTag、customId、/v3/、/v4/)をスキャンし、移行対象がない場合は早期に終了します。
ローカルのセルフホストサーバー
macOS または Linux に、無料の単一バイナリ supermemory-server をインストールして実行します。現時点では Windows では利用できません。GitHub Releases から .exe をダウンロードするか、代わりに Docker を使用してください。
supermemory local # same as local start
supermemory local install
supermemory local install --version 0.0.9
supermemory local start --port 9000
supermemory local start --no-install
supermemory local start -- --log-level debug # args after -- go to the server
supermemory local upgrade
supermemory local status
supermemory local status --url http://localhost:9000
supermemory local version
supermemory local path
supermemory local env
サブコマンド:start、install、upgrade、status、version、path、env。SUPERMEMORY_API_URL=http://localhost:6767 を指定して、CLI の接続先に設定します。
open と help
supermemory open # console
supermemory open graph # pages: console, billing, graph, connectors, settings, docs, keys, team, agents
supermemory open billing --no-browser # print the URL
supermemory help
supermemory help --json # full command schema for agents
supermemory search --help --json
スクリプト
export SUPERMEMORY_API_KEY=sm_xxx
export SUPERMEMORY_NAMESPACE=api-docs
# Pipes are JSON by default
git log --oneline -20 | supermemory add --stdin --id git-history
supermemory search "auth" | jq '.results[] | .memory // .chunk'
supermemory profile | jq '.profile.static[].memory'
# Ingest on deploy with a stable id so the doc updates in place
supermemory add ./docs/api-reference.md --id api-ref-latest
# Wait for processing
until supermemory docs status "$ID" | jq -e '.status == "done"' >/dev/null; do sleep 2; done
終了コード
| コード | 意味 |
|---|---|
| 0 | 成功 |
| 1 | エラー。検証エラーや API エラーを含みます |
| 2 | 認証が必要です |
| 3 | 権限がありません |
| 4 | 見つかりません |
エラーは ✗ message として stderr に出力され、次の手順がある場合は hint: の行も表示されます。そのため、stdout はクリーンな JSON のまま保たれます。
1.x 以降に変更または削除された項目
| 以前 | 現在 |
|---|---|
npm i -g @supermemory/cli | npm i -g supermemory または npx supermemory |
--tag、SUPERMEMORY_TAG | --namespace、SUPERMEMORY_NAMESPACE |
| `tags list | info |
tags create | 新しい名前空間を指定してコンテンツを追加 |
tags merge a --into b | namespaces delete a --move-to b |
remember、update | 削除されました。ソースドキュメントを追加または更新してください |
forget --content、--reason | --dry-run を指定した forget --query。理由のフィールドはありません |
search --mode documents、--rerank(ブール値) | --mode chunks、`--rerank order |
search --filter '{"AND":[{"key":..}]}' | 型付きフィルター {"operator":"and","operands":[{"field":..,"operator":"eq","value":..}]} |
profile <namespace> --query | profile --namespace <name>。クエリには search を使用してください |
connectors resources | connectors picker |