Skip to main content

CLI tool for managing Docmost wiki instances

Project description

docmost-cli

PyPI version Python License: AGPL-3.0

A command-line tool for managing Docmost wiki instances from the terminal.


Features

  • Page CRUD -- create, read, update, and delete wiki pages with Markdown content
  • Space management -- list, create, and update workspaces
  • Comments -- add, edit, and list comments on any page
  • Full-text search -- search across pages and attachments
  • ProseMirror conversion -- automatic conversion between Docmost's ProseMirror JSON and Markdown
  • Tree view -- display page hierarchies as indented trees
  • Configuration profiles -- manage multiple Docmost instances with named profiles
  • Edition-agnostic -- works with both Docmost Enterprise (API key) and Community (email/password)
  • Unix-friendly output -- data to stdout, messages to stderr; every command is pipeable

Installation

From PyPI (recommended)

pip install docmost-cli

With pipx (isolated environment)

pipx install docmost-cli

From source

git clone https://github.com/glinhard/docmost-cli.git
cd docmost-cli
uv pip install -e .

Quick Start

# 1. Set up your configuration (interactive wizard)
docmost-cli config init

# 2. Test connectivity and authentication
docmost-cli config test

# 3. List all spaces
docmost-cli space list

# 4. Get a page as Markdown
docmost-cli page get <page-id>

# 5. Create a new page from a Markdown file
docmost-cli page create <space-slug> --title "My Page" --file content.md

Command Reference

Command Description
docmost-cli config init Interactive configuration setup wizard
docmost-cli config show Show current configuration (secrets masked)
docmost-cli config set <key> <value> Set a configuration value
docmost-cli config test Test connectivity and authentication
docmost-cli page list <space-slug> List pages in a space (--tree, --json)
docmost-cli page get <page-id> Get page content as Markdown (--meta, --raw)
docmost-cli page create <space-slug> Create a new page (--title, --file, --stdin)
docmost-cli page update <page-id> Update a page (--title, --content, --file)
docmost-cli page delete <page-id> Delete a page (with confirmation, --yes to skip)
docmost-cli page move <page-id> Move a page (--parent, --space, --position)
docmost-cli page duplicate <page-id> Duplicate a page
docmost-cli page copy <page-id> Copy a page to another space (--space)
docmost-cli page children <page-id> List child pages (--json)
docmost-cli page history <page-id> Show page version history (--json)
docmost-cli page export <page-id> Export page (--format md|html, --output)
docmost-cli page import <space-slug> Import a Markdown file as a new page
docmost-cli space list List all spaces (--detail, --json)
docmost-cli space get <space-slug> Get space details
docmost-cli space create Create a new space (--name, --slug)
docmost-cli space update <space-slug> Update a space (--name, --description)
docmost-cli comment list <page-id> List comments on a page (--json)
docmost-cli comment create <page-id> Add a comment (--content)
docmost-cli comment update <comment-id> Edit a comment (--content)
docmost-cli search <query> Full-text search (--space, --limit, --json)
docmost-cli attachment search <query> Search attachments (--space)
docmost-cli workspace info Show workspace details
docmost-cli workspace members List workspace members (--json)
docmost-cli user me Show authenticated user info

Configuration

Config file location

~/.config/docmost-cli/config.toml

Override with --config /path/to/config.toml on any command.

Profiles

The config file supports multiple named profiles for managing different Docmost instances:

[default]
url = "https://docs.example.com"
api_key = "dm_xxxxxxxxxxxxxxxxxxxx"

[staging]
url = "https://staging-docs.example.com"
api_key = "dm_yyyyyyyyyyyyyyyyyyyy"

Switch profiles with --profile or -p:

docmost-cli --profile staging space list

Environment variables

All configuration values can be overridden via environment variables:

Variable Description
DOCMOST_URL Docmost instance URL
DOCMOST_API_KEY API key (Enterprise edition)
DOCMOST_EMAIL Login email (Community edition)
DOCMOST_PASSWORD Login password (Community edition)
DOCMOST_PROFILE Active profile name

Environment variables take precedence over config file values.

Authentication

Enterprise edition (API key)

Use an API key for authentication. Set it in the config file or via DOCMOST_API_KEY:

docmost-cli config set api_key "dm_xxxxxxxxxxxxxxxxxxxx"

Community edition (email/password)

Use email and password for session-based authentication:

docmost-cli config set email "user@example.com"
docmost-cli config set password "secret"

The CLI automatically detects which auth method to use: if api_key is present it uses token auth, otherwise it falls back to email/password session auth.

Tab Completion

Enable shell tab completion for all commands and options:

docmost-cli --install-completion

Supports bash, zsh, fish, and PowerShell.

Development

# Clone and install in development mode
git clone https://github.com/glinhard/docmost-cli.git
cd docmost-cli
uv pip install -e ".[dev]"

# Run tests
pytest

# Run tests with coverage
pytest --cov=docmost_cli

# Linting and formatting
ruff check src/ tests/
ruff format src/ tests/

# Type checking
mypy src/

Acknowledgments

This CLI is a third-party tool for Docmost, an open-source collaborative wiki and documentation platform — an alternative to Confluence and Notion. Docmost is created by @Philipinho and contributors, licensed under AGPL-3.0.

License

AGPL-3.0. See LICENSE for details.

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

docmost_cli-0.4.0.tar.gz (99.9 kB view details)

Uploaded Source

Built Distribution

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

docmost_cli-0.4.0-py3-none-any.whl (80.2 kB view details)

Uploaded Python 3

File details

Details for the file docmost_cli-0.4.0.tar.gz.

File metadata

  • Download URL: docmost_cli-0.4.0.tar.gz
  • Upload date:
  • Size: 99.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for docmost_cli-0.4.0.tar.gz
Algorithm Hash digest
SHA256 30348a81d268f5c840e43e90964756fb883bcf6d5baa16fb67a37fd95e28d7a9
MD5 ebd0348f503bc6b270989d391dfe3018
BLAKE2b-256 6ec00b5c63fb5bbaf75b79ee226cd0863765999990cb8048f36963cdfb29856f

See more details on using hashes here.

File details

Details for the file docmost_cli-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: docmost_cli-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 80.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for docmost_cli-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3c291ec4ebb369654122b6d7c6c816d4cdbb5b5c5f1e7fc65ff779038509887
MD5 0844313e862222cd23bf8ebfa1dbe2f4
BLAKE2b-256 2ffd7984997efc3c7cf17d2e6c6101c9296e184471fb7df0b933e7284b1a3e96

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