Skip to content

DiyRex/outline-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Outline

Outline CLI

A powerful CLI & TUI for managing Outline wiki instances.
Built with Go • Cobra • Bubble Tea

InstallQuick StartMCP ServerCommandsCI/CDTUIFull Docs


✦ Features

Feature Description
📄 Full API Coverage Documents, collections, users, groups, comments, shares, stars, search, events, revisions, attachments
🔄 Push / Pull Sync Upload local folders as collections, download collections as markdown
🖥️ Interactive TUI Browse and search your wiki from the terminal
🚀 CI/CD Ready Quiet mode, exit codes, stdin piping, non-interactive mode, auto-confirm
📋 Changelog Generate release notes from git history and push to Outline
🔍 Diff Compare local folder vs remote collection
💾 Backup Download all collections as local markdown
🤖 MCP Server Expose Outline to Claude Code and any MCP-capable client over stdio

📦 Install

Two binaries are published per release. Pick whichever fits your needs.

Binary What you get When to choose
outline Full CLI + TUI + MCP (outline mcp subcommand) Daily interactive use, scripts, CI/CD, and optionally MCP
outline-mcp Standalone MCP server only (~20% smaller) You only want to plug Outline into an MCP client like Claude Code

They coexist happily in /usr/local/bin — installing one does not affect the other.

Quick Install (Linux / macOS)

Full CLI + MCP bundled:

curl -fsSL https://raw.githubusercontent.com/DiyRex/outline-cli/main/install.sh | sh

MCP server only:

curl -fsSL https://raw.githubusercontent.com/DiyRex/outline-cli/main/install-mcp.sh | sh

Auto-detects your OS and architecture, downloads the latest release binary, and installs to /usr/local/bin.

Download from Releases

Pre-built binaries for every platform are available on the Releases page:

Platform CLI Binary MCP Binary
Linux (x86_64) outline-linux-amd64 outline-mcp-linux-amd64
Linux (ARM64) outline-linux-arm64 outline-mcp-linux-arm64
macOS (Intel) outline-darwin-amd64 outline-mcp-darwin-amd64
macOS (Apple Silicon) outline-darwin-arm64 outline-mcp-darwin-arm64
Windows (x86_64) outline-windows-amd64.exe outline-mcp-windows-amd64.exe

Build from Source

git clone https://github.com/DiyRex/outline-cli.git
cd outline-cli
make build        # ./outline         (CLI + MCP bundled)
make build-mcp    # ./outline-mcp     (MCP server only)
make build-all    # both

make install      # copies outline     to /usr/local/bin
make install-mcp  # copies outline-mcp to /usr/local/bin
make install-all  # both

🚀 Quick Start

# 1. Configure
outline config --url="https://outline.example.com"
outline config --api-key="ol_api_your_key_here"

# 2. Verify
outline status

# 3. Use
outline collections list
outline push "My Docs" ./docs/
outline pull "My Docs" ./output/

# 4. Interactive mode
outline

🤖 MCP Server

outline mcp turns the CLI into a Model Context Protocol server over stdio. Plug it into Claude Code (or any MCP-capable client) and your LLM can search, read, comment on, and update documents in your Outline instance.

Tools exposed

Tool Purpose
outline_search Full-text or title-only search with snippets
outline_list_documents List documents, optionally filtered by collection
outline_get_document Fetch full document body + metadata
outline_upsert_document Create or update by title match
outline_archive_document Soft-delete a document
outline_list_collections Enumerate collections
outline_get_collection_tree Nested document tree (by ID or name)
outline_list_comments / outline_create_comment Read and post comments
outline_list_revisions Revision history for a document
outline_pull_collection / outline_push_folder Bulk sync a collection with a local folder

Per-project setup (recommended)

Each project registers its own MCP server with its own Outline credentials — no secrets on shared disk, nothing about your team's Outline instance baked into the binary.

1. Install once (pick one):

