Skip to content
Developers
GuidesAPI reference
slimwiki.comGet an API key

Guides

  • Quickstart
  • Authentication
  • Errors
  • Pagination
  • Rate limits
  • Content format
  • Versioning

Tools and agents

  • CLI
  • MCP server
  • Agent skill

API reference

  • Overview

Users

  • Retrieve the key ownerget

Accounts

  • List accountsget

Wikis

  • List wikisget
  • Retrieve a wikiget

Pages

  • List pages in a wikiget
  • Search pages in a wikiget
  • Find a page by slug or hashget
  • Create a pagepost
  • Retrieve a pageget
  • Delete a pagedelete
  • Archive a pagepost
  • Restore a pagepost

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.

On this page

  • Install
  • Sign in
  • Commands
  • Examples
  • Output for people and for scripts
  • Use it from an AI agent

Install

The CLI is the slimwiki package on npm. It needs Node.js 22.19 or later.

Install
npm i -g slimwiki     # or: pnpm add -g slimwiki, bun i -g slimwiki
slimwiki --version

To upgrade later, run slimwiki update.

Sign in

Sign in
slimwiki auth login

This 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.

Check and sign out
slimwiki auth status
slimwiki auth logout

The 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):

Use an API key
export SLIMWIKI_TOKEN=swk_your_key

The CLI is a client of this API

Since version 0.2.0 the CLI uses the same API described on this site, so it has the same permissions, limits and errors. A sign-in saved by an earlier version has to be renewed with slimwiki auth login.

Commands

CLI commands
CommandWhat it does
slimwiki whoamiShows who you are signed in as.
slimwiki account listLists your accounts.
slimwiki wiki listLists the wikis in an account.
slimwiki page listLists 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

Find and read pages
slimwiki page list --search "release checklist"
slimwiki page get release-checklist
Create a page
slimwiki page create --title "Release checklist" --stdin <<'JSON'
{
  "type": "doc",
  "content": [
    { "type": "paragraph",
      "content": [{ "type": "text", "text": "Steps we follow for every release." }] }
  ]
}
JSON

The 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.

Output modes
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:

Print the agent instructions
slimwiki agent-help

For 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.

Previous

Versioning
How the API is versioned and which changes can happen within v1.

Next

MCP server
Connect an AI assistant to SlimWiki with the Model Context Protocol.

SlimWiki Developers

slimwiki.com