Guides
CLI
The slimwiki command-line tool lets you, or an AI agent working for you, list, search, read and create pages from a terminal.
Install
The CLI is the slimwiki package on npm. It needs Node.js 22.19 or later.
npm i -g slimwiki # or: pnpm add -g slimwiki, bun i -g slimwiki
slimwiki --versionTo upgrade later, run slimwiki update.
Sign in
slimwiki auth loginThis opens your browser. Check that the code shown there matches the one in your terminal and choose Allow. The CLI is then given an API key of its own, valid for 90 days, and saves it on this computer.
slimwiki auth status
slimwiki auth logoutThe key appears in SlimWiki under Profile → API keys as “SlimWiki CLI”, where you can revoke it. slimwiki auth logout revokes it too.
On a server or in CI, where no browser is available, skip the sign-in and give the CLI a key you created yourself (see Authentication):
export SLIMWIKI_TOKEN=swk_your_keyCommands
| Command | What it does |
|---|---|
slimwiki whoami | Shows who you are signed in as. |
slimwiki account list | Lists your accounts. |
slimwiki wiki list | Lists the wikis in an account. |
slimwiki page list | Lists the pages in a wiki. Add --search <query> to search, --archived for archived pages, and --limit / --offset to page through results. |
slimwiki page get <page> | Prints one page with its content. Name the page by its slug, hash or ID. |
slimwiki page create --title <title> | Creates a page from a JSON document given with --file, --content or --stdin. Add --parent <page> to place it under another page. |
Commands that work on a wiki take --account <slug> and --wiki <slug>. Without them the CLI uses your main account and its default wiki, so with one account you rarely need either.
Run slimwiki <command> --help for every option.
Examples
slimwiki page list --search "release checklist"
slimwiki page get release-checklistslimwiki page create --title "Release checklist" --stdin <<'JSON'
{
"type": "doc",
"content": [
{ "type": "paragraph",
"content": [{ "type": "text", "text": "Steps we follow for every release." }] }
]
}
JSONThe document is the same node format the API uses, wrapped in { "type": "doc", "content": [...] }. See Content format. The CLI checks the document before sending it and tells you which node is wrong.
Output for people and for scripts
In a terminal the CLI prints tables and summaries. When its output is piped or captured by a program, it prints JSON instead: one value per command, in a stable shape.
slimwiki account list # table in a terminal
slimwiki account list | jq . # JSON when piped
slimwiki account list --json # force JSON
slimwiki account list --human # force the table- Errors go to standard error, as
{"error":"…"}in JSON mode, and the exit code is 1. Success is exit code 0. - Accounts and wikis are named by slug, and pages by slug or hash, so output stays readable.
Use it from an AI agent
The CLI is built to be driven by coding agents. It ships its own instructions, which an agent can load with one command:
slimwiki agent-helpFor agents that support skills, the agent skill teaches an agent to use the CLI, the MCP server or the API, whichever is available. If your agent can connect to MCP servers, the MCP server needs no install at all.