# MCP-only binary (recommended if you just want MCP)
curl -fsSL https://raw.githubusercontent.com/DiyRex/outline-cli/main/install-mcp.sh | sh

# OR the full CLI, which also provides `outline mcp`
curl -fsSL https://raw.githubusercontent.com/DiyRex/outline-cli/main/install.sh | sh

2. Inside your project, register the MCP server with env-injected credentials:

With the standalone binary:

cd my-project
claude mcp add outline --scope project outline-mcp \
  --env OUTLINE_URL=https://outline.mycompany.com \
  --env OUTLINE_API_KEY=ol_api_your_key

Or with the full CLI:

claude mcp add outline --scope project outline mcp \
  --env OUTLINE_URL=https://outline.mycompany.com \
  --env OUTLINE_API_KEY=ol_api_your_key

Both write a .mcp.json file at your project root that anyone who clones the repo can use. Example shape (standalone binary):

{
  "mcpServers": {
    "outline": {
      "command": "outline-mcp",
      "env": {
        "OUTLINE_URL": "https://outline.mycompany.com",
        "OUTLINE_API_KEY": "ol_api_your_key"
      }
    }
  }
}

Keep the API key out of git by committing only a .mcp.json.example and having each contributor run the claude mcp add command locally.

3. In Claude Code, run /mcp to confirm the server is connected, then ask something like "Search my Outline wiki for the deployment runbook".

Configuration sources

outline resolves credentials in this order (highest wins):

Priority Source Use when
1 OUTLINE_URL / OUTLINE_API_KEY env vars MCP servers, CI/CD, Docker
2 ./.outline/config.yaml Per-project, committable (URL only; keep key in env)
3 ./outline.yaml Alternative project-root location
4 ~/.outline-cli/config.yaml Personal default for a given machine

Run outline config or outline status to see which source is active.


📖 Commands

Auth & Status

outline auth test          # Validate credentials
outline auth whoami        # Show current user
outline status             # Connection status, user, team info

Push & Pull

outline push "Docs" ./folder/              # Upload folder as collection
outline push "Docs" ./folder/ --dry-run    # Preview changes
outline push "Docs" ./folder/ --delete     # Remove remote orphans
outline pull "Docs" ./output/              # Download collection
outline pull "Docs" ./output/ --dry-run    # Preview download

Folder hierarchy is preserved:

docs/
├── getting-started/
│   ├── intro.md
│   └── setup.md
└── api/
    ├── auth.md
    └── endpoints.md

Diff

outline diff "Docs" ./folder/    # Compare local vs remote

Documents

outline documents list [--collection <id>]
outline documents info <id>
outline documents create --title "Title" --collection <id> --text "Content"
outline documents create --title "Title" --collection <id> --file ./doc.md
outline documents create --title "Title" --collection <id> --stdin        # pipe from stdin
outline documents create --title "Title" --collection <id> --template <id>
outline documents update <id> --title "New Title" --text "Updated"
outline documents update <id> --file ./doc.md
outline documents update <id> --stdin
outline documents delete <id> [--permanent]
outline documents archive <id>
outline documents restore <id>
outline documents move <id> --collection <id> [--parent <id>]
outline documents export <id> [--output file.md]
outline documents duplicate <id> [--recursive]
outline documents search <query> [--collection <id>]
outline documents drafts
outline documents viewed
outline documents unpublish <id>

Collections

outline collections list
outline collections info <id>
outline collections create --name "Name" [--description "Desc"] [--color "#hex"]
outline collections update <id> --name "New Name"
outline collections delete <id>
outline collections archive <id>
outline collections restore <id>
outline collections tree <id>

Changelog & Release Notes

# Generate changelog from git commits (conventional commits)
outline changelog generate --from v1.0 --to v1.1 [--include-authors] [--repo /path]

# Generate and push to Outline
outline changelog push --from v1.0 --to v1.1 --collection <id> --title "Release v1.1"

Publish

