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.

12 functions 7 read 5 write API token auth

Confluence CLI Setup

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

# 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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

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

Call Confluence Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

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

Use the provider shortcut form for shorter human-facing commands.

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

Agent Discovery Commands

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

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

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Confluence.

confluence.confluence_create_page

Write write

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

Parameters
space_key, title, body, parent_id, type

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

confluence.confluence_get_page

Read read

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

Parameters
page_id, expand

Generic CLI call

kosmo integrations:call confluence.confluence_get_page '{"page_id":"example_page_id","expand":"example_expand"}' --json

Provider shortcut

kosmo integrations:confluence confluence_get_page '{"page_id":"example_page_id","expand":"example_expand"}' --json

confluence.confluence_update_page

Write write

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

Parameters
page_id, title, body, version, status

Generic CLI 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

Provider 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

Write write

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

Parameters
page_id

Generic CLI call

kosmo integrations:call confluence.confluence_delete_page '{"page_id":"example_page_id"}' --json

Provider shortcut

kosmo integrations:confluence confluence_delete_page '{"page_id":"example_page_id"}' --json

confluence.confluence_search_pages

Read read

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

Parameters
cql, limit, start, expand

Generic CLI call

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

Provider shortcut

kosmo integrations:confluence confluence_search_pages '{"cql":"example_cql","limit":1,"start":1,"expand":"example_expand"}' --json

confluence.confluence_get_page_ancestors

Read read

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

Parameters
page_id

Generic CLI call

kosmo integrations:call confluence.confluence_get_page_ancestors '{"page_id":"example_page_id"}' --json

Provider shortcut

kosmo integrations:confluence confluence_get_page_ancestors '{"page_id":"example_page_id"}' --json

confluence.confluence_get_page_children

Read read

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

Parameters
page_id, limit, start, expand

Generic CLI call

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

Provider 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

Write write

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

Parameters
page_id, body

Generic CLI call

kosmo integrations:call confluence.confluence_add_comment '{"page_id":"example_page_id","body":"example_body"}' --json

Provider shortcut

kosmo integrations:confluence confluence_add_comment '{"page_id":"example_page_id","body":"example_body"}' --json

confluence.confluence_get_spaces

Read read

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

Parameters
limit, start, type, status

Generic CLI call

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

Provider shortcut

kosmo integrations:confluence confluence_get_spaces '{"limit":1,"start":1,"type":"example_type","status":"example_status"}' --json

confluence.confluence_get_space

Read read

Get details for a specific Confluence space by its key.

Parameters
space_key

Generic CLI call

kosmo integrations:call confluence.confluence_get_space '{"space_key":"example_space_key"}' --json

Provider shortcut

kosmo integrations:confluence confluence_get_space '{"space_key":"example_space_key"}' --json

confluence.confluence_get_labels

Read read

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

Parameters
page_id

Generic CLI call

kosmo integrations:call confluence.confluence_get_labels '{"page_id":"example_page_id"}' --json

Provider shortcut

kosmo integrations:confluence confluence_get_labels '{"page_id":"example_page_id"}' --json

confluence.confluence_add_labels

Write write

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

Parameters
page_id, labels

Generic CLI call

kosmo integrations:call confluence.confluence_add_labels '{"page_id":"example_page_id","labels":"example_labels"}' --json

Provider 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

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

Operation
Write write
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

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

Operation
Read read
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

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

Operation
Write write
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

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

Operation
Write write
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

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

Operation
Read read
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

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

Operation
Read read
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

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

Operation
Read read
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

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

Operation
Write write
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

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

Operation
Read read
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

Get details for a specific Confluence space by its key.

Operation
Read read
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

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

Operation
Read read
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

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

Operation
Write write
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.