Skip to content

AngelMsger/confluence-cli

Repository files navigation

confluence-cli

CI npm Go version License: MIT Docs Confluence

Use Confluence as a knowledge base from your terminal — built for coding agents.

confluence-cli lets coding agents (Claude Code and others) — and humans — read, search and maintain a Confluence instance from the command line: fetch and edit pages, manage attachments, labels and comments. It speaks to both Confluence Cloud and Data Center / Server, returns agent-friendly JSON with structured errors, and ships a companion Skill that teaches an agent how to use it. Write commands support --dry-run, and destructive ones require --yes.

📖 Documentation site: https://angelmsger.github.io/confluence-cli/

confluence-cli — use Confluence as a knowledge base from your terminal

Features

  • Cloud & Data Center — one flavor-agnostic client; the backend is detected automatically.
  • Agent-friendly — JSON output by default, structured errors with exit codes and recovery hints, and partial page reads (outline / section / keyword) so an agent spends minimal context.
  • Read & write — fetch pages and browse trees, CQL search; create, edit, move, delete and restore pages; manage attachments, labels, comments and page watches. Every write supports --dry-run; destructive commands need --yes.
  • Flexible configuration — CLI flags, environment variables, a .env file, a YAML config file, or an interactive wizard; secrets stored in the OS keychain.
  • Companion Skill — a confluence Skill, embedded in the binary, that guides coding agents through the CLI.

Installation

Install the CLI

npm install -g @angelmsger/confluence-cli                                   # npm
go install github.com/angelmsger/confluence-cli/cmd/confluence-cli@latest   # go
make install                                                                # from source

Or download a prebuilt binary from the Releases page. The full installation guide covers every method.

Shell completion (optional)

confluence-cli completes subcommands, enum flag values and live space keys. Load the completion script for your shell once:

source <(confluence-cli completion bash)                       # bash, current shell
confluence-cli completion zsh > "${fpath[1]}/_confluence-cli"   # zsh, persistent

fish, PowerShell and persistent setup are covered in docs/installation.md.

Companion Skill (optional)

The confluence Skill is embedded in the binary; deploy it for your coding agent. skill install probes for installed agents (Claude Code, Codex) and installs into each one found:

confluence-cli skill install            # auto-detect; install for each agent found
confluence-cli skill install --agent codex
confluence-cli skill uninstall          # remove it again

Re-run it after upgrading the CLI to keep the Skill version-matched. Details, including the npx skills workflow, are in docs/installation.md.

Quick start

confluence-cli config init --pretty   # interactive TUI setup (recommended for humans)
confluence-cli doctor                 # verify configuration and connectivity

confluence-cli search --text "release process"
confluence-cli page get <id|url> --scope outline
confluence-cli page get <id|url> --scope section --section sec-2
confluence-cli comment list <id|url>

Configuration

Settings resolve in precedence order (highest first): CLI flags → environment variables (CONFLUENCE_*) → .env~/.angelmsger/confluence/config.yaml (legacy fallback ~/.confluence/config.yaml) → defaults. See .env.example and docs/installation.md. Secrets are stored in the OS keychain (with a 0600 file fallback) and never written to the config file.

Commands

Command Purpose
page get fetch a page; render body with --scope/--detail/--as
page children / page descendants browse the page tree
page create / update / delete / move / copy write pages; --dry-run previews, delete needs --yes
page history / page restore list versions; roll a page back to an earlier one
page watch / unwatch / watch-status subscribe to or check page notifications
search CQL search, raw or built from --text/--author/--space/...
space list / space get inspect spaces
comment list / add / update / delete read, post, edit and remove comments
attachment list / download / upload / update / delete inspect, fetch and manage attachments
label list / add / remove manage page labels
whoami print the user the credentials authenticate as
user search / user get / user me discover Confluence users — the values --author / --contributor accept (Cloud: --query required; DC: optional)
skill install / skill uninstall deploy or remove the embedded companion Skill (Claude Code, Codex)
config get-contexts / use-context / delete-context manage multiple named servers
config / auth / doctor / version setup and diagnostics

In the default JSON output, list commands return a {items, next, has_more} envelope; pass --cursor with a prior page's next to read the following page, or --all to fetch every page. --format ndjson instead streams the items themselves, one JSON object per line.

Multiple servers (contexts)

A single config file can hold several Confluence servers as named contexts. Most users need only one and never see the concept — config init --pretty configures a default context and the flow is unchanged. To work with more than one server, re-run config init --pretty and pick Add a new context, then:

confluence-cli config get-contexts          # list contexts, current marked
confluence-cli config use-context prod      # switch the current context
confluence-cli --use-context prod page get 123   # override for one command

CONFLUENCE_CONTEXT overrides the current context via the environment. Legacy single-server config files are read unchanged.

Related

Driving Bitbucket pull requests too? See bitbucket-cli — the sister CLI from the same author, same agent-first design.

Development

make test       # unit + integration tests
make e2e        # build + run against an in-repo mock Confluence server
make e2e-live   # additionally run read-only checks against the real server
make lint       # gofmt + go vet
make docs       # regenerate the CLI reference under docs/cli/

The docs/cli/ reference is generated from the cobra command tree by cmd/gen-docs, so it always matches --help. After changing a command or flag, run make docs and commit the result — CI fails if it drifts.

See docs/technical-design.md for the architecture and internal/ package layout, docs/releasing.md for the release process, and CHANGELOG.md for the version history.

License

Released under the MIT License.

About

A command-line tool that lets coding agents (Claude Code and others) use a Confluence instance as an external knowledge base. It reads pages, searches with CQL, browses spaces and page trees, and reads or posts comments.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages