confluence-browser-fetch
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseConfluence Browser Fetch
Confluence Browser Fetch
Use this skill when a user wants Confluence pages ingested into an LLM wiki folder and normal Atlassian API-token auth is unavailable or inconvenient due to SSO.
raw/The script opens/reuses Chrome with a dedicated profile, lets the user complete SSO once, extracts Atlassian cookies via Chrome DevTools, verifies they represent an authenticated Confluence REST session, and fetches Confluence REST data plus rendered page HTML and attachments.
当用户希望将Confluence页面导入LLM wiki的文件夹,且由于SSO导致常规Atlassian API令牌认证不可用或不便时,可使用此技能。
raw/该脚本会打开/复用带有专用配置文件的Chrome浏览器,让用户完成一次SSO登录,通过Chrome DevTools提取Atlassian Cookie,验证其代表已认证的Confluence REST会话,然后获取Confluence REST数据、渲染后的页面HTML以及附件。
Safety
安全注意事项
- Never ask users to paste Confluence cookies or API tokens into chat.
- Prefer browser automation so secrets remain in the local Chrome profile.
- Treat fetched pages and attachments as confidential.
- This skill is read-only: do not create, edit, delete, or move Confluence pages.
- 切勿要求用户在聊天中粘贴Confluence Cookie或API令牌。
- 优先使用浏览器自动化,确保密钥仅保存在本地Chrome配置文件中。
- 将获取的页面和附件视为机密内容。
- 本技能为只读:请勿创建、编辑、删除或移动Confluence页面。
Script
脚本
bash
scripts/confluence-browser-fetch.js <URL|PAGE-ID> [...] [options]Important options:
bash
--site URL Atlassian site, e.g. https://example.atlassian.net
--raw-dir DIR output raw directory
--space KEY Confluence space key for --title search
--title TITLE resolve and fetch page by exact title
--cql CQL search Confluence and fetch matching pages
--descendants fetch descendant pages
--max-search-results N limit CQL result fetches
--max-attachment-size S skip attachment files larger than S (default 5mb; use unlimited to disable)
--force re-fetch even when local page version is current
--no-skip-unchanged disable version/timestamp skip check
--retries N retry transient HTTP failures
--request-timeout SEC per-request timeout
--no-attachments skip attachments
--no-browser-html skip rendered browser HTMLbash
scripts/confluence-browser-fetch.js <URL|PAGE-ID> [...] [options]重要选项:
bash
--site URL Atlassian站点,例如https://example.atlassian.net
--raw-dir DIR 输出原始目录
--space KEY 用于--title搜索的Confluence空间键
--title TITLE 通过精确标题解析并获取页面
--cql CQL 搜索Confluence并获取匹配页面
--descendants 获取子页面
--max-search-results N 限制CQL结果获取数量
--max-attachment-size S 跳过大于S的附件文件(默认5mb;使用unlimited可禁用限制)
--force 即使本地页面版本为最新,仍重新获取
--no-skip-unchanged 禁用版本/时间戳跳过检查
--retries N 重试临时HTTP失败
--request-timeout SEC 单请求超时时间
--no-attachments 跳过附件
--no-browser-html 跳过渲染后的浏览器HTMLShared Atlassian SSO Session
共享Atlassian SSO会话
All five Atlassian skills (, , , , ) default to the same Chrome profile () and DevTools port (). Log in once via any skill and the others reuse that session automatically — no env vars needed.
jira-browser-fetchjira-updateconfluence-browser-fetchconfluence-updatebitbucket-browser-fetch~/.local/share/atlassian-browser-chrome9223This is a separate Chrome window from any browser the user already has open. The script always launches its own profile with remote-debugging enabled; cookies from the user's regular Chrome are not read. The user logs in inside the window the script opens; that session is then reused by every Atlassian skill until it expires.
Reuse signal. When attaching to an existing session, the script prints and (if the target tab is open) . When you see those lines, do not ask the user to re-SSO — the session is already valid.
Reusing Chrome DevTools on port 9223Found existing tab for <host>If Chrome/Chromium is installed via Flatpak, Snap, or another non-PATH location, set (or a wrapper script) so the script can find the binary.
CHROME=/path/to/launcherOverride with and/or to relocate the shared profile/port, or use skill-specific / env vars for isolation.
ATLASSIAN_CHROME_PROFILEATLASSIAN_CHROME_DEBUG_PORT*_CHROME_PROFILE*_CHROME_DEBUG_PORT所有五个Atlassian技能(、、、、)默认使用相同的Chrome配置文件()和DevTools端口()。通过任意技能登录一次后,其他技能会自动复用该会话——无需设置环境变量。
jira-browser-fetchjira-updateconfluence-browser-fetchconfluence-updatebitbucket-browser-fetch~/.local/share/atlassian-browser-chrome9223这是一个独立于用户已打开的浏览器的Chrome窗口。 脚本始终启动带有远程调试功能的专用配置文件;不会读取用户常规Chrome中的Cookie。用户在脚本打开的窗口中登录;该会话会被所有Atlassian技能复用,直到过期。
复用信号:当连接到现有会话时,脚本会打印,如果目标标签页已打开,还会打印。当看到这些信息时,请勿要求用户重新进行SSO登录——会话已有效。
Reusing Chrome DevTools on port 9223Found existing tab for <host>如果Chrome/Chromium是通过Flatpak、Snap或其他非PATH路径安装的,请设置(或包装脚本),以便脚本找到二进制文件。
CHROME=/path/to/launcher可通过和/或覆盖共享配置文件/端口,或使用技能专属的 / 环境变量进行隔离。
ATLASSIAN_CHROME_PROFILEATLASSIAN_CHROME_DEBUG_PORT*_CHROME_PROFILE*_CHROME_DEBUG_PORTTypical Workflow
典型工作流程
- If the user gives a Confluence URL, run the script directly with that URL.
- If the user gives a title, ask for the space key or use .
--cql - Show the command before running it.
- If Chrome opens (first run or expired session), ask the user to complete SSO in that window. On subsequent invocations the script reuses the session silently — see the Reuse signal above.
- Verify saved files.
- If this is an LLM wiki ingest, process the saved material into
raw/confluence/...per the projectwiki/.AGENTS.md
Example:
bash
scripts/confluence-browser-fetch.js \
"https://example.atlassian.net/wiki/spaces/ABC/pages/123456/Page+Title" \
--site https://example.atlassian.net \
--raw-dir ./rawFetch a page and all descendants:
bash
scripts/confluence-browser-fetch.js \
123456 \
--site https://example.atlassian.net \
--raw-dir ./raw \
--descendantsFetch by CQL:
bash
scripts/confluence-browser-fetch.js \
--site https://example.atlassian.net \
--raw-dir ./raw \
--cql 'space = ABC and type = page and text ~ "billing"'- 如果用户提供Confluence URL,直接使用该URL运行脚本。
- 如果用户提供标题,询问空间键或使用参数。
--cql - 在运行前展示命令。
- 如果Chrome打开(首次运行或会话过期),请用户在该窗口中完成SSO登录。后续调用时,脚本会静默复用会话——请参考上述复用信号。
- 验证保存的文件。
- 如果是LLM wiki导入,请根据项目将保存的
AGENTS.md内容处理到raw/confluence/...文件夹中。wiki/
示例:
bash
scripts/confluence-browser-fetch.js \
"https://example.atlassian.net/wiki/spaces/ABC/pages/123456/Page+Title" \
--site https://example.atlassian.net \
--raw-dir ./raw获取页面及其所有子页面:
bash
scripts/confluence-browser-fetch.js \
123456 \
--site https://example.atlassian.net \
--raw-dir ./raw \
--descendants通过CQL搜索获取页面:
bash
scripts/confluence-browser-fetch.js \
--site https://example.atlassian.net \
--raw-dir ./raw \
--cql 'space = ABC and type = page and text ~ "billing"'Output Layout
输出结构
text
raw/confluence/<SPACE>/<PAGE-ID>-<slug>/
├── page.json # Confluence REST content with storage/view HTML and metadata
├── page.storage.html # Confluence storage format
├── page.view.html # REST-rendered view body
├── page.browser.html # browser page HTML, if enabled
├── metadata.json # fetch metadata
├── attachments.json # attachment manifest, including skipped large-file references
└── attachments/ # downloaded attachments under max-size thresholdA run manifest is written to:
text
raw/confluence-browser-fetch-run.jsontext
raw/confluence/<SPACE>/<PAGE-ID>-<slug>/
├── page.json # 包含存储/视图HTML和元数据的Confluence REST内容
├── page.storage.html # Confluence存储格式
├── page.view.html # REST渲染的视图主体
├── page.browser.html # 浏览器页面HTML(若启用)
├── metadata.json # 获取元数据
├── attachments.json # 附件清单,包含被跳过的大文件引用
└── attachments/ # 下载的未超过最大大小限制的附件运行清单会写入以下路径:
text
raw/confluence-browser-fetch-run.jsonInstallation / PATH
安装 / PATH
Use directly by path, or install a symlink:
bash
mkdir -p ~/.local/bin
ln -sf ~/.pi/agent/skills/confluence-browser-fetch/scripts/confluence-browser-fetch.js ~/.local/bin/confluence-browser-fetch可直接通过路径使用,或创建符号链接:
bash
mkdir -p ~/.local/bin
ln -sf ~/.pi/agent/skills/confluence-browser-fetch/scripts/confluence-browser-fetch.js ~/.local/bin/confluence-browser-fetchReferences
参考资料
- Usage reference
- Distribution guide
- 使用参考
- 分发指南