confluence
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseConfluence with orbit CLI
借助orbit CLI管理Confluence
Manage Confluence pages, publish markdown documentation, and control page layout using the CLI. Supports Confluence Cloud and Server/Data Center via REST API with multi-profile support and 1Password secret resolution.
orbit使用 CLI管理Confluence页面、发布Markdown文档并控制页面布局。通过REST API支持Confluence Cloud与Server/Data Center,具备多配置文件支持和1Password密钥解析功能。
orbitPrerequisites
前置条件
- binary built and accessible
orbit - A profile with a or
confluence-cloudservice configured inconfluence-server~/.config/orbit/config.yaml - Valid credentials (API token for Cloud, PAT for Server) — can be stored in 1Password with prefix
op:// - For Cloud: auth type is with email as username and API token as password
basic
- 已构建并可访问二进制文件
orbit - 在中配置了带有
~/.config/orbit/config.yaml或confluence-cloud服务的配置文件confluence-server - 有效的凭据(Cloud使用API令牌,Server使用PAT)——可通过前缀存储在1Password中
op:// - 对于Cloud:认证类型为,用户名是邮箱,密码是API令牌
basic
Quick Reference
快速参考
All commands follow the pattern:
orbit -p <profile> confluence <command> [flags]For full command details and flags, see .
For Confluence storage format (XHTML) details, see .
references/commands.mdreferences/storage-format.md所有命令遵循以下格式:
orbit -p <profile> confluence <command> [flags]完整命令详情和参数请查看。
Confluence存储格式(XHTML)详情请查看。
references/commands.mdreferences/storage-format.mdCore Workflows
核心工作流
Viewing Pages
查看页面
bash
undefinedbash
undefinedView page details
查看页面详情
orbit -p myprofile confluence page 473676972036
orbit -p myprofile confluence page 473676972036
View as JSON (includes body content)
以JSON格式查看(包含正文内容)
orbit -p myprofile confluence page 473676972036 -o json
orbit -p myprofile confluence page 473676972036 -o json
List child pages
列出子页面
orbit -p myprofile confluence children 473676972036
undefinedorbit -p myprofile confluence children 473676972036
undefinedCreating Pages from Markdown
从Markdown创建页面
When creating a page from a markdown file, the CLI automatically converts it to Confluence storage format (XHTML). The converter handles headings, lists, tables, code blocks, blockquotes, inline formatting, and images.
bash
undefined从Markdown文件创建页面时,CLI会自动将其转换为Confluence存储格式(XHTML)。转换器支持标题、列表、表格、代码块、块引用、内联格式和图片。
bash
undefinedCreate page from markdown file
从Markdown文件创建页面
orbit -p myprofile confluence create --space FO --parent 473677299713
--title "My New Page" --file docs/overview.md
--title "My New Page" --file docs/overview.md
orbit -p myprofile confluence create --space FO --parent 473677299713
--title "My New Page" --file docs/overview.md
--title "My New Page" --file docs/overview.md
Create page with inline body (storage format XHTML)
使用内联正文(存储格式为XHTML)创建页面
orbit -p myprofile confluence create --space FO --parent 473677299713
--title "Quick Page" --body "<p>Hello world</p>"
--title "Quick Page" --body "<p>Hello world</p>"
Pages are automatically created with **wide width** (full-width layout).orbit -p myprofile confluence create --space FO --parent 473677299713
--title "Quick Page" --body "<p>Hello world</p>"
--title "Quick Page" --body "<p>Hello world</p>"
创建的页面会自动设置为**宽屏**(全宽布局)。Updating Existing Pages
更新现有页面
IMPORTANT — Title updates require : The command only updates the page body by default. If the frontmatter has changed, you must pass explicitly — otherwise the Confluence page title stays unchanged. The command handles this automatically (reads title from frontmatter), but single-file does not.
--titleupdatetitle:--titlepublishupdatebash
undefined重要提示——更新标题需添加参数: 默认情况下,命令仅更新页面正文。如果前置元数据中的已更改,必须显式传递参数——否则Confluence页面标题将保持不变。命令会自动处理此问题(从前置元数据读取标题),但单文件命令不会。
--titleupdatetitle:--titlepublishupdatebash
undefinedUpdate page content only (title unchanged)
仅更新页面内容(标题不变)
orbit -p myprofile confluence update 473676972036 --file docs/overview.md
orbit -p myprofile confluence update 473676972036 --file docs/overview.md
Update title AND content — ALWAYS do this when title has changed
更新标题和内容——标题更改时务必执行此操作
orbit -p myprofile confluence update 473676972036
--title "Updated Title" --file docs/overview.md
--title "Updated Title" --file docs/overview.md
orbit -p myprofile confluence update 473676972036
--title "Updated Title" --file docs/overview.md
--title "Updated Title" --file docs/overview.md
Update with inline storage format
使用内联存储格式更新
orbit -p myprofile confluence update 473676972036 --body "<p>New content</p>"
**When updating a single page from a markdown file:**
1. Read the frontmatter `title:` field from the file
2. Always pass `--title "<title>"` along with `--file` to ensure the Confluence page title stays in sync
3. This avoids stale titles on Confluence while the body content is updatedorbit -p myprofile confluence update 473676972036 --body "<p>New content</p>"
**从单个Markdown文件更新页面时:**
1. 从文件中读取前置元数据的`title:`字段
2. 务必同时传递`--title "<title>"`和`--file`参数,确保Confluence页面标题保持同步
3. 避免Confluence上的标题过时,而正文内容已更新Publishing a Directory of Markdown Files
发布Markdown文件目录
The command recursively converts an entire directory of markdown files to Confluence pages, preserving the folder hierarchy:
publish- files become the parent page for their directory
INDEX.md - Other files become child pages under the directory's parent
.md - Subdirectories are processed recursively
- Page titles come from frontmatter , first
title:, or filename# heading - Files with are skipped; if previously published, the Confluence page is deleted. When an
confluence_ignore: trueis ignored, the entire subdirectory is skipped.INDEX.md - Upsert behavior: If a page has no in frontmatter, orbit searches by title first. If create fails due to a title conflict (e.g. special characters like
confluence_page_idin the title), it falls back to listing the parent's children and updating the matching page. After success,&is written to frontmatter for future runs.confluence_page_id - All pages are set to full-width layout on every create and update.
bash
undefinedpublish- 文件成为其所在目录的父页面
INDEX.md - 其他文件成为该目录父页面的子页面
.md - 子目录会被递归处理
- 页面标题来自前置元数据的、第一个
title:或文件名# 标题 - 带有的文件会被跳过;如果之前已发布,对应的Confluence页面会被删除。若
confluence_ignore: true被忽略,整个子目录都会被跳过。INDEX.md - 更新插入(Upsert)行为:如果页面前置元数据中没有,orbit会先按标题搜索。如果因标题冲突(例如标题中包含
confluence_page_id等特殊字符)导致创建失败,会回退到列出父页面的子页面并更新匹配的页面。操作成功后,&会写入前置元数据,供后续运行使用。confluence_page_id - 所有页面在创建和更新时都会设置为全宽布局。
bash
undefinedPublish entire docs directory
发布整个docs目录
orbit -p myprofile confluence publish ./docs --space FO --parent 473677299713
orbit -p myprofile confluence publish ./docs --space FO --parent 473677299713
Preview what would be created (no API calls)
预览即将创建的内容(不调用API)
orbit -p myprofile confluence publish ./docs --space FO --parent 473677299713 --dry-run
undefinedorbit -p myprofile confluence publish ./docs --space FO --parent 473677299713 --dry-run
undefinedSetting Page Width
设置页面宽度
bash
undefinedbash
undefinedSet single page to wide
将单个页面设置为宽屏
orbit -p myprofile confluence set-width 473676972036
orbit -p myprofile confluence set-width 473676972036
Set page and all children to wide
将页面及其所有子页面设置为宽屏
orbit -p myprofile confluence set-width 473676972036 --recursive
orbit -p myprofile confluence set-width 473676972036 --recursive
Set to fixed width
设置为固定宽度
orbit -p myprofile confluence set-width 473676972036 --width fixed
undefinedorbit -p myprofile confluence set-width 473676972036 --width fixed
undefinedMarkdown Frontmatter Tracking
Markdown前置元数据跟踪
When publishing or converting markdown files for Confluence, track the mapping between local files and Confluence pages using YAML frontmatter. After creating or updating a page, update the source markdown file's frontmatter with:
yaml
---
title: "My Page Title"
confluence_ignore: false
confluence_page_id: "473676972036"
confluence_url: "https://mysite.atlassian.net/wiki/spaces/FO/pages/473676972036/My+Page+Title"
---This enables:
- Re-running updates without needing to look up page IDs
- Tracking which files have been published
- Building scripts that sync local changes to Confluence
- Excluding files from Confluence with (deletes previously published pages)
confluence_ignore: true
When the user asks to publish or sync markdown files to Confluence:
- Run the orbit command to create/update the page
- Capture the page ID and URL from the output
- Update the markdown file's frontmatter with and
confluence_page_idconfluence_url - If the frontmatter doesn't exist, add it at the top of the file
Example workflow for syncing a file:
bash
undefined发布或转换Markdown文件用于Confluence时,可使用YAML前置元数据跟踪本地文件与Confluence页面的映射关系。创建或更新页面后,在源Markdown文件的前置元数据中添加以下内容:
yaml
---
title: "My Page Title"
confluence_ignore: false
confluence_page_id: "473676972036"
confluence_url: "https://mysite.atlassian.net/wiki/spaces/FO/pages/473676972036/My+Page+Title"
---这实现了:
- 无需查找页面ID即可重新运行更新
- 跟踪哪些文件已发布
- 构建将本地更改同步到Confluence的脚本
- 通过排除文件(删除之前已发布的页面)
confluence_ignore: true
当用户要求将Markdown文件发布或同步到Confluence时:
- 运行orbit命令创建/更新页面
- 从输出中捕获页面ID和URL
- 在Markdown文件的前置元数据中更新和
confluence_page_idconfluence_url - 如果前置元数据不存在,在文件顶部添加
同步文件的示例工作流:
bash
undefinedIf confluence_page_id exists in frontmatter, update (always include --title):
如果前置元数据中存在confluence_page_id,执行更新(务必包含--title):
orbit -p myprofile confluence update 473676972036
--title "Overview" --file docs/overview.md
--title "Overview" --file docs/overview.md
orbit -p myprofile confluence update 473676972036
--title "Overview" --file docs/overview.md
--title "Overview" --file docs/overview.md
If no confluence_page_id, create new:
如果没有confluence_page_id,创建新页面:
orbit -p myprofile confluence create --space FO --parent 473677299713
--title "Overview" --file docs/overview.md
--title "Overview" --file docs/overview.md
orbit -p myprofile confluence create --space FO --parent 473677299713
--title "Overview" --file docs/overview.md
--title "Overview" --file docs/overview.md
Then update the frontmatter with the returned page ID and URL
然后在前置元数据中添加返回的页面ID和URL
undefinedundefinedPage Properties & Labels
页面属性与标签
The command supports Confluence Page Properties macros and labels via frontmatter, enabling dynamic Page Properties Report tables (like the ISMS Policies page pattern).
publishpublishLabels (Tags)
标签(Tags)
Add to frontmatter to tag pages. Labels are applied after each page is created or updated during .
confluence_labelspublishyaml
---
title: "My Policy"
confluence_labels:
- ai-process
- foundation
---在前置元数据中添加可为页面添加标签。标签会在过程中,页面创建或更新后应用。
confluence_labelspublishyaml
---
title: "My Policy"
confluence_labels:
- ai-process
- foundation
---Page Properties (details macro)
页面属性(详情宏)
Add to frontmatter to generate a Confluence Page Properties macro at the top of the page. This creates a structured metadata block that can be queried by Page Properties Report macros on other pages.
confluence_propertiesyaml
---
title: "Compounding Engineering & System Evolution"
confluence_properties:
id: status
fields:
Owner: AI Tooling Guild
Classification: Internal
Status: "{status:Green|approved}"
Reviewed on: 2026-03-06
Approved on: 2026-03-06
---- -- sets the macro ID (used by
idreports to target specific property blocks)detailssummary - -- ordered key-value pairs rendered as a two-column table inside the macro
fields - Values matching are converted to status badge macros
{status:Color|Text} - Values matching are converted to Confluence
YYYY-MM-DDdate macros<time> - Other values are rendered as plain text
在前置元数据中添加可在页面顶部生成Confluence页面属性宏。这会创建一个结构化元数据块,可被其他页面的页面属性报告宏查询。
confluence_propertiesyaml
---
title: "Compounding Engineering & System Evolution"
confluence_properties:
id: status
fields:
Owner: AI Tooling Guild
Classification: Internal
Status: "{status:Green|approved}"
Reviewed on: 2026-03-06
Approved on: 2026-03-06
---- -- 设置宏ID(供
id报告用于定位特定属性块)detailssummary - -- 有序的键值对,在宏内呈现为两列表格
fields - 匹配的值会转换为状态徽章宏
{status:Color|Text} - 匹配的值会转换为Confluence
YYYY-MM-DD日期宏<time> - 其他值会呈现为纯文本
Page Properties Report (detailssummary macro)
页面属性报告(详情摘要宏)
Add a directive in your markdown to generate a dynamic table that pulls Page Properties from labeled pages. Two formats are supported:
HTML comment format (full control):
markdown
<!-- confluence:properties-report cql="label = 'ai-process' and space = currentSpace()" firstcolumn="Document" headings="Status, Classification, Reviewed on" -->Shorthand format:
markdown
{properties-report: label="ai-process", columns="Status, Classification, Reviewed on"}Parameters:
- -- CQL query to find pages (e.g.,
cql)label = "policy" and space = currentSpace() - -- shorthand for CQL: generates
labellabel = "value" and space = currentSpace() - -- name of the first column (defaults to "Title")
firstcolumn - /
columns-- comma-separated list of property names to show as columnsheadings - -- optional column to sort by
sortBy
在Markdown中添加指令可生成动态表格,从带标签的页面中提取页面属性。支持两种格式:
HTML注释格式(完全控制):
markdown
<!-- confluence:properties-report cql="label = 'ai-process' and space = currentSpace()" firstcolumn="Document" headings="Status, Classification, Reviewed on" -->简写格式:
markdown
{properties-report: label="ai-process", columns="Status, Classification, Reviewed on"}参数:
- -- 用于查找页面的CQL查询(例如
cql)label = "policy" and space = currentSpace() - -- CQL的简写:生成
labellabel = "value" and space = currentSpace() - -- 第一列的名称(默认为“Title”)
firstcolumn - /
columns-- 作为列显示的属性名称的逗号分隔列表headings - -- 可选的排序列
sortBy
Complete Example
完整示例
Child page (e.g., ):
overview.mdyaml
---
title: Overview & Philosophy
confluence_labels:
- ai-process
confluence_properties:
id: status
fields:
Owner: AI Tooling Guild
Classification: Internal
Status: "{status:Green|approved}"
Reviewed on: 2026-03-06
---Index page (e.g., ):
INDEX.mdmarkdown
---
title: AI Development Process
confluence_labels:
- ai-process
---子页面(如):
overview.mdyaml
---
title: Overview & Philosophy
confluence_labels:
- ai-process
confluence_properties:
id: status
fields:
Owner: AI Tooling Guild
Classification: Internal
Status: "{status:Green|approved}"
Reviewed on: 2026-03-06
---索引页面(如):
INDEX.mdmarkdown
---
title: AI Development Process
confluence_labels:
- ai-process
---AI Development Process
AI Development Process
<!-- confluence:properties-report cql="label = 'ai-process' and space = currentSpace()" firstcolumn="Document" headings="Status, Classification, Owner, Reviewed on" -->
<!-- confluence:ignore-start -->
<!-- confluence:ignore-end -->
| Document | Version | Summary |
|---|---|---|
| Overview & Philosophy | v2.0 | Core principles, four layers |
On Confluence, only the Properties Report macro is rendered (the static table is ignored). In markdown viewers (GitHub, local), the static table is shown alongside the HTML comment directives (which are invisible).<!-- confluence:properties-report cql="label = 'ai-process' and space = currentSpace()" firstcolumn="Document" headings="Status, Classification, Owner, Reviewed on" -->
<!-- confluence:ignore-start -->
<!-- confluence:ignore-end -->
| Document | Version | Summary |
|---|---|---|
| Overview & Philosophy | v2.0 | Core principles, four layers |
在Confluence上,仅会呈现属性报告宏(静态表格会被忽略)。在Markdown查看器(GitHub、本地)中,静态表格会与HTML注释指令(不可见)一同显示。Markdown-to-Confluence Conversion
Markdown到Confluence的转换
The converter handles the following transformations:
| Markdown | Confluence Storage Format |
|---|---|
| Skipped -- Confluence shows the page title |
| |
| |
| |
| |
| |
| |
| Info panel macro |
| Code macro with language |
| |
| |
| |
| |
| YAML frontmatter | Stripped |
| Two-column table (gray label column) |
| TOC section replaced with Confluence |
| Page Properties ( |
| Page Properties Report ( |
| Page Properties Report ( |
| Content between markers is skipped (not sent to Confluence) |
Key behaviors to communicate to users:
- The first is always skipped because Confluence already displays the page title
# heading - Relative markdown links (,
.md) are resolved to Confluence internal page links when publishing a directory (using the./command). The link map maps relative paths to page titles, generatingpublishmacros. When converting a single file without a link map, relative links fall back to plain text<ac:link> - TOC sections wrapped in /
<!-- confluence:toc-start -->directives are replaced with Confluence's built-in TOC macro. Supports params:<!-- confluence:toc-end -->,maxLevel,minLevel,style,outline(e.g.,printable). Section numbering (<!-- confluence:toc-start maxLevel=2 -->) defaults tooutlineto avoid duplicate numbering when the markdown TOC already uses numbered listsfalse - Code blocks and tables use full-width layout
- Document metadata lines () right after frontmatter are converted to a styled two-column table with gray labels
**Key**: Value - Code blocks with language hints get syntax highlighting via the code macro
- in frontmatter applies labels/tags to pages during
confluence_labelspublish - in frontmatter generates a Page Properties macro prepended to page content
confluence_properties - Properties Report directives generate dynamic tables querying labeled pages
- /
<!-- confluence:ignore-start -->blocks are stripped during conversion — content inside is completely skipped. This is useful for INDEX pages that need static markdown tables for GitHub/local rendering alongside dynamic Properties Report macros for Confluence. Ignore directives inside code blocks are treated as literal text (not processed)<!-- confluence:ignore-end -->
转换器会处理以下转换:
| Markdown | Confluence存储格式 |
|---|---|
| 跳过——Confluence会显示页面标题 |
| |
| |
| |
| |
| |
| |
| 信息面板宏 |
| 带语言的代码宏 |
| 带 |
| |
| |
| |
| YAML前置元数据 | 移除 |
| 两列表格(灰色标签列) |
| TOC部分替换为Confluence |
| 页面属性( |
| 页面属性报告( |
| 页面属性报告( |
| 标记之间的内容会被跳过(不会发送到Confluence) |
需告知用户的关键行为:
- 第一个会被跳过,因为Confluence已显示页面标题
# 标题 - 发布目录时(使用命令),相对Markdown链接(
publish、.md)会解析为Confluence内部页面链接。链接映射会将相对路径映射到页面标题,生成./宏。当转换单个文件且无链接映射时,相对链接会回退为纯文本<ac:link> - 包裹在/
<!-- confluence:toc-start -->指令中的TOC部分会替换为Confluence内置的TOC宏。支持参数:<!-- confluence:toc-end -->、maxLevel、minLevel、style、outline(例如printable)。章节编号(<!-- confluence:toc-start maxLevel=2 -->)默认为outline,避免Markdown TOC已使用编号列表时出现重复编号false - 代码块和表格使用全宽布局
- 前置元数据后的元数据行转换为带灰色标签列的两列表格
**Key**: Value - 带语言提示的代码块会通过代码宏实现语法高亮
- 前置元数据中的会在
confluence_labels过程中为页面添加标签publish - 前置元数据中的会在页面内容前生成页面属性宏
confluence_properties - 属性报告指令会生成查询带标签页面的动态表格
- /
<!-- confluence:ignore-start -->块在转换时会被移除——内部内容会完全跳过。这对需要为GitHub/本地渲染显示静态Markdown表格,同时为Confluence显示动态属性报告宏的索引页面非常有用。代码块内的忽略指令会被视为纯文本(不处理)<!-- confluence:ignore-end -->
Important Notes
重要说明
- Wide width by default -- All pages created via are automatically set to full-width layout. Use
orbitto revert.set-width --width fixed - Cloud vs Server -- Use service type for Atlassian Cloud (requires
confluence-cloudprefix in API paths, handled automatically). Use/wiki/for Data Center.confluence-server - Auth for Cloud -- Basic auth with your email as username and an API token (not your password) as the password field.
- 1Password integration -- Credentials in config can use and are resolved at runtime. Run
op://vault/item/fieldonce to resolve and cache all secrets for 8 hours (single biometric prompt). Useorbit authto wipe the cache.orbit auth clear - Dry run before publish -- Always use first when publishing a directory to preview the page hierarchy before making API calls.
--dry-run
- 默认宽屏——所有通过创建的页面都会自动设置为全宽布局。使用
orbit可恢复为固定宽度。set-width --width fixed - Cloud与Server区别——Atlassian Cloud使用服务类型(API路径需包含
confluence-cloud前缀,会自动处理)。Data Center使用/wiki/。confluence-server - Cloud认证——基础认证,用户名是你的邮箱,密码是API令牌(而非你的账户密码)。
- 1Password集成——配置中的凭据可使用格式,运行时会解析。运行
op://vault/item/field一次即可解析并缓存所有密钥8小时(仅需一次生物识别验证)。使用orbit auth可清除缓存。orbit auth clear - 发布前先试运行——发布目录时务必先使用参数,在调用API前预览页面层级。
--dry-run