CLI for the Outline wiki/knowledge base API.
npm install -g github:Doist/outline-cligit clone https://github.com/Doist/outline-cli.git
cd outline-cli
npm install
npm run build
npm linkol auth login # opens browser for OAuth authorization
ol auth login --base-url <your-outline-url> # skip base URL prompt for this login
ol auth login --client-id <your-client-id> # skip prompt for this login
ol auth login --callback-port 54969 # override local callback port
ol auth status # show current auth state
ol auth logout # clear saved credentialsSetup:
- Create a public OAuth app in Outline (Settings → Applications)
- Set the redirect URI to
http://localhost:54969/callback - Run
ol auth loginand enter your OAuth client ID when prompted (or pass it directly with--client-id <your-client-id>) - If needed, pass
--base-url <your-outline-url>or setOUTLINE_URL(for self-hosted instances or non-default URLs) - If needed, pass
--callback-port <port>or setOUTLINE_OAUTH_CALLBACK_PORTand registerhttp://localhost:<port>/callbackin your OAuth app
The client ID is saved for future logins. You can also set OUTLINE_OAUTH_CLIENT_ID
for your local environment.
If you prefer using an API token directly:
ol auth login --token <your-api-token>Generate a token in Outline under Settings → API Tokens.
Token resolution: OUTLINE_API_TOKEN env var → ~/.config/outline-cli/config.json.
Base URL resolution: OUTLINE_URL env var → config file → https://app.getoutline.com.
Callback port resolution for OAuth login:
--callback-port → OUTLINE_OAUTH_CALLBACK_PORT → 54969.
Self-hosted instances: pass --base-url or set OUTLINE_URL (you can still provide it interactively).
# Search
ol search "query" --limit 10 --collection <id> --status published
# Documents (alias: ol doc)
ol document list --collection <id> --sort updatedAt --direction DESC
ol document get <urlId> # renders markdown for terminal
ol document get <urlId> --raw # outputs raw markdown
ol document open <urlId> # opens in browser
ol document create --title "Title" --collection <id> --file doc.md --publish
ol document update <urlId> --file updated.md
ol document delete <urlId> --confirm
ol document move <urlId> --collection <target-id>
ol document archive <urlId>
ol document unarchive <urlId>
# Collections (alias: ol col)
ol collection list
ol collection get <id>
ol collection create --name "Engineering" --color "#4CAF50"
ol collection update <id> --name "New Name"
ol collection delete <id> --confirmAll commands support:
- Default: colored human-readable output
--json: pretty-printed JSON (essential fields)--json --full: all fields--ndjson: one JSON object per line (for piping)
npm install
npm run dev # watch mode
npm run type-check # typecheck without emitting
npm run test # run tests
npm run build # compile to dist/