Skip to main content

Agent-first CLI for fetching Confluence Cloud page context as Markdown or JSON.

Project description

confluence-fetch

confluence-fetch fetches Confluence Cloud pages and turns them into agent-friendly output for CLI tools like Codex CLI and Claude Code.

It is designed for:

  • Fetching page context from a Confluence URL
  • Returning clean Markdown by default
  • Returning structured JSON when needed
  • Keeping secrets out of config files

Why

This tool exists to bring Confluence context into local agent workflows.

The primary use case is:

  1. Set a token in an environment variable
  2. Set your Confluence account email in config
  3. Run confluence-fetch fetch <confluence-url>
  4. Feed the result into an agent

Install

Target public install path:

uvx confluence-fetch --help

For local development, the repo will also keep a PEP 723 script entry point for uv run.

Quick Start

Set your Confluence token:

$env:CONFLUENCE_TOKEN = "<your-token>"

Set your Confluence account email:

uvx confluence-fetch config set-email "you@example.com"

Fetch a page as Markdown:

uvx confluence-fetch fetch "https://your-domain.atlassian.net/wiki/spaces/ENG/pages/123456789/Example+Page"

Fetch the same page as JSON:

uvx confluence-fetch fetch --format json "https://your-domain.atlassian.net/wiki/spaces/ENG/pages/123456789/Example+Page"

Write output to a file:

uvx confluence-fetch fetch -o page.md "https://your-domain.atlassian.net/wiki/spaces/ENG/pages/123456789/Example+Page"

Include comments:

uvx confluence-fetch fetch --comments "https://your-domain.atlassian.net/wiki/spaces/ENG/pages/123456789/Example+Page"

Config

Optional user config lives at:

~/.confluence-fetch/config.toml

The config stores only environment variable names, never secret token values.

Example:

[defaults]
token_env_var = "CONFLUENCE_TOKEN"
email = "you@example.com"

[domains."sona-systems.atlassian.net"]
token_env_var = "SONA_CONFLUENCE_TOKEN"

[domains."example.atlassian.net"]
token_env_var = "EXAMPLE_CONFLUENCE_TOKEN"

Resolution order:

  1. --token-env ENV_VAR
  2. domain-specific config match from the requested Confluence URL
  3. [defaults].token_env_var
  4. built-in default CONFLUENCE_TOKEN

Email resolution order:

  1. [defaults].email
  2. CONFLUENCE_EMAIL
  3. compatibility fallback confluence_email

Config commands:

confluence-fetch config show
confluence-fetch config set-default-token-env ENV_VAR
confluence-fetch config set-email EMAIL
confluence-fetch config clear-email
confluence-fetch config set-domain-token-env DOMAIN ENV_VAR
confluence-fetch config remove-domain DOMAIN

Example:

uvx confluence-fetch config set-domain-token-env sona-systems.atlassian.net SONA_CONFLUENCE_TOKEN

config show displays the effective token env var names, whether they are set or missing, and the configured default email. It never prints token values.

Output

confluence-fetch supports:

  • --format markdown
  • --format json

Markdown is the default.

Diagnostics go to stderr. Payload output goes to stdout unless --output is used.

Development

Implementation target:

  • Python >=3.11
  • installable PyPI package
  • PEP 723 wrapper for uv run

Auth

confluence-fetch uses Basic auth with a Confluence account email plus API token.

Secrets are not written to config.

License

MIT. See LICENSE.

Status

This repo is currently being built around an agent-first v2 spec.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

confluence_fetch-0.12.0.tar.gz (31.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

confluence_fetch-0.12.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file confluence_fetch-0.12.0.tar.gz.

File metadata

  • Download URL: confluence_fetch-0.12.0.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for confluence_fetch-0.12.0.tar.gz
Algorithm Hash digest
SHA256 94c33c6b604a3b7148c1f4264d67b85bd8511a53c918562cd4f16623e3350d04
MD5 e7c2ed7733973a0ac5bee5b6b855e145
BLAKE2b-256 e2983552e95e5dccc1d79e9792047f8d96fead782918d2204887def070a39aea

See more details on using hashes here.

File details

Details for the file confluence_fetch-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: confluence_fetch-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for confluence_fetch-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7b5c41c46d70de14ec398728392f12712f1a0b350f1ea57782fe788acbfa95a
MD5 624f99500a3980d4ac2fe8840cc45ac3
BLAKE2b-256 0d6fd23bae5409bd583edab4be3f3549e2a3b371120f10f2f9fb6a79cb332558

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page