outline-cli: finding and updating the right wiki page
Search an Outline workspace from the terminal, read documents by title or URL, and preview changes before updating a page.
“Add the new step to the onboarding checklist” is enough to describe a wiki edit, but it leaves a script or coding agent with some work to do. It needs to find the document by title and read the existing checklist before changing it.
I built outline-cli to do that work from the terminal through Outline’s API. It can search a workspace, read pages and their attachments, and update content. This is my independent open-source CLI, not an official Outline product.
Start from a title or URL
You can pass a document title or paste its URL. The CLI first uses a local index of documents seen by that profile, then performs a bounded live lookup for references it does not know. If several pages match, it returns candidates for you to choose from.
Search results can contain summaries or just IDs. An agent looking for a paragraph can narrow the results before reading a whole document. Each workspace profile keeps its own account selection.
For an edit, preview the diff and apply the patch with an expected revision. The revision check catches changes made since you read the page. You still need to review the proposed text for accuracy.
Connect to a workspace
You need Node.js 18.17 or newer and access to an Outline workspace.
npm i -g @khanglvm/outline-cli
Create an API key under your workspace’s Settings → API & Apps. Set OUTLINE_API_KEY in your local environment, then replace the example URL with the address you use to open Outline:
outline-cli profile add work \
--base-url https://docs.example.com \
--auth-type apiKey \
--api-key "$OUTLINE_API_KEY" \
--set-default
outline-cli profile test work
Credentials go into the OS keychain by default. Keep the key out of source files and chat messages. If this machine already has profiles, outline-cli profile list shows them before you create another.
Find and read a page
Search for a term from the document you need:
outline-cli invoke documents.search \
--args '{"query":"onboarding","limit":5,"view":"summary"}'
Choose a result and replace <document-id> with its ID:
outline-cli invoke documents.info \
--args '{"id":"<document-id>","view":"full"}'
The JSON result lets scripts select individual fields and gives an agent a source URL to cite. Use documents.open to look up a known title or URL directly. The usage guide has examples for attachments, revision history, and guarded edits.
To write, include performAction:true. Deleting a document also requires a token returned by a prior read of that document. Search and read calls need neither step.
Using it with an agent
Give your coding assistant this instruction:
Use outline-cli to find the page for this task. Check existing profiles first.
Search with view:"summary", then read the selected document before editing.
Show the proposed diff and use an expected revision for the patch.
Make only the changes I asked for, and return the document's source link.
The optional skill adds setup guidance and common workflows:
npx skills add https://github.com/khanglvm/skills --skill outline-cli -y
Where it fits
Use the CLI to read a runbook while working, gather source documents for a task, or apply an agreed wiki edit. Access depends on the configured account’s permissions. The local title index helps find pages; read the page again when you need its current content.
The package is available on npm. Run outline-cli tools contract <name> when you need the exact arguments for a tool.