KosmoKrator

productivity

Confluence CLI for AI Agents

Use the Confluence CLI from KosmoKrator to call Confluence tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

Confluence CLI Setup

Confluence can be configured headlessly with `kosmokrator integrations:configure confluence`.

Install, configure, and verify
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure confluence --set api_token="$CONFLUENCE_API_TOKEN" --set base_url="$CONFLUENCE_BASE_URL" --enable --read allow --write ask --json
kosmokrator integrations:doctor confluence --json
kosmokrator integrations:status --json

Credentials

Authentication type: API token api_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
api_token CONFLUENCE_API_TOKEN Secret secret yes Personal Access Token
base_url CONFLUENCE_BASE_URL Text text yes Confluence API Base URL

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call confluence.confluence_create_page '{"space_key":"example_space_key","title":"example_title","body":"example_body","parent_id":"example_parent_id","type":"example_type"}' --json
Provider shortcut
kosmo integrations:confluence confluence_create_page '{"space_key":"example_space_key","title":"example_title","body":"example_body","parent_id":"example_parent_id","type":"example_type"}' --json

Discovery

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

Discovery commands
kosmo integrations:docs confluence --json
kosmo integrations:docs confluence.confluence_create_page --json
kosmo integrations:schema confluence.confluence_create_page --json
kosmo integrations:search "Confluence" --json
kosmo integrations:list --json

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

confluence.confluence_create_page

Create a new page in a Confluence space. Requires space_key, title, and body (HTML). Optionally specify a parent page ID.

Write write
Parameters
space_key, title, body, parent_id, type
Generic call
kosmo integrations:call confluence.confluence_create_page '{"space_key":"example_space_key","title":"example_title","body":"example_body","parent_id":"example_parent_id","type":"example_type"}' --json
Shortcut
kosmo integrations:confluence confluence_create_page '{"space_key":"example_space_key","title":"example_title","body":"example_body","parent_id":"example_parent_id","type":"example_type"}' --json

confluence.confluence_get_page

Get details for a specific Confluence page by ID. Returns title, body, version, space, and other metadata.

Read read
Parameters
page_id, expand
Generic call
kosmo integrations:call confluence.confluence_get_page '{"page_id":"example_page_id","expand":"example_expand"}' --json
Shortcut
kosmo integrations:confluence confluence_get_page '{"page_id":"example_page_id","expand":"example_expand"}' --json

confluence.confluence_update_page

Update an existing Confluence page. Requires page_id, title, body, and the new version number (current version + 1).

Write write
Parameters
page_id, title, body, version, status
Generic call
kosmo integrations:call confluence.confluence_update_page '{"page_id":"example_page_id","title":"example_title","body":"example_body","version":1,"status":"example_status"}' --json
Shortcut
kosmo integrations:confluence confluence_update_page '{"page_id":"example_page_id","title":"example_title","body":"example_body","version":1,"status":"example_status"}' --json

confluence.confluence_delete_page

Delete a Confluence page by its ID. This action moves the page to the trash.

Write write
Parameters
page_id
Generic call
kosmo integrations:call confluence.confluence_delete_page '{"page_id":"example_page_id"}' --json
Shortcut
kosmo integrations:confluence confluence_delete_page '{"page_id":"example_page_id"}' --json

confluence.confluence_search_pages

Search for Confluence content using CQL (Confluence Query Language). Examples: 'title = "My Page"', 'space = "DEV" and type = "page"'.

Read read
Parameters
cql, limit, start, expand
Generic call
kosmo integrations:call confluence.confluence_search_pages '{"cql":"example_cql","limit":1,"start":1,"expand":"example_expand"}' --json
Shortcut
kosmo integrations:confluence confluence_search_pages '{"cql":"example_cql","limit":1,"start":1,"expand":"example_expand"}' --json

confluence.confluence_get_page_ancestors

Get the ancestor (parent) pages of a Confluence page by its ID. Returns the full ancestor hierarchy.

Read read
Parameters
page_id
Generic call
kosmo integrations:call confluence.confluence_get_page_ancestors '{"page_id":"example_page_id"}' --json
Shortcut
kosmo integrations:confluence confluence_get_page_ancestors '{"page_id":"example_page_id"}' --json

confluence.confluence_get_page_children

Get the child pages of a Confluence page by its ID. Supports pagination and property expansion.

Read read
Parameters
page_id, limit, start, expand
Generic call
kosmo integrations:call confluence.confluence_get_page_children '{"page_id":"example_page_id","limit":1,"start":1,"expand":"example_expand"}' --json
Shortcut
kosmo integrations:confluence confluence_get_page_children '{"page_id":"example_page_id","limit":1,"start":1,"expand":"example_expand"}' --json

confluence.confluence_add_comment

Add a comment to a Confluence page. Requires the page ID and comment body in HTML.

Write write
Parameters
page_id, body
Generic call
kosmo integrations:call confluence.confluence_add_comment '{"page_id":"example_page_id","body":"example_body"}' --json
Shortcut
kosmo integrations:confluence confluence_add_comment '{"page_id":"example_page_id","body":"example_body"}' --json

confluence.confluence_get_spaces

List Confluence spaces accessible to the authenticated user. Supports pagination and filtering by type and status.

