CLI reference
confluence-cli reads Confluence pages, searches via CQL, creates and edits pages, and manages comments. It supports Confluence Cloud and Data Center / Server, and emits agent-friendly JSON with structured errors. AGENT NOTE: a companion Skill ("confluence") carries the canonical usage, safety modes, and env setup and is the source of truth for driving this CLI. If you are an agent, load that Skill before composing commands. Check status with `confluence-cli skill status`; install it with `confluence-cli skill install`.
Generated from the command tree, so it always matches --help.
Global flags
Persistent flags accepted by every command.
| Flag | Default | Description |
|---|---|---|
--allow-writes | false | override read-only mode (defaults.read_only / CONFLUENCE_CLI_READ_ONLY) for this invocation |
--base-url | Confluence site URL (overrides config) | |
--config | config directory (default ~/.angelmsger/confluence, falling back to ~/.confluence when only that exists) | |
--fields | comma-separated dot-path fields to keep | |
--flavor | backend flavor: cloud, datacenter or auto | |
--format, -f | output format: json, table or ndjson | |
--pretty | false | human-friendly mode for interactive terminal use only (agents/scripts should omit): TUI in `config init`, colorized JSON elsewhere; errors without a TTY |
--timeout | request timeout, e.g. 30s | |
--use-context | use a named context for this invocation | |
--verbose, -v | false | verbose diagnostics on stderr |
confluence-cli attachment
Upload, list, download and delete page attachments
confluence-cli attachment
confluence-cli attachment delete
Delete an attachment
confluence-cli attachment delete <attachment-id> [flags]
Delete an attachment by its content ID. Deletion requires --yes, or an interactive confirmation when stdin is a terminal.
Options
| Flag | Default | Description |
|---|---|---|
--dry-run | false | print the request without sending it |
--yes | false | skip the deletion confirmation |
Examples
confluence-cli attachment delete att12345 --yes
confluence-cli attachment download
Download an attachment's content
confluence-cli attachment download <attachment-id> [flags]
Download an attachment by its content ID. Use --output - to stream to stdout.
Options
| Flag | Default | Description |
|---|---|---|
--output, -o | output path ('-' for stdout) |
Examples
confluence-cli attachment download att12345 --output spec.pdf confluence-cli attachment download att12345 --output -
confluence-cli attachment list
List the attachments of a page
confluence-cli attachment list <id|url> [flags]
Options
| Flag | Default | Description |
|---|---|---|
--all | false | fetch every page of results |
--cursor | start from this pagination cursor (the 'next' of a prior page) | |
--limit | 0 | page size (default from config) |
Examples
confluence-cli attachment list 123456
confluence-cli attachment update
Replace an attachment's content with a new version
confluence-cli attachment update <attachment-id> --file <PATH> [flags]
Upload new content for an existing attachment, creating a new version. The attachment keeps its name unless --name is given. Use --file - to read from stdin.
Options
| Flag | Default | Description |
|---|---|---|
--comment | version comment for the update | |
--dry-run | false | print the request without sending it |
--file | path to the new content ('-' for stdin) | |
--minor | false | mark the update as a minor edit |
--name | attachment file name (default: current name) |
Examples
confluence-cli attachment update att12345 --file diagram-v2.png confluence-cli attachment update att12345 --file report.pdf --comment "fix totals"
confluence-cli attachment upload
Attach a file to a page
confluence-cli attachment upload <page-id|url> --file <PATH> [flags]
Upload a file as a new attachment on a page. Use --file - to read the file from stdin (--name is then required). When an attachment with the same name already exists, Confluence stores the upload as a new version.
Options
| Flag | Default | Description |
|---|---|---|
--comment | version comment for the attachment | |
--dry-run | false | print the request without sending it |
--file | path to the file to upload ('-' for stdin) | |
--minor | false | mark the upload as a minor edit |
--name | attachment file name (default: base name of --file) |
Examples
confluence-cli attachment upload 123456 --file diagram.png confluence-cli attachment upload 123456 --file report.pdf --comment "Q3 figures" confluence-cli attachment upload 123456 --file - --name notes.txt --dry-run
confluence-cli auth
Inspect and manage stored credentials
confluence-cli auth
confluence-cli auth login
Store a credential for the configured server
confluence-cli auth login
Prompt for a secret and store it securely. Run `config init` first if the server URL is not set.
Examples
confluence-cli auth login confluence-cli --use-context staging auth login
confluence-cli auth logout
Remove the stored credential for the configured server
confluence-cli auth logout
confluence-cli auth status
Show whether a usable credential is configured
confluence-cli auth status
confluence-cli comment
Read and post page comments
confluence-cli comment
confluence-cli comment add
Post a comment on a page
confluence-cli comment add <id|url> [flags]
Post a footer comment on a page. Use --parent to reply to an existing comment.
Options
| Flag | Default | Description |
|---|---|---|
--body | comment body text | |
--body-file | read body from a file ('-' for stdin) | |
--body-format | storage | body format: storage or wiki |
--parent | parent comment ID, to post a reply |
Examples
confluence-cli comment add 123456 --body "Looks good to me."
# reply to a comment, reading the body from stdin
echo "Agreed." | confluence-cli comment add 123456 --parent 789 --body-file -
confluence-cli comment delete
Delete one or more comments
confluence-cli comment delete <comment-id|url>... [flags]
Delete a comment by its content ID. Pass several IDs to delete them in one run, or a single '-' to read newline-separated IDs from stdin. Deletion requires --yes (or an interactive confirmation when stdin is a terminal); --yes applies to the whole batch.
Options
| Flag | Default | Description |
|---|---|---|
--dry-run | false | print the request without sending it |
--yes | false | skip the deletion confirmation |
Examples
confluence-cli comment delete 789 --yes confluence-cli comment delete 789 790 --yes
confluence-cli comment list
List the footer comments of a page
confluence-cli comment list <id|url> [flags]
Options
| Flag | Default | Description |
|---|---|---|
--all | false | fetch every page of results |
--as | markdown | render comment bodies as markdown or text |
--cursor | start from this pagination cursor (the 'next' of a prior page) | |
--limit | 0 | page size (default from config) |
Examples
confluence-cli comment list 123456 confluence-cli comment list 123456 --all --as text
confluence-cli comment update
Edit a comment's body
confluence-cli comment update <comment-id|url> [flags]
Replace a footer comment's body. The new version is the current version + 1; pass --version to assert the version you last read.
Options
| Flag | Default | Description |
|---|---|---|
--body | new comment body text | |
--body-file | read body from a file ('-' for stdin) | |
--body-format | storage | body format: storage or wiki |
--dry-run | false | print the request without sending it |
--version | 0 | expected current version (fetched when omitted) |
Examples
confluence-cli comment update 789 --body "Updated: looks good." echo "Revised." | confluence-cli comment update 789 --body-file -
confluence-cli config
Manage confluence-cli configuration
confluence-cli config
confluence-cli config delete-context
Delete a context and its stored credential
confluence-cli config delete-context <name>
Examples
confluence-cli config delete-context staging
confluence-cli config get-contexts
List the configured contexts
confluence-cli config get-contexts
List every context in the config file. The current context — the one used when --use-context is not given — is marked.
Examples
confluence-cli config get-contexts confluence-cli config get-contexts --format table
confluence-cli config init
Interactively set up server URL and credentials
confluence-cli config init
Run the interactive setup wizard. It collects a server URL, detects the flavor, validates a credential and stores it. The wizard can also configure additional named contexts for working with several servers.
Examples
confluence-cli config init --pretty # interactive TUI (recommended) confluence-cli config init # plain line-by-line wizard (scripts, non-TTY)
confluence-cli config path
Print the config file path
confluence-cli config path
confluence-cli config show
Show the resolved configuration
confluence-cli config show [flags]
Options
| Flag | Default | Description |
|---|---|---|
--explain | false | annotate each value with its source |
confluence-cli config use-context
Switch the current context
confluence-cli config use-context <name>
Set the current context — the server used by default. Override it for a single command with the global --use-context flag instead.
Examples
confluence-cli config use-context staging
confluence-cli doctor
Diagnose configuration, credentials and connectivity
confluence-cli doctor [flags]
Options
| Flag | Default | Description |
|---|---|---|
--no-update-check | false | skip the check for a newer confluence-cli release |
Examples
confluence-cli doctor confluence-cli doctor --no-update-check
confluence-cli label
List, add and remove page labels
confluence-cli label
confluence-cli label add
Add one or more labels to a page
confluence-cli label add <page-id|url> <label>... [flags]
Options
| Flag | Default | Description |
|---|---|---|
--dry-run | false | print the request without sending it |
Examples
confluence-cli label add 123456 release-notes confluence-cli label add 123456 q3 reviewed --dry-run
confluence-cli label list
List the labels on a page
confluence-cli label list <page-id|url> [flags]
Options
| Flag | Default | Description |
|---|---|---|
--all | false | fetch every page of results |
--cursor | start from this pagination cursor (the 'next' of a prior page) | |
--limit | 0 | page size (default from config) |
Examples
confluence-cli label list 123456
confluence-cli label remove
Remove a label from a page
confluence-cli label remove <page-id|url> <label> [flags]
Options
| Flag | Default | Description |
|---|---|---|
--dry-run | false | print the request without sending it |
Examples
confluence-cli label remove 123456 release-notes
confluence-cli page
Read and write Confluence pages
confluence-cli page
confluence-cli page children
List the direct child pages of a page
confluence-cli page children <id|url> [flags]
Options
| Flag | Default | Description |
|---|---|---|
--all | false | fetch every page of results |
--cursor | start from this pagination cursor (the 'next' of a prior page) | |
--limit | 0 | page size (default from config) |
Examples
confluence-cli page children 123456 confluence-cli page children 123456 --all --format table
confluence-cli page copy
Copy a page's title and body to a new page
confluence-cli page copy <id|url> --title <TITLE> [flags]
Create a new page from an existing one. The copy is shallow: it carries the title and body only, not child pages or attachments.
Options
| Flag | Default | Description |
|---|---|---|
--dry-run | false | print the request without sending it |
--parent | parent page for the copy (default: source parent) | |
--space | space key for the copy (default: source space) | |
--title | title for the copied page |
Examples
confluence-cli page copy 123456 --title "Copy of the spec" confluence-cli page copy 123456 --title Draft --space SANDBOX
confluence-cli page create
Create a new page
confluence-cli page create --space <KEY> --title <TITLE> [flags]
Create a page in a space. Use --parent to nest it under an existing page. The body may be storage-format XHTML, Confluence wiki markup or Markdown (--body-format markdown, converted on a best-effort basis).
Options
| Flag | Default | Description |
|---|---|---|
--body | body text | |
--body-file | read body from a file ('-' for stdin) | |
--body-format | storage | body format: storage, wiki or markdown |
--dry-run | false | print the request without sending it |
--parent | parent page ID or URL | |
--space | space key for the new page | |
--title | page title |
Examples
# create a page from a Markdown file, nested under a parent confluence-cli page create --space ENG --title "Release Notes" \ --parent 123456 --body-format markdown --body-file notes.md # preview the request without sending it confluence-cli page create --space ENG --title Draft --body "<p>hi</p>" --dry-run
confluence-cli page delete
Delete one or more pages (move them to the trash)
confluence-cli page delete <id|url>... [flags]
Move a page to the trash. With --purge the trashed page is then permanently removed. Pass several IDs to delete them in one run, or a single '-' to read newline-separated IDs from stdin. Deletion requires --yes (or an interactive confirmation when stdin is a terminal); --yes applies to the whole batch.
Options
| Flag | Default | Description |
|---|---|---|
--dry-run | false | print the request without sending it |
--purge | false | permanently delete (removes the trashed page) |
--yes | false | skip the deletion confirmation |
Examples
confluence-cli page delete 123456 --yes confluence-cli page delete 123456 123457 --purge --yes confluence-cli search --text obsolete --format json | jq -r '.items[].id' | confluence-cli page delete - --yes
confluence-cli page descendants
List all descendant pages of a page
confluence-cli page descendants <id|url> [flags]
Options
| Flag | Default | Description |
|---|---|---|
--all | false | fetch every page of results |
--cursor | start from this pagination cursor (the 'next' of a prior page) | |
--limit | 0 | page size (default from config) |
Examples
confluence-cli page descendants 123456 --all
confluence-cli page get
Fetch a page and render its body
confluence-cli page get <id|url> [flags]
Fetch a single page. Use --scope to read only part of the body: outline list the headings (start here when the structure is unknown) section one section, identified by --section <id> from the outline keyword blocks matching --keyword, with their heading for context full the entire body (default) Rendering to markdown/text drops content it cannot represent (macros, images); when that happens the result carries a render_notes field. Use --as raw to get the untouched source body instead.
Options
| Flag | Default | Description |
|---|---|---|
--as | markdown | output form: markdown, text or raw (unrendered source) |
--body-format | storage | source body format: storage or view |
--detail | simple | block detail: simple, with-ids or full |
--keyword | keyword (with --scope keyword) | |
--no-body | false | fetch metadata only, skip the body |
--output, -o | write the page body to a file; stdout then carries only metadata (id, title, output_path, bytes) | |
--scope | full | read scope: full, outline, section or keyword |
--section | section ID (with --scope section) |
Examples
# render the whole page as Markdown confluence-cli page get 123456 # list the headings, then read just one section confluence-cli page get 123456 --scope outline confluence-cli page get 123456 --scope section --section sec-2 # get the untouched storage XHTML (macros and all) confluence-cli page get 123456 --as raw # a page URL works in place of an ID confluence-cli page get https://wiki.example.com/pages/viewpage.action?pageId=123456
confluence-cli page history
List a page's version history
confluence-cli page history <id|url> [flags]
Options
| Flag | Default | Description |
|---|---|---|
--all | false | fetch every page of results |
--cursor | start from this pagination cursor (the 'next' of a prior page) | |
--limit | 0 | page size (default from config) |
Examples
confluence-cli page history 123456 confluence-cli page history 123456 --all --format table
confluence-cli page move
Move a page under a new parent and/or space
confluence-cli page move <id|url> [flags]
Options
| Flag | Default | Description |
|---|---|---|
--dry-run | false | print the request without sending it |
--target-parent | new parent page ID or URL | |
--target-space | new space key |
Examples
# reparent a page confluence-cli page move 123456 --target-parent 999 # move a page into another space confluence-cli page move 123456 --target-space DOCS
confluence-cli page restore
Restore a page to an earlier version
confluence-cli page restore <id|url> --version <N> [flags]
Republish an earlier version's body as a new version. The restore is non-destructive: the version history is left intact. Run `page history` first to find the version number to restore.
Options
| Flag | Default | Description |
|---|---|---|
--dry-run | false | print the request without sending it |
--message | version comment for the restore | |
--version | 0 | the version number to restore |
Examples
confluence-cli page restore 123456 --version 3 confluence-cli page restore 123456 --version 3 --message "roll back bad edit"
confluence-cli page unwatch
Stop watching a page
confluence-cli page unwatch <id|url> [flags]
Options
| Flag | Default | Description |
|---|---|---|
--dry-run | false | print the request without sending it |
Examples
confluence-cli page unwatch 123456
confluence-cli page update
Update a page's title and/or body
confluence-cli page update <id|url> [flags]
Update an existing page. Omitted fields are kept as-is. The new version is the current version + 1; pass --version to assert the version you last read (a mismatch fails with a conflict error).
Options
| Flag | Default | Description |
|---|---|---|
--body | body text | |
--body-file | read body from a file ('-' for stdin) | |
--body-format | storage | body format: storage, wiki or markdown |
--dry-run | false | print the request without sending it |
--message | version comment for the edit | |
--minor | false | mark the edit as minor |
--title | new page title (kept when omitted) | |
--version | 0 | expected current version (fetched when omitted) |
Examples
# retitle a page, keeping its body confluence-cli page update 123456 --title "New Title" # replace the body from Markdown, asserting the version last read confluence-cli page update 123456 --body-format markdown --body-file body.md --version 7
confluence-cli page watch
Watch a page (subscribe to its notifications)
confluence-cli page watch <id|url> [flags]
Options
| Flag | Default | Description |
|---|---|---|
--dry-run | false | print the request without sending it |
Examples
confluence-cli page watch 123456
confluence-cli page watch-status
Report whether you watch a page
confluence-cli page watch-status <id|url>
Examples
confluence-cli page watch-status 123456
confluence-cli search
Search pages with CQL or filter flags
confluence-cli search [cql] [flags]
Search Confluence content. Provide a raw CQL string as the argument, or build one from filter flags (--text, --author, --space, ...).
Options
| Flag | Default | Description |
|---|---|---|
--after | modified on/after date, e.g. 2025-01-01 | |
--all | false | fetch every page of results |
--author | original creator (CQL: creator =); find IDs with `user search` | |
--before | modified on/before date, e.g. 2025-12-31 | |
--contributor | any contributor (CQL: contributor =); find IDs with `user search` | |
--cursor | start from this pagination cursor (the 'next' of a prior page) | |
--label | label (CQL: label =) | |
--limit | 0 | page size (default from config) |
--space | space key (CQL: space =) | |
--text | free-text match (CQL: text ~) | |
--type | content type: page, blogpost, comment, attachment |
Examples
# filter flags are combined into a CQL query confluence-cli search --text "release process" --space ENG --type page # or pass raw CQL directly confluence-cli search 'creator = "jdoe" AND created >= "2025-01-01"' --all
confluence-cli skill
Install the companion Skill for coding agents (Claude Code, Codex)
confluence-cli skill
confluence-cli skill install
Deploy the embedded Skill into a coding agent's skills directory
confluence-cli skill install [flags]
Write the companion `confluence` Skill — bundled inside this binary — into a coding agent's skills directory. With no flags it probes for installed agents (Claude Code, Codex) and installs into each one found. Re-run it after upgrading the CLI to refresh the Skill to the matching version.
Options
| Flag | Default | Description |
|---|---|---|
--agent | [] | target agents instead of auto-detecting (claude-code, codex) |
--dir | explicit skills base directory; installs into <dir>/confluence | |
--project | false | install into the project (./.claude/skills, ./.agents/skills) instead of $HOME |
confluence-cli skill path
Print where the Skill would be installed, and whether it is
confluence-cli skill path [flags]
Options
| Flag | Default | Description |
|---|---|---|
--agent | [] | limit to specific agents (claude-code, codex) |
--dir | explicit skills base directory | |
--project | false | use the project skills directories instead of $HOME |
confluence-cli skill show
Print the embedded SKILL.md to stdout
confluence-cli skill show
confluence-cli skill status
Report whether the companion Skill is loaded and installed
confluence-cli skill status [flags]
Options
| Flag | Default | Description |
|---|---|---|
--project | false | check the project skills dirs (./.claude/skills, ./.agents/skills) instead of $HOME |
confluence-cli skill uninstall
Remove the companion Skill from a coding agent's skills directory
confluence-cli skill uninstall [flags]
Delete a previously installed `confluence` Skill. With no flags it probes for installed agents (Claude Code, Codex) and removes the Skill from each one found.
Options
| Flag | Default | Description |
|---|---|---|
--agent | [] | target agents instead of auto-detecting (claude-code, codex) |
--dir | explicit skills base directory; removes <dir>/confluence | |
--project | false | remove from the project (./.claude/skills, ./.agents/skills) instead of $HOME |
confluence-cli space
List and inspect Confluence spaces
confluence-cli space
confluence-cli space get
Fetch a single space by key
confluence-cli space get <key>
confluence-cli space list
List spaces
confluence-cli space list [flags]
Options
| Flag | Default | Description |
|---|---|---|
--all | false | fetch every page of results |
--cursor | start from this pagination cursor (the 'next' of a prior page) | |
--limit | 0 | page size (default from config) |
--type | filter by type: global or personal |
confluence-cli user
Discover Confluence users — the values --author / --contributor accept
confluence-cli user
confluence-cli user get
Show details of a single user (accountId on Cloud; username on DC)
confluence-cli user get <selector>
confluence-cli user me
Print the user the configured credentials authenticate as (alias for whoami)
confluence-cli user me
confluence-cli user search
Search users by display-name substring
confluence-cli user search [flags]
Search Confluence users. Cloud: --query is required (the CQL `user.fullname ~ "..."` search). DC: --query is optional (omit for a paginated walk of every user).
Options
| Flag | Default | Description |
|---|---|---|
--all | false | fetch every page of results |
--cursor | start from this pagination cursor (the 'next' of a prior page) | |
--limit | 0 | page size (default from config) |
--query | display-name substring (required on Cloud) |
confluence-cli version
Print version information
confluence-cli version
confluence-cli whoami
Print the user the configured credentials authenticate as
confluence-cli whoami
Examples
confluence-cli whoami