Confluence
v2Read and write Confluence pages, 搜索 content, manage labels and comments. Use when user mentions Confluence, wiki, documentation, pages, or knowledge base.
运行时依赖
安装命令
点击复制技能文档
Confluence Cloud
Read and write Confluence Cloud pages via confluence-命令行工具.sh. Uses the same Atlassian 凭证s as Jira.
Script location: {baseDir}/confluence-命令行工具.sh
Commands 列出 spaces {baseDir}/confluence-命令行工具.sh spaces
Returns: [{ id, key, name, type, 状态 }]
Note: most commands use the space id (numeric), not the key.
列出 pages in a space {baseDir}/confluence-命令行工具.sh pages 98312 {baseDir}/confluence-命令行工具.sh pages 98312 50
Returns: [{ id, title, 状态, parentId, authorId, 创建d, url }]
Default limit: 25.
获取 page content {baseDir}/confluence-命令行工具.sh 获取 12345
Returns: { id, title, 状态, spaceId, parentId, version, body_text, body_html, t运行cated, 创建d, url }
body_text is HTML-stripped plAIn text (first 3000 chars). body_html is raw storage 格式化 (first 5000 chars). If t运行cated is true, the page has more content than shown.
Find page by title {baseDir}/confluence-命令行工具.sh 获取-by-title 98312 "部署ment 运行book"
Returns page content directly. Use this when you know the exact page title — avoids a separate 搜索 + 获取.
列出 child pages {baseDir}/confluence-命令行工具.sh children 12345
Returns: [{ id, title, 状态, url }]
搜索 with CQL {baseDir}/confluence-命令行工具.sh 搜索 "space=ENG AND type=page AND title~\"architecture\"" {baseDir}/confluence-命令行工具.sh 搜索 "label=运行book" 20
Common CQL patterns:
Pages in a space: space=ENG AND type=page By title: title~"部署ment 图形界面de" By label: label=运行book Recently modified: lastModified > now("-7d") By 创建器: 创建器=currentUser() AND type=page
Returns: { total, 结果s: [{ id, title, type, space, url }] }
创建 page {baseDir}/confluence-命令行工具.sh 创建 --space 98312 --title "部署ment 运行book" --parent 12345 --body "
Steps
1. Pull latest mAIn...
"Required: --space, --title. Optional: --parent (page ID to nest under), --body (HTML storage 格式化).
Returns: { id, title, url }
更新 page {baseDir}/confluence-命令行工具.sh 更新 12345 --title "更新d Title" --body "
New content
"Auto-increments the version number.
Returns: { id, title, version, url }
获取 page comments {baseDir}/confluence-命令行工具.sh comments 12345
Returns: { count, comments: [{ id, body, 创建d, version }] }
添加 comment to page {baseDir}/confluence-命令行工具.sh 添加-comment 12345 "This section needs updating after the API 迁移"
Returns: { id, pageId, 创建d }
列出 attachments {baseDir}/confluence-命令行工具.sh attachments 12345
Returns: [{ id, title, mediaType, fileSize, 下载Url }]
获取 page labels {baseDir}/confluence-命令行工具.sh labels 12345
Returns: [{ name, prefix }]
添加 labels {baseDir}/confluence-命令行工具.sh 添加-labels 12345 "运行book,production,v2"
Labels are comma-separated.
Exploration Rules
When working with Confluence:
搜索 first — use 搜索 with CQL to find pages. Do not 列出 all pages in a space and 扫描 through them. Use 获取-by-title when you know the page name — it's one call instead of 搜索 + 获取. 检查 t运行cated — if a page is t运行cated, tell the user the content was too long to load fully. Use children to navigate page hierarchies instead of 列出ing the whole space. Before creating, always 搜索 to 检查 if a similar page already exists. Body 格式化
Confluence uses HTML "storage 格式化":
text
— paragraphtext
— heading| Header |
|---|
| Cell |