A Go CLI for the Supermemory API. Supports document ingestion (single/batch), conversation archiving, search, and container tag management.
go build -o supermemory ./main.goCopy the binary to a directory in your PATH, e.g.:
sudo cp supermemory /usr/local/bin/Or to your user bin:
mkdir -p ~/.local/bin
cp supermemory ~/.local/bin/Set your API key via environment:
export SUPERMEMORY_API_KEY="sm_..."
# Optional base URL (default: https://api.supermemory.ai)
export SUPERMEMORY_API_BASE="https://api.supermemory.ai"Or create a config file at ~/.config/supermemory/config.json:
{
"apiKey": "sm_...",
"apiBase": "https://api.supermemory.ai"
}supermemory doc add <file|-— add a document (read from file or stdin)supermemory doc batch <manifest.json> [--dry-run]— batch add (max 600 per request)supermemory conv ingest <conversation.json>— ingest a conversationsupermemory search docs <query> [--limit N] [--containerTag tag]— search documentssupermemory container get <tag>— get container settingssupermemory container set <tag> --settings key=value,...— update settingssupermemory container merge <sourceTag> <targetTag>— merge containerssupermemory container delete <tag>— delete container
All commands output JSON.
[
{
"content": "Markdown or plain text content",
"containerTag": "my-project",
"customId": "doc-001",
"metadata": { "source": "clipper" }
}
]- Uses Cobra;
--helpfor command flags. - Batch chunking is automatic; respects the 600 document limit.
- Errors are printed to stderr; exit code 1 on failure.