Skip to content
This repository was archived by the owner on Sep 20, 2026. It is now read-only.
dohwiPublic archive

About

CLI for Docmost — the open-source collaborative wiki

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

docmost-cli

Command-line interface for Docmost — the open-source collaborative wiki


Features

  • 95+ API endpoints & sync — pages, spaces, comments, search, shares, groups, files, workspace, favorites, notifications, sessions, sync
  • Sync — sync pull/push/status for local Markdown ↔ server bidirectional sync with manifest tracking, CE-safe content update, and ID remapping
  • Multi-profile config — manage multiple Docmost instances with --profile flag and config profile commands
  • Agent-friendly — --json, --no-retry, structured error codes, exit codes, no interactive prompts
  • Secure by default — Bearer auth, --password-stdin, SHA256-verified install & self-update
  • Resilient — 30s timeout, exponential-backoff retry with jitter, Ctrl-C cancellation
  • Path-traversal safe — files download and export reject paths containing ..
  • Self-update — docmost update checks and upgrades from GitHub Releases
  • Shell completion — docmost completion [bash|zsh|fish|powershell]
  • Community Edition — targets the open-source Docmost CE release

📦 Installation

One-liner (recommended):

curl -fsSL https://raw.githubusercontent.com/dohwi/docmost-cli/main/install.sh | bash

The installer downloads the release tarball for your platform, verifies its SHA256 checksum, and adds docmost to your shell PATH.

Manual download: grab a tarball from GitHub Releases and place the binary on your PATH.

Platforms: linux/amd64, linux/arm64, macos/intel, macos/apple, windows/amd64, windows/arm64


🚀 Quick Start

# Interactive login (reads password from stdin)
docmost login --url https://docs.example.com --email admin@example.com --password-stdin

# Agent / CI login (env vars, no flags in process list)
DOCMOST_URL=https://docs.example.com \
DOCMOST_EMAIL=admin@example.com \
DOCMOST_PASSWORD=secret \
docmost login

# Start using
docmost whoami --json
docmost pages list --limit 10
docmost search pages --query "deployment"

# Sync a space to local Markdown
docmost sync pull <space-id> --dir ./wiki
docmost sync status --dir ./wiki
docmost sync push --dir ./wiki --dry-run

# Multi-profile setup
docmost --profile prod login --url https://prod.example.com --email admin@example.com --password-stdin
docmost --profile dev login --url http://localhost:3000 --email admin@example.com --password-stdin
docmost --profile prod pages list --json
docmost config use dev

# Tree view
docmost pages list --spaceId <id> --tree

📋 Commands

Category Commands
Pages (25) list (with --tree) · get · create · update · delete · restore · move · move-to-space · duplicate · recent · created-by-user · trash · history · history-info · sidebar · breadcrumbs · labels · labels-add · labels-remove · backlinks · backlinks-count · bulk-update · watch · unwatch · watch-status
Spaces (14) list · get · create · update · delete · members · members-add · members-remove · members-role · permissions · watch · unwatch · watch-status · watched
Comments (5) list · get · create · update · delete
Search (3) pages · suggest · share-search
Favorites (3) add · remove · list
Notifications (4) list · unread-count · mark-read · mark-all-read
Shares (6) list · create · update · delete · info · page-info
Groups (8) list · get · create · update · delete · members · members-add · members-remove
Files (5) upload · download · info · upload-image · remove-icon
Sessions (3) list · revoke · revoke-all
Workspace (7) settings · update · members · invite · member-role · member-deactivate · search-index
Export / Import (5) export page · export space · import page · import zip · tasks
User (2) me · update
Sync (3) sync pull · sync push · sync status
Config (4) config · config use · config profile list · config profile remove
Auth & System login · logout · whoami · update · setup · health · liveness · version · completion

🔒 Security

  • All API requests use Authorization: Bearer <token> (no cookie leakage)
  • --password flag hidden from help; use --password-stdin or DOCMOST_PASSWORD env var
  • install.sh and docmost update verify SHA256 checksums before replacing the binary
  • files download and export reject paths containing ..
  • Verbose mode masks tokens as *** (N chars)
  • See SECURITY.md for vulnerability reporting

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/my-change
  3. Make your changes with clear, focused commits
  4. Ensure go vet ./... and go test ./... pass
  5. Open a pull request

Commit messages follow <type>: <description> — see AGENTS.md for details.


📄 License

MIT © dohwi


🙏 Acknowledgements

Inspired by and references glinhard/docmost-cli (Python CLI) for Docmost CE API compatibility patterns, including space slug resolution and Community Edition workarounds.

About

CLI for Docmost — the open-source collaborative wiki

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages