Skip to main content

A Python client and CLI for Outline knowledge bases

Project description

Outline Skills

AI agent skill for interacting with Outline knowledge bases. Enables your AI assistant to manage documents, collections, search content, and handle team collaboration workflows.

Features

  • Full Outline API coverage: documents, collections, search, users, groups, comments, attachments, shares, stars, revisions, events, views, and file operations
  • Membership and permission workflows for documents, collections, and groups
  • High-level local Markdown publishing that uploads local image assets, rewrites links, and rolls back temporary Outline resources on failure
  • Markdown comment creation with rich-text rendering and automatic long-reply splitting for Outline comments
  • Works with Claude Code, Codex, Cursor, Windsurf, and other AI agents
  • Cross-platform: Windows, Linux, and macOS

Installation

Claude Code

/plugin marketplace add visualdust/outline-skills
/plugin install outline-skills

Other AI Agents

Using vercel-labs/skills:

npx skills add visualdust/outline-skills -a codex    # Codex
npx skills add visualdust/outline-skills -a cursor   # Cursor
npx skills add visualdust/outline-skills -a windsurf # Windsurf

Prerequisites

Install the CLI tool (required by the skill):

pip install outline-kb-cli

Quick Start

1. Get Your API Key

Create an API key in your Outline workspace settings:

Create API key in Outline

2. Configure Authentication

Set environment variables:

export OUTLINE_API_KEY="ol_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export OUTLINE_BASE_URL="https://app.getoutline.com/api"  # Must include /api suffix

Or create ~/.outline-skills/config.json:

{
  "api_key": "ol_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "base_url": "https://app.getoutline.com/api"
}

3. Use with Your AI Agent

Once installed, your AI agent can interact with Outline:

Search Outline for onboarding documentation
Create a new document in the Engineering collection
List all collections in my workspace
Add a comment to the API documentation

The agent will automatically use the configured credentials to perform these operations.

Documentation

Standalone CLI Usage

While this repo is designed for AI agent integration, the underlying outline-kb-cli package can also be used as a standalone CLI tool. See skills/outline-skills/SKILL.md for detailed command reference.

By default, commands print compact, agent-friendly JSON summaries instead of the full Outline API response. These summaries keep the most useful IDs, names, URLs, counts, pagination, and bounded text previews while omitting noisy policy/token/nested fields. Use --raw when you need the complete API JSON, and --max-text-chars to tune preview length in summary mode:

# Compact summary output, suitable for agents and shell inspection.
outline-cli auth info
outline-cli search "deployment guide" --limit 5

# Complete Outline API response for debugging or custom scripts.
outline-cli auth info --raw

# Keep document metadata but suppress text bodies in the summary.
outline-cli documents info --id "doc-id" --max-text-chars 0

API failures are written to stderr with contextual fields such as HTTP status, endpoint, URL, message, and an actionable hint for common cases (401, 403, 404, 429, and server errors). Invalid config-file warnings are also written to stderr so JSON stdout remains machine-readable.

For longer document/comment bodies, prefer file-backed inputs instead of large shell arguments:

outline-cli documents create --title "Title" --collection-id "coll-id" --text-file ./doc.md
outline-cli documents update --id "doc-id" --text-file ./doc.md
outline-cli comments create --document-id "doc-id" --data-file ./comment.md
outline-cli comments update --id "comment-id" --data-file ./comment.md

Publishing local Markdown with images

Use documents create-from-file when a local Markdown file contains relative image links such as ![chart](figures/chart.png). The workflow preflights all local assets before creating anything in Outline, creates a temporary unpublished document for attachment upload, uploads each unique asset once, rewrites the Markdown to Outline attachment URLs, and then publishes/updates the final document. If an API/upload step fails mid-flight, the CLI attempts to delete uploaded attachments and the temporary document, and the error message includes the cleanup outcome.

# First validate what would be uploaded without touching Outline.
outline-cli documents create-from-file \
  --file ./report.md \
  --collection-id "collection-id" \
  --dry-run

# Publish the document and rewrite local image URLs to Outline attachment URLs.
outline-cli documents create-from-file \
  --file ./report.md \
  --collection-id "collection-id" \
  --title "Experiment Report" \
  --save-rewritten ./report.outline.md

Supported local references include inline Markdown images, reference-style Markdown images, and HTML <img src="..."> tags outside fenced/indented code blocks. Remote URLs, data: URLs, and anchors are left unchanged. By default, local assets must stay under the Markdown file's directory; use --asset-root to narrow that boundary, or --allow-outside-assets only when you intentionally want to upload files outside it. Add --upload-local-links to upload local non-image links such as PDFs.

For a single existing Outline document attachment, use:

outline-cli attachments upload --document-id "document-id" --file ./figure.png

Development

Project Structure

outline-skills/
├── outline_cli/             # Python CLI package
│   ├── cli.py               # CLI implementation
│   ├── client.py            # Outline API client
│   ├── local_markdown.py    # Local Markdown asset preflight/rewrite workflow
│   └── config.py            # Configuration loading
├── skills/outline-skills/   # Agent skill documentation
├── .claude-plugin/          # Plugin manifest
│   ├── plugin.json
│   └── marketplace.json
├── tests/                   # Test suite
└── docs/                    # Documentation assets

Testing

uv run --extra dev python -m ruff check outline_cli tests
uv run --extra dev python -m mypy outline_cli
uv run --extra dev python -m pytest -q

Security Note

Keep your Outline API key secure:

  • Never commit API keys to version control
  • Use environment variables or gitignored config files
  • Rotate keys regularly if exposed

License

MIT License - see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

outline_kb_cli-0.1.5.tar.gz (52.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

outline_kb_cli-0.1.5-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

Details for the file outline_kb_cli-0.1.5.tar.gz.

File metadata

  • Download URL: outline_kb_cli-0.1.5.tar.gz
  • Upload date:
  • Size: 52.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for outline_kb_cli-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a47a6302a37496e8296b48fc5791cdae823247ec9338fd9c8a25859b6753b1b1
MD5 7d5c0b308e557d6f94376a7acdeaaa30
BLAKE2b-256 21ea95302b25887faa71e1fc20fda5901a3cf831bc3ccedb54da4c2074ee43f4

See more details on using hashes here.

File details

Details for the file outline_kb_cli-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: outline_kb_cli-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 43.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for outline_kb_cli-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6b7f4eda510d9096abc243f4d1eaf2bcb87d203db130f6ad64450a00bb6eba05
MD5 73c0e2b0ce87f91db642dcc8b869872f
BLAKE2b-256 23d853fe864704c9d185883bc092db4f50a825a579bbdc051256c49428c80024

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page