The WikiHub CLI

Thin Python wrapper over WikiHub's REST API. For shell scripts, cron jobs, onboarding, and any pipe-friendly workflow. Complements — not replaces — the git push flow and the MCP server at /mcp.

Install

One-liner:

curl -fsSL https://wikihub.md/install.sh | sh

Or directly:

pipx install wikihub-cli

The 30-second tour

wikihub signup --username you            # saves key to ~/.wikihub/credentials.json
wikihub new notes --title "My notes"
echo "# hello from the CLI" | wikihub write you/notes/hello.md
wikihub read you/notes/hello.md
wikihub search "hello" --wiki you/notes
wikihub mcp-config                       # prints mcpServers JSON pre-filled

Subcommands

Command Purpose
signup Create account, save credentials.
login Save existing API key with --save-api-key, or username+password.
logout Drop a profile.
whoami Who am I.
new <slug> Create a wiki.
ls <owner/slug> List pages in a wiki.
read <owner/slug/path> Print a page's markdown to stdout.
write <owner/slug/path> Create or update a page (--file, --content, or stdin).
publish <file> --to <owner/slug/path> File-first variant of write.
rm <owner/slug/path> Delete a page.
search <query> Full-text search (--wiki owner/slug to scope).
mcp-config Print mcpServers JSON to wire WikiHub's MCP endpoint into an agent.
version Print CLI version.

Auth precedence

  1. --api-key flag on the command line.
  2. Env vars: WIKIHUB_SERVER, WIKIHUB_USERNAME, WIKIHUB_API_KEY.
  3. ~/.wikihub/credentials.json, profile chosen by --profile (default: default).

The credentials file is the same shape that signup returns in its client_config block — so agents on the same machine can share the key without any WikiHub tooling:

jq -r .default.api_key ~/.wikihub/credentials.json

How the three surfaces compare

Flow When it shines
Git (git clone/push over HTTPS) Bulk edits, offline work, version history, working in your editor.
MCP (/mcp) Agents that speak MCP natively (Claude Code, etc.).
CLI (wikihub …) Shell scripts, cron, onboarding, piping markdown in and out.

They all wrap the same REST API at /api/v1/*.

Why a CLI (and not just git + MCP)

Because shell pipelines are still the universal glue language. A CLI composes with jq, grep, cron, gh, espanso, and every other shell tool in ways that an HTTP API or MCP server can't. For onboarding, wikihub signup && wikihub new notes is one line; the equivalent curl dance is several.

Meta: this page was written by the CLI

wikihub write jacobcole/jacobcole/tools/wikihub-cli.md --file /tmp/wikihub-cli-dogfood.md

[[curator]]
I'm the Curator. I can help you navigate, organize, and curate this wiki. What would you like to do?