confluencedc-cli
v1.0.22
Published
Command-line interface for [Confluence Data Center](https://developer.atlassian.com/server/confluence/confluence-rest-api-summary/). 19 commands across 5 domains — pages, comments, attachments, labels, and search.
Downloads
4,165
Readme
confluencedc-cli
Command-line interface for Confluence Data Center. 19 commands across 5 domains — pages, comments, attachments, labels, and search.
Install
npm install -g confluencedc-cliSetup
export CONFLUENCE_URL="https://confluence.example.com" # Base URL of your Confluence instance
export CONFLUENCE_TOKEN="your-personal-access-token" # HTTP Access Token from ConfluenceCommands
All commands output JSON. Add --pretty to pretty-print.
page
| Command | Description |
|---------|-------------|
| confluencedc page get [pageId] | Get a page by ID, or by --title + --space |
| confluencedc page children <pageId> | Get child pages |
| confluencedc page history <pageId> | Get version history |
| confluencedc page create | Create a page (--space, --title, --body, --parent, --format: storage/wiki) |
| confluencedc page update <pageId> | Update a page (auto-fetches current version) |
| confluencedc page delete <pageId> | Delete a page |
comment
| Command | Description |
|---------|-------------|
| confluencedc comment list <pageId> | List comments on a page |
| confluencedc comment create <pageId> | Create a comment (wiki markup) |
| confluencedc comment update <commentId> | Update a comment (auto-fetches version) |
| confluencedc comment delete <commentId> | Delete a comment |
| confluencedc comment reply <commentId> | Reply to a comment (threaded) |
attachment
| Command | Description |
|---------|-------------|
| confluencedc attachment list <pageId> | List attachments on a page |
| confluencedc attachment download <pageId> <filename> | Download a single attachment |
| confluencedc attachment download-all <pageId> | Download all attachments to a directory |
| confluencedc attachment upload <pageId> <files...> | Upload one or more files |
| confluencedc attachment delete <pageId> <attachmentId> | Delete an attachment |
label
| Command | Description |
|---------|-------------|
| confluencedc label list <pageId> | List labels on a page |
| confluencedc label add <pageId> <labels...> | Add labels to a page |
search
| Command | Description |
|---------|-------------|
| confluencedc search <cql> | Search using CQL (--limit, --expand) |
Pagination
List commands accept --limit to control page size. Responses include a nextPage cursor — pass it back as --start to fetch the next page. When nextPage is null, there are no more results.
Examples
# Get a page by ID
confluencedc page get 12345
# Find a page by title in a space
confluencedc page get --title "Architecture Overview" --space AITF
# Get child pages
confluencedc page children 12345
# Create a page
confluencedc page create --space AITF --title "New Page" --body "<p>Hello</p>" --format storage
# Create a page under a parent
confluencedc page create --space AITF --title "Sub Page" --body "h1. Hello" --format wiki --parent 12345
# Update page content
confluencedc page update 12345 --body "<p>Updated content</p>"
# Create a comment (wiki markup)
confluencedc comment create 12345 --body "Looks good, ship it"
# Reply to a comment
confluencedc comment reply 67890 --body "Agreed"
# Search with CQL
confluencedc search 'space = "AITF" AND type = "page" AND text ~ "deployment"'
# Download all attachments from a page
confluencedc attachment download-all 12345 --output ./downloads
# Upload a file
confluencedc attachment upload 12345 ./diagram.pngContent Formats
Confluence supports two body formats:
storage— Confluence storage format (XHTML-like). Use for precise control.wiki— Wiki markup. Simpler syntax, auto-converted to storage on save.
Comments always use wiki markup.