# Upsert a local markdown file (creates or updates by title match)
outline publish ./doc.md --collection <id> [--title "Override"] [--parent <id>]

Revisions & Attachments

outline revisions list --document <id>
outline revisions info <id>
outline revisions delete <id>

outline attachments list [--document <id>]
outline attachments delete <id>

Users & Groups

outline users list [--query "search"]
outline users info [id]

outline groups list
outline groups create --name "Name"
outline groups delete <id>
outline groups members <id>
outline groups add-user <group-id> <user-id>
outline groups remove-user <group-id> <user-id>

Comments, Shares, Stars

outline comments list [--document <id>]
outline comments create --document <id> --text "Text"
outline comments delete <id>
outline comments resolve <id>

outline shares list
outline shares create --document <id>
outline shares revoke <id>

outline stars list
outline stars create --document <id>
outline stars delete <id>

Search & Events

outline search "query" [--collection <id>] [--titles]
outline events [--document <id>] [--collection <id>] [--audit]

Backup

outline backup [--output ./backup-dir/]

⚙️ Global Flags

Flag Short Default Description
--format -f table Output format: table or json
--quiet -q false Suppress non-error output
--verbose -v false Enable debug output
--no-color false Disable colored output (respects NO_COLOR env)
--non-interactive false Disable TUI and interactive prompts
--yes -y false Auto-confirm destructive operations
--timeout 30 HTTP timeout in seconds

🔢 Exit Codes

Standardized for scripting and CI/CD:

Code Meaning
0 Success
1 General error
2 Configuration error
3 Authentication error (401/403)
4 Not found (404)
5 Rate limited (429)
6 Validation error

🚀 CI/CD Pipeline Usage

# Setup
export OUTLINE_URL="https://outline.example.com"
export OUTLINE_API_KEY="$OUTLINE_API_KEY_SECRET"

# Validate credentials
outline auth test --non-interactive

# Push documentation
outline push "API Docs" ./docs/ --non-interactive --quiet

# Generate & publish release notes
outline changelog push --from "$PREV_TAG" --to "$NEW_TAG" \
  --collection <id> --title "Release $NEW_TAG" --non-interactive

# Pipe content
echo "Build $BUILD_ID completed" | outline documents create \
  --title "Build Report" --collection <id> --stdin --non-interactive

# Check exit code
outline auth test --non-interactive
if [ $? -eq 3 ]; then echo "Auth failed"; exit 1; fi

🖥️ Interactive TUI

Run outline without arguments to launch the TUI.

Key Action
j / Move down
k / Move up
Enter Select / Open
Esc / Backspace Go back
/ Search
q Quit

Views: Collections → Documents → Document Detail → Search


🔧 Configuration

outline config --url="https://your-instance.com"
outline config --api-key="ol_api_your_key"
outline config    # view current config and its source

Lookup order (highest precedence first):

  1. OUTLINE_URL / OUTLINE_API_KEY environment variables
  2. ./.outline/config.yaml (project-scoped, preferred for teams)
  3. ./outline.yaml (alternative project-root location)
  4. ~/.outline-cli/config.yaml (home directory, the default)

Environment variables always override file-based config, making this tool suitable for MCP servers, CI/CD pipelines, and Docker containers where secrets should never touch disk.

API Key Scopes

Create an API key in Outline Settings → API:

Feature Required Scopes
Read operations read
Write operations write
Push / Pull read, write
User management users:read
Group management groups:read, groups:write

🧪 Testing

go test ./... -v              # Run all tests
go test ./internal/api/ -v    # API client tests
go test ./internal/sync/ -v   # Sync engine tests
go test ./internal/cli/ -v    # CLI output & exit code tests

🛠️ Development

make build    # Build binary
make install  # Install to /usr/local/bin
make fmt      # Format code
make vet      # Run go vet
make tidy     # Tidy modules
make clean    # Remove binary

📚 Documentation


📄 License

MIT

About

CLI tool for Outline Document Management

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors