@thunkedai/cli
v0.1.10
Published
Capture anything to your AI-powered second brain from the terminal
Downloads
91
Maintainers
Readme
@thunkedai/cli
Capture anything to your Thunked second brain from the terminal.
Install
npm install -g @thunkedai/cliThe published package is @thunkedai/cli; the executable command is thunked.
For local development from this repo:
cd cli
npm install
npm run build
npm linkFor agent/MCP integrations, the currently published MCP package remains:
npx thunked-mcpSetup
Interactive local setup:
thunked loginGrab your user-owned API key from the developer settings in the Thunked app and paste it when prompted.
Script/CI/agent setup:
export THUNKED_API_KEY="thunked_..."THUNKED_API_KEY is always preferred over the local config file and is never written to disk by the CLI. In v1, API keys are user-owned; team captures are authorized through the key owner's team membership.
Usage
# Capture a URL
thunked capture https://example.com/interesting-article
# Capture a quick note
thunked capture --text "Remember: the answer is 42"
# Capture into a team inbox or shared collection you can write to
thunked capture https://example.com --team acme
thunked capture --text "Team note" --team acme/research
# Search your brain
thunked search "machine learning"
# See recent items
thunked recent
# Check account status
thunked status
# Check local config, auth presence, and API reachability
thunked doctorStatic memory injection (thunked pull)
Agents sometimes skip voluntary tool calls. thunked pull writes a deterministic, budgeted packet of your project's memory (recent decisions in full, bugfixes condensed; notes excluded unless --include-notes) for static injection into CLAUDE.md/AGENTS.md:
thunked pull # project = current directory name, to stdout
thunked pull myapp -o .claude/thunked-memory.md
thunked pull --repo owner/name # repo-only pull
thunked pull --dry-run # what would be included/omitted, and why
thunked pull --max-bytes 4096 # budget (1024-12288; default 8192)Same memories in, byte-identical packet out — safe to commit or regenerate in CI. Entries are whole or omitted (never truncated); the packet never exceeds the budget.
Memory lifecycle (log, verify, resolve)
Capture decisions and bugfixes the moment they happen — no agent required — and keep memory trustworthy over time:
thunked log decision "Use queues over pipelines" --rationale "backpressure"
git log -1 --format=%B | thunked log decision --from-stdin --title "Release decision"
thunked log bugfix "OOM on huge graphs" --problem "50MB graph.json" --fix "stat-cap before reading"
thunked verify <itemId> # re-verified today; clears stale/contradicted
thunked resolve <newItemId> --supersedes <oldItemId> # old memory marked superseded, linkedStatuses (active, stale, superseded, contradicted) are surfaced at recall time — nothing is ever auto-deleted.
Always-on memory for Claude Code
# Register the Thunked MCP server in Claude Code (user scope) — one command
thunked claude install
# Opt-in: also teach Claude Code to recall before planning and save
# decisions/bugfixes automatically (managed block in ~/.claude/CLAUDE.md)
thunked claude install --instructions
# Undo everything (removes the MCP registration and the managed block only;
# the rest of your CLAUDE.md is never touched)
thunked claude uninstallAdd --hook to also inject a memory packet at every session start (a SessionStart hook running thunked pull --hook-mode): up to ~4KB of recent decisions/bugfixes for the current directory's project, cached for 15 minutes, and silent on any failure so it can never break or slow a session. uninstall removes the hook too.
install is idempotent — re-running updates the registration (e.g. after rotating your API key). The key is passed to the MCP server via env in Claude Code's local config; note that config is stored in plaintext on your machine.
Import a codebase map (graphify bridge)
If you use graphify to map a repo, save that map as durable Thunked memory:
cd your-repo # contains graphify-out/ from /graphify or `graphify extract`
thunked import graphify # project name defaults to the repo dir
thunked import graphify . --project myapp --repo owner/myappThe structural summary (hubs, relation types, communities — plus GRAPH_REPORT.md when present, imported as fenced data) is saved as a typed note memory, so agents can recall it later via thunked_project_context("myapp") and you can find it with thunked search.
JSON output
Read commands support --json for scripting:
thunked search "rust" --json | jq '.data[0].url'Custom API endpoint
thunked config baseUrl http://localhost:3000Auth source inspection
thunked configThis prints whether auth is coming from THUNKED_API_KEY or the local config file without revealing the key.
Diagnostics
thunked doctor
thunked doctor --json
thunked doctor --no-probedoctor checks the CLI version, Node.js version, API base URL, auth source, and API reachability. It reports whether an API key is present and valid without printing the key or account details.
Development
git clone https://github.com/thunkedai/thunked
cd thunked/cli
npm install
npm test
npm run build
node dist/index.js --help
npm pack --dry-run