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
- Common subcommands (covering everyday scenarios)
spacelist [--start --limit --expand]get --space-key [--expand]
pageget --page-id [--body-format --expand --fresh]by-title --space-key --title [--body-format --expand]children --page-id [--start --limit --expand]rename --page-id --titlepublish-markdown --parent-id --title --markdown-path [--update-if-exists --body-format --expand]
attachmentlist --page-id [--start --limit --expand]download --page-id [--output-dir --name --filter --all --start --limit --expand]
search--cql [--start --limit --body-format --expand]
- Output format
- All invocations uniformly add
--jsonafter the script and before the subcommand (example:./scripts/confluence_cli.py --json page get --page-id ...)
- How to look up uncommon parameters/fields
- Run
./scripts/confluence_cli.py <command> --helpto view the parameters of that command - When deeper Confluence API fields are needed, you can extend the
expandparameter in the script
- Notes
page getBy default, keep normal cached reads; when you need to verify the body text right after updating a page, use--freshto 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
- 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
- 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 celltext-alignstyle 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 is800, which can be overridden with--image-max-width/--image-max-height; only write theac:widthorac: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:
、、。
Resources
- confluence_cli.py: main CLI entry point, responsible for reading configuration and initiating API calls.
- confluence_api_client.py: SDK wrapper layer, which consolidates common API calls.