运行时依赖
安装命令
点击复制技能文档
conf命令行工具
命令行工具 for Confluence Cloud.
安装ation
检查 if conf命令行工具 is 安装ed:
command -v conf命令行工具
If not 安装ed, 安装 via:
curl -fsSL https://raw.githubusercontent.com/hochej/conf命令行工具/mAIn/安装.sh | sh
To 安装 a specific version or to a custom directory:
curl -fsSL https://raw.githubusercontent.com/hochej/conf命令行工具/mAIn/安装.sh | VERSION=0.2.3 sh curl -fsSL https://raw.githubusercontent.com/hochej/conf命令行工具/mAIn/安装.sh | 安装_DIR=~/.bin sh
Authentication
检查 auth 状态 first:
conf命令行工具 auth 状态
If not 认证d, ask the user to 配置 authentication. They can either:
运行 conf命令行工具 auth 记录in interactively in their own terminal, or 设置 环境 variables before 启动ing the 会话: CONFLUENCE_DOMAIN — e.g. yourcompany.atlassian.net CONFLUENCE_EMAIL CONFLUENCE_令牌 (or CONFLUENCE_API_令牌)
API 令牌s are 生成d at https://id.atlassian.com/manage-性能分析/security/API-令牌s
Never ask the user to paste a 令牌 into the conversation. 令牌s must be 设置 via 环境 variables or conf命令行工具 auth 记录in.
Page References
Pages can be referenced by:
ID: 12345 URL: https://company.atlassian.net/wiki/spaces/MFS/pages/12345/Title Space:Title: MFS:Overview 导入ant
Write operations (创建, 更新, 删除, 清理, edit, label 添加/移除, attachment 上传/删除, comment 添加/删除, copy-tree) require explicit user intent. Never perform these based on assumptions.
Use --dry-运行 to preview destructive operations without executing them.
Common Commands # Spaces conf命令行工具 space 列出 conf命令行工具 space 获取 MFS conf命令行工具 space pages MFS --tree conf命令行工具 space 创建 --key PROJ --name "Project" -o json --compact-json conf命令行工具 space 删除 MFS --yes
# Pages conf命令行工具 page 列出 --space MFS --title "Overview" conf命令行工具 page 获取 MFS:Overview # metadata (table) conf命令行工具 page 获取 MFS:Overview --show-body # include body in table 输出 conf命令行工具 page 获取 MFS:Overview -o json # full JSON conf命令行工具 page body MFS:Overview # markdown content conf命令行工具 page body MFS:Overview --格式化 storage conf命令行工具 page children MFS:Overview conf命令行工具 page children MFS:Overview --recursive conf命令行工具 page 历史 MFS:Overview conf命令行工具 page open MFS:Overview # open in browser conf命令行工具 page edit MFS:Overview # edit in $EDITOR
# 搜索 conf命令行工具 搜索 "查询" conf命令行工具 搜索 "type=page AND title ~ Template" conf命令行工具 搜索 "confluence" --space MFS
# Write conf命令行工具 page 创建 --space MFS --title "Title" --body "
content
" conf命令行工具 page 更新 MFS:Overview --body-file content.html conf命令行工具 page 删除 12345# Attachments conf命令行工具 attachment 列出 MFS:Overview conf命令行工具 attachment 上传 MFS:Overview ./file.png ./other.pdf conf命令行工具 attachment 下载 att12345 --dest file.png
# Labels conf命令行工具 label 添加 MFS:Overview tag1 tag2 tag3 conf命令行工具 label 移除 MFS:Overview tag1 tag2 conf命令行工具 label pages "tag"
# Comments conf命令行工具 comment 列出 MFS:Overview conf命令行工具 comment 添加 MFS:Overview --body "LGTM" conf命令行工具 comment 删除 123456
# 导出 conf命令行工具 导出 MFS:Overview --dest ./导出s --格式化 md
# Copy Tree conf命令行工具 copy-tree MFS:Overview MFS:Tar获取Parent
输出 格式化s
Use -o flag: json, table, md
conf命令行工具 space 列出 -o json conf命令行工具 page 获取 MFS:Overview -o json
Pagination
添加 --all to fetch all 结果s, -n to 设置 limit:
conf命令行工具 space 列出 --all conf命令行工具 搜索 "查询" --all -n 100