Go CLI for Outline instances, primarily self-hosted deployments.
brew tap agynio/tap
brew install outline-cliDownload the archive for your platform from the GitHub Releases page, unpack it,
and place the outline binary on your PATH.
# macOS arm64 example; adjust the version, OS, and architecture as needed.
VERSION=v0.2.1
curl -L -o outline-cli.tar.gz \
"https://github.com/agynio/outline-cli/releases/download/${VERSION}/outline_${VERSION}_darwin_arm64.tar.gz"
tar -xzf outline-cli.tar.gz
chmod +x outline
sudo mv outline /usr/local/bin/outline
outline --versionRelease assets are published for Linux, macOS, and Windows.
go install ./cmd/outlineCreate an API key in Outline, then save the instance URL and token locally:
outline auth login --base-url https://wiki.example.com --api-key ol_api_xxx
outline auth info
outline auth configConfiguration is stored in ~/.outline-cli/config.yaml; the API key is stored in
~/.outline-cli/token with mode 0600. The CLI is otherwise stateless and does
not write local caches.
The default output format is YAML. JSON is available with --output json (or
-o json) for scripts, and documents pull prints raw Markdown.
outline collections list
outline documents search --query handbook
outline documents pull <id-or-urlId>
outline documents info --id <id-or-urlId> --output jsonThese examples assume you have a collection named Test. Replace placeholder IDs
with values from your Outline instance.
# List collections.
outline collections list
# Get the Test collection ID.
COLLECTION_ID=$(outline collections list -o json | jq -r '.[] | select(.name == "Test") | .id')
# Show collection details.
outline collections info --id "$COLLECTION_ID"
# Show the collection document tree.
outline collections tree "$COLLECTION_ID"# Create a document in Test.
DOCUMENT_ID=$(outline documents create \
--collection-id "$COLLECTION_ID" \
--title "CLI smoke test" \
--text "# CLI smoke test" \
--publish \
-o json | jq -r '.id')
# Update the document.
outline documents update \
--id "$DOCUMENT_ID" \
--title "CLI smoke test updated" \
--text "# Updated from outline-cli"
# Search documents.
outline documents search --query "CLI smoke" --collection-id "$COLLECTION_ID"
# Export the document to a file.
outline documents export --id "$DOCUMENT_ID" --accept text/markdown --out document.md# Add a comment.
outline comments create --document-id "$DOCUMENT_ID" --text "Reviewed from outline-cli"
# List document comments.
outline comments list --document-id "$DOCUMENT_ID"# Create a share for the document.
SHARE_ID=$(outline shares create --document-id "$DOCUMENT_ID" -o json | jq -r '.id')
# Reliable shares lookup on self-hosted servers: use document ID.
outline shares info --document-id "$DOCUMENT_ID" -o json
# Direct share-id lookup calls the server endpoint and may be unsupported on
# some self-hosted instances.
outline shares info --id "$SHARE_ID" -o jsonDestructive and security-sensitive commands require --yes in non-interactive
contexts or an interactive yes confirmation when a TTY is available. This
includes delete, revoke, rotate-secret, empty-trash, user role changes, suspend,
attachment delete, file-operation delete, group member removal, and collection
membership removal operations.
outline documents import --file <path> [--collection <id>|--parent-document <id>] [--publish]uploads multipart form data.outline documents export --id <id> [--accept <mime>] [--out <path>]writes export data to stdout or a file.outline collections export --id <id> --format <format>andoutline collections export-all --format <format>return Outline file-operation records.outline file-operations download --id <id> --out <path>downloads a completed file operation.outline comments update --id <id> --data-json <json>updates a comment with a valid ProseMirror document payload.outline documents restore --id <id> --revision-id <id>restores a document to a specific revision;--use-latest-revisionresolves the newest revision first.outline shares info --document-id <doc-id>is the reliable shares lookup path on self-hosted servers;--idcalls the server directly and errors with a--document-idhint if unsupported.outline attachments create ...returns signed upload instructions.outline attachments upload --file <path> [--document <id>]creates signed upload instructions and performs the upload.
scripts/integration_smoke.sh can run a curated method smoke test against a
real Outline instance without committing credentials. It reads credentials from
environment variables, uses an isolated temporary HOME by default, resolves a
collection named Test, creates a temporary document, and prints a
method-to-outcome table.
OUTLINE_BASE_URL=https://wiki.example.com \
OUTLINE_API_KEY=ol_api_xxx \
OUTLINE_BIN=/path/to/outline \
scripts/integration_smoke.shOptional variables:
OUTLINE_HOME: custom isolated HOME for CLI config and token files.OUTLINE_COLLECTION: collection name to resolve instead ofTest.
OUTLINE_BIN is required so the runner uses an existing binary instead of
go run, which avoids local CGO/compiler requirements in smoke-test
environments.
Common ID aliases and ID arguments are supported for scripting compatibility,
including --collection/--collection-id, --document/--document-id,
--group/--group-id, and --user/--user-id. Commands that
historically accepted a positional ID also accept --id while keeping the
positional form for compatibility.
outline access-requests approveoutline access-requests createoutline access-requests dismissoutline access-requests info
outline attachments createoutline attachments deleteoutline attachments redirectoutline attachments upload
outline auth configoutline auth info
outline collections add-groupoutline collections add-useroutline collections createoutline collections deleteoutline collections documentsoutline collections exportoutline collections export-alloutline collections group-membershipsoutline collections infooutline collections listoutline collections membershipsoutline collections remove-groupoutline collections remove-useroutline collections update
outline comments createoutline comments deleteoutline comments infooutline comments listoutline comments update
outline data-attributes createoutline data-attributes deleteoutline data-attributes infooutline data-attributes listoutline data-attributes update
outline documents add-groupoutline documents add-useroutline documents answer-questionoutline documents archiveoutline documents archivedoutline documents createoutline documents deleteoutline documents deletedoutline documents documentsoutline documents draftsoutline documents duplicateoutline documents empty-trashoutline documents exportoutline documents group-membershipsoutline documents importoutline documents infooutline documents insightsoutline documents listoutline documents membershipsoutline documents moveoutline documents remove-groupoutline documents remove-useroutline documents restoreoutline documents searchoutline documents search-titlesoutline documents templatizeoutline documents unpublishoutline documents updateoutline documents usersoutline documents viewed
outline events list
outline file-operations deleteoutline file-operations infooutline file-operations listoutline file-operations redirectoutline file-operations download
outline groups add-useroutline groups createoutline groups deleteoutline groups infooutline groups listoutline groups membershipsoutline groups remove-useroutline groups update
outline oauth-authentications deleteoutline oauth-authentications list
outline oauth-clients createoutline oauth-clients deleteoutline oauth-clients infooutline oauth-clients listoutline oauth-clients rotate-secretoutline oauth-clients update
outline revisions infooutline revisions list
outline shares createoutline shares infooutline shares listoutline shares revokeoutline shares update
outline stars createoutline stars deleteoutline stars listoutline stars update
outline templates createoutline templates deleteoutline templates duplicateoutline templates infooutline templates listoutline templates restoreoutline templates update
outline users activateoutline users deleteoutline users infooutline users inviteoutline users listoutline users suspendoutline users updateoutline users update-role
outline views createoutline views list