CLI for syncing Outline documents into a local cache and managing them through the raw API.
Project description
outline-edit
outline-edit is a Python command-line tool for working with an Outline knowledge base through the raw Outline API while keeping a local markdown cache on disk.
It is designed for agent and automation workflows that need cheaper repeated reads than full remote document fetches, plus predictable local diff, push, and lifecycle operations.
Zero runtime dependencies. The entire tool is built on the Python standard library. No third-party packages are imported at runtime, which means no transitive supply-chain exposure and nothing to audit beyond the tool itself.
Why Not Just Use MCP?
Outline ships an MCP server, and MCP is usually the right choice for one-off interactive queries. But the MCP surface has structural inefficiencies that compound in agent and automation workflows:
| Operation | What MCP does | Cost |
|---|---|---|
| List 50 recent docs | Returns full ProseMirror JSON body for every doc | ~1 MB of tokens |
| Read one document | Searches by title, returns full content of all matches | N x full doc bodies |
| Fix a typo | Fetch full doc, generate full replacement, send full doc, re-fetch to verify | 4 x full doc body |
| Browse a collection | Returns full content of every doc in the collection | Entire collection |
| Check what changed this week | Fetch all docs just to read timestamps | All content for metadata |
Root causes (verified against Outline v1.6.1):
- No metadata-only mode.
list_documentsalways includes full document bodies. There is no way to request titles or timestamps without content. - No partial content. You cannot request a section or a summary — it is always the full document.
- No diff or patch on update.
update_documentrequires sending the entire body as a replacement. The only alternatives areappendandprepend. - No revision history. The MCP does not expose
revisions.*endpoints. You cannot retrieve past versions or compare revisions. - No event or audit log. The MCP does not expose
events.list. You cannot ask "what changed this week" without fetching every document. - No reliable document read by ID. MCP resource URIs are registered but return authorization errors in practice.
outline-edit sidesteps these costs by maintaining a local markdown cache:
With outline-edit:
Read a doc → local file read (~0 API tokens)
Edit a doc → local file edit (~0 API tokens)
Push edits → one API call (1x full doc)
Pull fresh copy → one API call, cached (1x full doc)
With MCP:
Read a doc → search by title (Nx full docs in results)
Edit a doc → generate full replacement (1x full doc in context)
Push edits → send full doc (1x full doc)
Verify the push → search by title again (Nx full docs)
Additional capabilities that MCP does not provide at all:
- Revision history and revision-to-revision diff via the raw API
- Activity and audit log queries
- Document archive, restore, and delete operations
- Optimistic-locking push that refuses to overwrite newer remote edits
Use MCP when you want direct tool-mediated interaction with a live Outline workspace. Use outline-edit when you want a reproducible local cache, a cheap read path for repeated workflows, or access to revision and audit capabilities.
Features
- Local markdown cache with index metadata
- Pull by collection, query, document ID, or full crawl
- Local
status,list,read,search, anddiff - Remote
create,push,publish,archive,restore, anddelete - Revision history, activity log, and revision-to-revision diff
- Starter config generation with
init - Bundled agent skill definition via
outline-edit skill - Zero third-party runtime dependencies — stdlib only, no supply-chain surface
Requirements
- Python 3.10+
- An Outline instance with API access enabled
- An API token with the scopes needed for your workflow
Installation
Install from PyPI:
pip install outline-edit
Install as a global tool with uv:
uv tool install outline-edit
Install as a global tool with pipx:
pipx install outline-edit
Run without installing:
uvx outline-edit --help
Install from a local checkout while developing:
uv tool install -e .
Configuration
You can configure the CLI with flags, environment variables, or an env file in the XDG config location.
Generate a starter config file:
outline-edit init
Generate and fill the required values interactively:
outline-edit init --interactive
Default config file:
~/.config/outline-edit/config.env
If XDG_CONFIG_HOME is set, the CLI uses:
$XDG_CONFIG_HOME/outline-edit/config.env
Example config file:
OUTLINE_CLI_BASE_URL=https://your-outline.example.com
OUTLINE_CLI_API_KEY=...
Optional settings:
OUTLINE_CLI_CACHE_DIR=/path/to/custom/cache
OUTLINE_CLI_TIMEOUT=30
Quick Start
Generate config and validate auth:
outline-edit init --interactive
outline-edit auth
Pull one collection into the local cache:
outline-edit pull --collection Engineering
Inspect the local cache:
outline-edit status
outline-edit list --collection Engineering
outline-edit read "Weekly Notes"
outline-edit search incident
Edit locally and push changes back:
outline-edit diff "Weekly Notes"
outline-edit push "Weekly Notes"
Create documents (published by default):
outline-edit create --collection Engineering --title "CLI Test" --text "body text"
outline-edit create --collection Engineering --title "Draft Note" --text "wip" --draft
Manage lifecycle and history:
outline-edit archive "CLI Test"
outline-edit restore "CLI Test"
outline-edit delete "CLI Test"
outline-edit history "Architecture Notes" --limit 10
outline-edit revdiff "Architecture Notes" previous latest
outline-edit log "Architecture Notes" --limit 20
Agent Integration
outline-edit ships a built-in skill definition that any AI agent can retrieve at runtime:
outline-edit skill
This prints a structured markdown document describing all commands, recommended workflows, rules, and common patterns. Agents that can run shell commands can use this to learn how to operate the tool without external documentation.
The skill file is also available in the repository at integrations/skills/outline-edit/SKILL.md.
Notes
- The env file defaults to
~/.config/outline-edit/config.env, or$XDG_CONFIG_HOME/outline-edit/config.envwhenXDG_CONFIG_HOMEis set. outline-edit initwrites a commented starter config to that path and refuses to overwrite an existing file unless--forceis passed.- The cache defaults to
~/.local/state/outline-edit/cache/<host>/, or$XDG_STATE_HOME/outline-edit/cache/<host>/whenXDG_STATE_HOMEis set. - The default cache path is scoped by Outline host so different instances do not share one index by accident.
- XDG path resolution is implemented directly with the Python standard library;
platformdirsis intentionally not used so the runtime dependency set stays at zero. pushuses optimistic locking against the last content-synced revision and refuses to overwrite newer remote edits.delete --permanentdepends on the caller having the necessary Outline permission.revdiffworks against remote revisions and does not depend on the local cached file.
Gotchas
- Optimistic locking, not merging.
pushchecks the remote revision against your lastpull. If the revision differs but the remote content is unchanged (e.g. a publish or archive bumped the revision), push automatically rebases and proceeds. If the remote content actually changed, push refuses the update. You must re-pull (which overwrites your local copy) or resolve the conflict manually. There is no three-way merge. diffis local-only.diffcompares your cached file against the snapshot saved at lastpull. It does not contact the remote server. Userevdiffto compare remote revisions against each other.- Search is substring-only. Local
searchdoes case-insensitive substring matching on titles, paths, and file content. There is no regex, fuzzy, or ranked full-text search. pulldefaults to all documents. On a large Outline workspace a barepullcan be slow and write a lot of files. Preferpull --collectionorpull --queryto scope the sync.delete --permanentis irreversible. The document is removed server-side and cannot be restored. This also requires the appropriate Outline permission on the server.- No automatic staleness detection. The cache does not refresh on its own. Run
pullexplicitly to update.status --staleshows documents where the remote revision is ahead of the cached content revision, but only based on metadata from the last pull. - Cache access is serialized per cache directory. Cache-touching commands take an OS-managed lock and cache files are replaced atomically. If another
outline-editcommand is already using the same cache, retry the command or use a separate--cache-dirfor concurrent agents. The.cache.lockfile itself is inert and should not require manual cleanup.
Current Limits
Not currently exposed by outline-edit
- Collection create/update/delete operations
- Comments
- Document move and duplicate operations
- Attachment or file upload workflows
- Recently viewed documents or per-document viewer reporting
Some of these exist in the Outline API but outline-edit does not wrap them yet.
Not a first-class primitive in the current workflow
- Section-level patch or merge operations
- Conflict-aware three-way merges
- A structured query layer beyond local substring search plus event/revision inspection
The write path is document-oriented: local edit, diff, then push.
Development
Basic smoke checks from a checkout:
python3 -m py_compile src/outline_edit/*.py
PYTHONPATH=src python3 -m outline_edit --help
Related Projects
- python-outline — Python client library for the Outline API
- mcp-outline — MCP server for Outline
- outline-agent — AI agent for Outline knowledge bases
- outline-skills — Skill definitions for Outline agents
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file outline_edit-0.2.1.tar.gz.
File metadata
- Download URL: outline_edit-0.2.1.tar.gz
- Upload date:
- Size: 32.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
967e63dcd063f6f394d2cb83ae80fe40ffed2b39ab68999e221e2a908499e046
|
|
| MD5 |
6cbd08dc5f5d60f5d609c21e9be9c18c
|
|
| BLAKE2b-256 |
8db7923f7c021e5f259a4f2f823cb5e76bfaa4185fefdd1b38c69513cb7f701d
|
File details
Details for the file outline_edit-0.2.1-py3-none-any.whl.
File metadata
- Download URL: outline_edit-0.2.1-py3-none-any.whl
- Upload date:
- Size: 29.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
328d85eff9814a436efe869113fdd2a6833f98cac9a958324c47231231d24fb8
|
|
| MD5 |
b76ae7de5e80741cb8ad2a00ef4fc292
|
|
| BLAKE2b-256 |
93b3ca43351b2544981bf5b08d8eff084f13117375f5e0315734ec51fdd5b7ec
|