Read read
Parameters
limit, start, type, status
Generic call
kosmo integrations:call confluence.confluence_get_spaces '{"limit":1,"start":1,"type":"example_type","status":"example_status"}' --json
Shortcut
kosmo integrations:confluence confluence_get_spaces '{"limit":1,"start":1,"type":"example_type","status":"example_status"}' --json

confluence.confluence_get_space

Get details for a specific Confluence space by its key.

Read read
Parameters
space_key
Generic call
kosmo integrations:call confluence.confluence_get_space '{"space_key":"example_space_key"}' --json
Shortcut
kosmo integrations:confluence confluence_get_space '{"space_key":"example_space_key"}' --json

confluence.confluence_get_labels

Get the labels attached to a Confluence page by its ID.

Read read
Parameters
page_id
Generic call
kosmo integrations:call confluence.confluence_get_labels '{"page_id":"example_page_id"}' --json
Shortcut
kosmo integrations:confluence confluence_get_labels '{"page_id":"example_page_id"}' --json

confluence.confluence_add_labels

Add one or more labels to a Confluence page. Labels are provided as an array of name strings.

Write write
Parameters
page_id, labels
Generic call
kosmo integrations:call confluence.confluence_add_labels '{"page_id":"example_page_id","labels":"example_labels"}' --json
Shortcut
kosmo integrations:confluence confluence_add_labels '{"page_id":"example_page_id","labels":"example_labels"}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

confluence.confluence_create_page 5 parameters
Schema command
kosmo integrations:schema confluence.confluence_create_page --json
ParameterTypeRequiredDescription
space_key string yes The space key (e.g. "DEV").
title string yes The title of the page.
body string yes The page body in Confluence storage format (HTML). Example: "<p>Hello world</p>".
parent_id string no Optional parent page ID to nest the new page under.
type string no Content type. Default: "page".
confluence.confluence_get_page 2 parameters
Schema command
kosmo integrations:schema confluence.confluence_get_page --json
ParameterTypeRequiredDescription
page_id string yes The content ID of the page.
expand string no Comma-separated list of properties to expand. Example: "body.storage,version,space,ancestors".
confluence.confluence_update_page 5 parameters
Schema command
kosmo integrations:schema confluence.confluence_update_page --json
ParameterTypeRequiredDescription
page_id string yes The content ID of the page to update.
title string yes The updated title of the page.
body string yes The updated page body in Confluence storage format (HTML).
version integer yes The new version number (must be current version + 1).
status string no Optional status. Example: "current" or "draft".
confluence.confluence_delete_page 1 parameters
Schema command
kosmo integrations:schema confluence.confluence_delete_page --json
ParameterTypeRequiredDescription
page_id string yes The content ID of the page to delete.
confluence.confluence_search_pages 4 parameters
Schema command
kosmo integrations:schema confluence.confluence_search_pages --json
ParameterTypeRequiredDescription
cql string yes CQL query string. Example: 'title = "My Page"' or 'space = "DEV" and type = "page"'.
limit integer no Maximum number of results per page. Default: 25.
start integer no Start offset for pagination. Default: 0.
expand string no Comma-separated list of properties to expand. Example: "body.storage,version,space".
confluence.confluence_get_page_ancestors 1 parameters
Schema command
kosmo integrations:schema confluence.confluence_get_page_ancestors --json
ParameterTypeRequiredDescription
page_id string yes The content ID of the page.
confluence.confluence_get_page_children 4 parameters
Schema command
kosmo integrations:schema confluence.confluence_get_page_children --json
ParameterTypeRequiredDescription
page_id string yes The content ID of the parent page.
limit integer no Maximum number of results per page. Default: 25.
start integer no Start offset for pagination. Default: 0.
expand string no Comma-separated list of properties to expand. Example: "body.storage,version,space".
confluence.confluence_add_comment 2 parameters
Schema command
kosmo integrations:schema confluence.confluence_add_comment --json
ParameterTypeRequiredDescription
page_id string yes The content ID of the page to comment on.
body string yes The comment body in Confluence storage format (HTML). Example: "<p>Great article!</p>".
confluence.confluence_get_spaces 4 parameters
Schema command
kosmo integrations:schema confluence.confluence_get_spaces --json
ParameterTypeRequiredDescription
limit integer no Maximum number of results per page. Default: 25.
start integer no Start offset for pagination. Default: 0.
type string no Space type filter. Example: "global" or "personal".
status string no Space status filter. Example: "current" or "archived".
confluence.confluence_get_space 1 parameters
Schema command
kosmo integrations:schema confluence.confluence_get_space --json
ParameterTypeRequiredDescription
space_key string yes The space key (e.g. "DEV").
confluence.confluence_get_labels 1 parameters
Schema command
kosmo integrations:schema confluence.confluence_get_labels --json
ParameterTypeRequiredDescription
page_id string yes The content ID of the page.
confluence.confluence_add_labels 2 parameters
Schema command
kosmo integrations:schema confluence.confluence_add_labels --json
ParameterTypeRequiredDescription
page_id string yes The content ID of the page.
labels array yes Array of label name strings to add. Example: ["documentation", "api"].

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.