confluence-cli
Read and write Confluence pages from the shell — get/search pages, create, update, append, comment, label (tag), attach, move, delete — against a corporate…
от victorrentea★ 17 звёзд на GitHub
Установить confluence-cli в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Confluence from the shell, when MCP servers are disabled
confluence.py is a self-contained client for the Confluence REST API — the sibling
of jira-cli, same env-file mechanism, same --json convention,
same escape hatch. Python 3.8+, standard library only: no curl, no jq, no
pip install, identical on Windows (no WSL), macOS and Linux.
python3 .claude/skills/confluence-cli/confluence.py whoami # macOS / Linux (also runs as ./confluence.py)
python .claude/skills/confluence-cli/confluence.py whoami # Windows: python or py; `python3` there
# is often just the Microsoft Store stub
Below, $C is shorthand in the examples only - always type the full command
(python3 .claude/skills/confluence-cli/confluence.py spaces): the allowed-tools permissions
match that literal prefix, and a J=... variable does not word-split in zsh anyway.
1. One-time setup
The token lives in ~/.claude/confluence.env — outside every repo, so the same PAT is
reusable across all your projects and cannot be committed by accident:
install -m 600 /dev/null ~/.claude/confluence.env # Windows: %USERPROFILE%\.claude\confluence.env
cat > ~/.claude/confluence.env <<'EOF'
CONFLUENCE_URL=https://confluence.your-company.com
CONFLUENCE_PAT=<Settings -> Personal Access Tokens -> Create token>
EOF
confluence.env.example next to this file documents every variable (Cloud auth,
self-signed certs, default space). Lookup order — first file wins:
$CONFLUENCE_ENV_FILE -> ./.confluence.env -> ~/.claude/confluence.env -> ~/.confluence.env
Real environment variables win over the file.
Verify:
$C config # where creds came from, and which API is in play
$C whoami
2. Which REST API you are talking to
This is the one thing worth understanding before using the skill, because Confluence is mid-migration and the two products diverge:
| Data Center / Server | Cloud | |
|---|---|---|
| Page CRUD | v1 /rest/api/content — the only API there is |
v2 /wiki/api/v2/pages (default) |
| CQL search | v1 /rest/api/search |
v1 — v2 has no CQL endpoint at all |
| Label writes | v1 /rest/api/content/{id}/label |
v1 — v2 can read labels but not write them |
| Attachment upload | v1 /rest/api/content/{id}/child/attachment |
v1 — v2 has no upload endpoint |
| Auth | PAT, Authorization: Bearer |
API token, HTTP Basic |
So Cloud is inherently a v1/v2 hybrid, and that is not a shortcut in this script —
it is the state of the API. confluence.py picks the right one per command and
confluence.py config prints which. Override with CONFLUENCE_PAGE_API=v1 if you hit
a v2 gap; asking for v2 against Data Center fails fast rather than 404-ing mysteriously.
Atlassian has been withdrawing Cloud v1 endpoints group by group (the timeline has slipped repeatedly since 2024), which is why page CRUD defaults to v2 there. The v1 search API is explicitly not on the deprecation list.
3. Reading
Pages are addressed either by numeric id or by SPACE:Title, because humans know
titles and ids only ever show up in URLs.
$C spaces
$C get "DOCS:Release Notes" # title, version, space, parent, labels
$C get 123456 --body # ... plus the storage XHTML
$C body "DOCS:Release Notes" # just the body, for piping
$C children "DOCS:Release Notes"
$C search 'space = DOCS and label = "runbook"'
$C search 'text ~ "flyway"' -n 100 # auto-paginates; -n is a hard limit
$C comments 123456
$C labels 123456
$C versions 123456
Add --json to any command to get the raw API response instead of the text summary
(jq if installed; Git for Windows does not ship it):
$C --json get 123456 | jq -r '.labels[]'
The default text output exists because it is far cheaper in tokens than the raw JSON,
which for one page is routinely tens of KB of _links and _expandable you did not ask for.
4. Writing
Confluence stores XHTML ("storage format"), not markdown. Three ways in:
$C create -s DOCS -t "Runbook: DB restore" --text "Steps are below." # plain text, escaped into <p> for you
$C create -s DOCS -t "Notes" --wiki "h1. Heading
* bullet" # legacy wiki markup, converted server-side
$C create -s DOCS -t "Exact" -b '<p>raw <strong>storage</strong></p>' # passed through untouched
Use --text by default. Markdown is not a Confluence input format; passing it
gets you a page with literal ## in it.
$C update 123456 -t "New title" # version handled for you
$C update 123456 --text "replacement body" -m "why I changed it"
$C append 123456 "One more line" # read-modify-write, keeps the old body
git log -1 --format=%B | $C append 123456 -
$C comment 123456 "Deployed in d7c8f8c"
$C label add 123456 runbook needs-review # tag
$C label rm 123456 needs-review
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
Bash(.claude/skills/confluence-cli/confluence.py:*) - 02
Bash(python3 .claude/skills/confluence-cli/confluence.py:*) - 03
Bash(python .claude/skills/confluence-cli/confluence.py:*) - 04
Bash(py .claude/skills/confluence-cli/confluence.py:*) - 05
Bash(jq:*)
Вложенные файлы
- confluence.env.example
- confluence.py
FAQ
Что делает скилл confluence-cli?
Read and write Confluence pages from the shell — get/search pages, create, update, append, comment, label (tag), attach, move, delete — against a corporate Confluence Data Center/Server using a Personal Access Token (or Confluence Cloud with an API token). Use whenever a task needs Confluence AND no Confluence MCP tools are available (no mcp__atlassian__*, no mcp__confluence__*), which is the normal situation when corporate policy disables MCP servers. Also use when explicitly asked to "use the confluence-cli skill".
Как установить скилл confluence-cli?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл confluence-cli запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…