confluence
Confluence CLI
Command-line tool for managing Confluence pages via af confluence.
Setup
Add the following environment variables to your project's .env file:
JIRA_BASE_URL— Your Atlassian instance URL (e.g.,https://company.atlassian.net)JIRA_EMAIL— Your Atlassian account emailJIRA_API_TOKEN— API token from https://id.atlassian.com/manage-profile/security/api-tokens
Uses the same Atlassian credentials as the Jira skill.
Project Defaults
If the project instructions specify a default Confluence space key (e.g., Confluence space: TEAM), use it as the default for --space, list, and CQL queries. Explicit user input always overrides the default.
Quick Reference
Run af confluence --help for all options.
Read Operations
af confluence get <page-id>— Get page content and metadataaf confluence list <space-key> [--limit N]— List pages in a spaceaf confluence search "<cql>"— Search with CQLaf confluence tree <page-id>— Show page and its childrenaf confluence comments <page-id>— List comments on a pageaf confluence labels <page-id>— List labels on a pageaf confluence attachments <page-id>— List attachments on a pageaf confluence spaces— List all spacesaf confluence space <space-key>— Get space details
Write Operations
af confluence create --space <key> --title "<text>" [--body "<text>"] [--body-file <path>] [--parent <page-id>] [--status draft|current]af confluence update <page-id> [--title "<text>"] [--body "<text>"] [--body-file <path>] [--status draft|current] [--message "<text>"]af confluence delete <page-id>af confluence comment <page-id> --add "<text>"af confluence label <page-id> --add "<name>"af confluence label <page-id> --remove "<name>"af confluence attach <page-id> <file>— Upload an attachment
Output Formats
- Default: Markdown
- JSON: Add
--jsonflag
Common Workflows
Publish a document from a file
af confluence create --space TEAM --title "Architecture Decision Record" \
--body-file ./docs/adr-001.md
Create a child page under an existing page
# Find the parent page ID first
af confluence search "title = 'Engineering Wiki' AND space = TEAM"
# Create child page
af confluence create --space TEAM --title "Onboarding Guide" \
--body-file ./onboarding.md --parent 12345
Update a page from a file with a version message
af confluence update 12345 --body-file ./updated-doc.md \
--message "Revised after Q1 review"
Create a draft page
af confluence create --space TEAM --title "RFC: New Auth System" \
--body-file ./rfc.md --status draft
Browse a page tree
# See a page and all its children
af confluence tree 12345
Work with comments
# List comments
af confluence comments 12345
# Add a comment
af confluence comment 12345 --add "Reviewed — looks good to merge"
Manage labels
# List labels
af confluence labels 12345
# Add a label
af confluence label 12345 --add "reviewed"
# Remove a label
af confluence label 12345 --remove "draft"
# Bulk label: add to multiple pages
for id in 12345 12346 12347; do
af confluence label "$id" --add "q1-roadmap"
done
Attach files
# Attach a diagram
af confluence attach 12345 ./architecture.png
# Attach multiple files
for f in ./diagrams/*.png; do
af confluence attach 12345 "$f"
done
Search examples
# Pages in a space
af confluence search "space = TEAM" --limit 20
# Pages by title
af confluence search "title = 'Meeting Notes'"
# Pages with a specific label
af confluence search "label = 'architecture'"
# Recently modified pages
af confluence search "space = TEAM AND lastModified > now('-7d')"
# Pages containing specific text
af confluence search "text ~ 'deployment process'"
# Pages by creator
af confluence search "creator = currentUser() AND space = TEAM"
Tips
- Discover first: Run
af confluence spacesto find space keys,af confluence list <space>to browse pages - Use
--body-filefor real content: Inline--bodyis fine for short pages; use--body-filefor anything substantial - Quote CQL queries: Always wrap CQL in double quotes to handle spaces and operators
- CQL syntax: Uses
=for exact match,~for contains,AND/ORfor combining. See Atlassian CQL docs for full syntax - Use
--jsonfor scripting: Pipe output tojqfor automation
Error Handling
- Errors print to stderr
- With
--json:{"error": "message"} - Exit codes:
0success,1error
More from avantmedialtd/skills
typescript-react-standards
Opinionated TypeScript and React development standards from Avant Media. Use when scaffolding new components, reviewing code, writing TypeScript interfaces or types, setting up project structure, creating React hooks, or working on any TypeScript/React codebase. Also use when the user asks about best practices, patterns, or conventions for TypeScript or React projects, even if they don't explicitly mention "standards.
13jira
Manage Jira issues from the command line. Use when working with Jira issues, creating tasks, updating status, assigning work, linking issues, managing versions, setting or reading custom fields (Story Points, Sprint, Severity, etc.), or searching for issues.
12e2e-testing
E2E and visual regression testing with Playwright. Use when writing tests, running E2E tests, debugging test failures, or working with visual baselines. Contains test commands, patterns, and debugging tips.
10power-stack
Bun/Elysia/React/MUI monorepo stack blueprint. Use when scaffolding a new project, adding a new app or package to the monorepo, choosing dependencies, or making architectural decisions. Contains the full tech stack, conventions, and wiring patterns.
6commit-work
Commit all changes with the OpenSpec proposal title and ID as a git trailer. Use when the user says "commit this", "commit work", or wants to commit the current batch of changes with structured OpenSpec trailers. Auto-archives the change first if it has not been archived yet.
1start-work
Assign a Jira issue to yourself and convert it into an OpenSpec proposal. Use when the user says "start work", "pick up an issue", "take the next ticket", or provides a Jira key and wants to begin work on it. Handles issue selection from the backlog, assignment, transition to In Progress, and scaffolding an OpenSpec change with Jira context embedded in the proposal.
1