SuperAPI AI Directory

confluence-cli

General & other

View repository

Updated 10-15 20:34

About this skill

Note: All invocation methods below use the folder containing the current SKILL.md file as the workdir.

Script invocation method (must be executed directly, do not use uv run python or python):

cd skills/confluence-cli && ./scripts/confluence_cli.py --json page get --page-id 3060336952

Incorrect example:

uv run python skills/confluence-cli/scripts/confluence_cli.py --json page get --page-id 3060336952
python skills/confluence-cli/scripts/confluence_cli.py --json page get --page-id 3060336952
  1. Common subcommands (covering everyday scenarios)
  • space
    • list [--start --limit --expand]
    • get --space-key [--expand]
  • page
    • get --page-id [--body-format --expand --fresh]
    • by-title --space-key --title [--body-format --expand]
    • children --page-id [--start --limit --expand]
    • rename --page-id --title
    • publish-markdown --parent-id --title --markdown-path [--update-if-exists --body-format --expand]
  • attachment
    • list --page-id [--start --limit --expand]
    • download --page-id [--output-dir --name --filter --all --start --limit --expand]
  • search
    • --cql [--start --limit --body-format --expand]
  1. Output format
  • All invocations uniformly add --jsonafter the script and before the subcommand (example:./scripts/confluence_cli.py --json page get --page-id ...)
  1. How to look up uncommon parameters/fields
  • Run ./scripts/confluence_cli.py <command> --help to view the parameters of that command
  • When deeper Confluence API fields are needed, you can extend the expand parameter in the script
  1. Notes
  • page get By default, keep normal cached reads; when you need to verify the body text right after updating a page, use --fresh to bypass the Confluence or proxy cache, for example:./scripts/confluence_cli.py --json page get --page-id ... --body-format storage --expand body.storage,version --fresh
  1. Attachment download examples
  • Download specified attachments (can be passed repeatedly --name):./scripts/confluence_cli.py attachment download --page-id 3060336952 --output-dir ./attachments --name a.png --name b.png
  • Download all attachments (automatic pagination):./scripts/confluence_cli.py attachment download --page-id 3060336952 --all --output-dir ./attachments
  • Filtered download (regex):./scripts/confluence_cli.py attachment download --page-id 3060336952 --filter 'image2026-1-19_.*\\.png' --all --output-dir ./attachments
  1. Publish Markdown examples
  • Publish to a parent page (update if the same name exists):./scripts/confluence_cli.py --json page publish-markdown --parent-id 3061931928 --title "批量重置 Offset 功能测试" --markdown-path /path/to/doc.md
  • Markdown tables support :---、:---:、---: such as left-aligned, centered, and right-aligned syntax, which will be converted to the table cell text-align style in Confluence storage.
  • When publishing local images, a single Confluence size attribute is automatically generated based on the maximum display frame: the default maximum width is 1000, maximum height is 800, which can be overridden with --image-max-width / --image-max-height ; only write the ac:width or ac:heightthat triggers scaling, and the original attachment image is not modified.
  • If you need to override the display size of a single image, you can use the Markdown title:![图](./a.png "confluence-width=1200")、![图](./a.png "confluence-height=600")、![图](./a.png "confluence-size=original")。

Resources