Configuration
This configuration model applies to Atlassian Confluence Cloud only. acp2md does not support Confluence Server or Confluence Data Center.
Released builds are currently available for macOS and Linux only. Windows builds are not part of the current released artifacts.
acp2md applies configuration from four sources, in order of increasing priority:
| Priority | Source | Example |
|---|---|---|
| 1 (lowest) | Built-in defaults | |
| 2 | Config file | (see below) |
| 3 | Environment variables | ACP2MD_CONFLUENCE_DOMAIN |
| 4 (highest) | CLI flags | --log-level debug |
In practice, this means you can keep stable workstation settings in the config file, inject secrets through environment variables, and override behavior per run with CLI flags.
Config file location
The default config file location depends on your operating system. Run:
acp2md config whereRecommended use:
- keep non-secret defaults in the config file
- inject secrets through environment variables when possible
- reserve CLI flags for per-run overrides and debugging
To create a config file with all defaults filled in:
acp2md config createmacOS
~/Library/Application Support/acp2md/
- config.yaml
- license.bin
Full config file reference
# Confluence connection
confluence:
type: cloud # cloud | server | datacenter — only cloud is supported
domain: mycompany.atlassian.net # Your Confluence instance domain
username: you@example.com # Your Atlassian account email
api_token: YOUR_API_TOKEN # API token from id.atlassian.com
# HTTP client behaviour
http:
client:
max_retries: 3 # Number of retry attempts on failure
base_timeout: 500ms # Initial request timeout
max_timeout: 30s # Maximum request timeout after retries
proxy: "" # HTTP proxy URL (e.g. http://proxy.corp:8080)
# Logging
log:
level: info # debug | info | warn | error
format: text # text | json
file:
"" # Path to log file; stdout | stderr | /path/to/file.log
# Each run truncates the file
# Debug mode
debug:
enabled: false # Enables verbose debug output
dir: debug # Directory for debug artefacts
# Image handling
image:
cache_dir: "" # Set this only when you want a fixed shared cache location
max_size_bytes: 2097152 # Maximum size per image (default 2 MB)When image.cache_dir is left unset, generated configs typically omit the key so the per-output default remains the baseline behavior. In that default mode, acp2md anchors the cache at <output-dir>/.image_cache beside the sync state file, or ./.image_cache when writing to stdout. Set image.cache_dir explicitly when you need one fixed cache location across exports.
Environment variables
Every config key can be set with an environment variable by prefixing ACP2MD_ and replacing . with _:
| Environment variable | Config key | Description |
|---|---|---|
ACP2MD_CONFLUENCE_DOMAIN | confluence.domain | Confluence instance domain |
ACP2MD_CONFLUENCE_USERNAME | confluence.username | Atlassian account email |
ACP2MD_CONFLUENCE_API_TOKEN | confluence.api_token | Confluence API token |
ACP2MD_HTTP_CLIENT_MAX_RETRIES | http.client.max_retries | Retry count |
ACP2MD_HTTP_CLIENT_BASE_TIMEOUT | http.client.base_timeout | Base request timeout |
ACP2MD_HTTP_CLIENT_MAX_TIMEOUT | http.client.max_timeout | Max request timeout |
ACP2MD_HTTP_CLIENT_PROXY | http.client.proxy | HTTP proxy URL |
ACP2MD_LOG_LEVEL | log.level | Log level |
ACP2MD_LOG_FORMAT | log.format | Log format |
ACP2MD_LOG_FILE | log.file | Log output file |
ACP2MD_DEBUG_ENABLED | debug.enabled | Enable debug mode |
ACP2MD_IMAGE_CACHE_DIR | image.cache_dir | Image cache directory |
ACP2MD_IMAGE_MAX_SIZE_BYTES | image.max_size_bytes | Max image size |
Global CLI flags
These flags are available on every command:
| Flag | Default | Description |
|---|---|---|
--config-file | (see config where) | Path to a custom config file |
--log-level | info | Log verbosity: debug, info, warn, error |
--log-format | text | Log format: text or json |
--log-file | (discard) | Write logs to stdout, stderr, or a file path |
--debug | false | Shorthand for --log-level=debug |
--image-cache-dir | (none) | Directory for caching downloaded images |
--image-max-size-bytes | 10485760 | Max size in bytes for cached images |
Secure configuration practices
- Prefer environment variables for API tokens on shared or managed systems.
- Use
config createto establish the expected file shape before editing manually. - Run
doctorafter configuration changes so license, credentials, and connectivity are validated together. - Use a custom
--config-filewhen you need isolated test and production configurations on the same machine.
Retries and rate limiting
Every request goes through one shared HTTP client with a bounded retry budget. Three settings control it:
| Key | Default | Meaning |
|---|---|---|
http.client.max_retries | 3 | How many times a failed request is retried |
http.client.base_timeout | 500ms | The first backoff delay; each retry doubles it |
http.client.max_timeout | 30s | Ceiling for a single backoff delay |
With the defaults, the three retries wait 500 ms, 1 s and 2 s.
Retry-After is honoured
When Confluence answers a throttled request with 429 or 503 and names a delay, the client waits exactly that long instead of falling back to its own schedule. The server knows how long its window is; the client does not.
A Retry-After longer than 60 seconds is not honoured — the response is surfaced so you can decide, rather than the command appearing to hang. Waiting is interruptible, so Ctrl+C during a rate-limit pause takes effect immediately.
Upgrading does not change an existing config file. The backoff defaults
were raised from 10ms/100ms to 500ms/30s, but a config file
materialises every default at the moment it is created, and configuration
beats defaults. An install created before the change keeps the old pair — a
total budget of 70 ms across three attempts, which cannot outlast any real
throttling window.
Check with doctor, which reports the total backoff your configuration actually produces and flags one too short to survive a rate limit:
❌ HTTP retry budget only 70ms total across 3 retries — too short to wait out
a rate limit; raise it with 'acp2md config set
http.client.base_timeout 500ms' and ...Then raise them:
acp2md config set http.client.base_timeout 500ms
acp2md config set http.client.max_timeout 30sAn invalid proxy is an error
An unparseable http.client.proxy stops the command instead of logging a warning and continuing without a proxy. Silently sending traffic direct when it was explicitly asked to route it is, on a corporate network, a failure worth stopping for.
Behind a corporate proxy
acp2md config set http.client.proxy "http://proxy.corp.example.com:8080"With authentication:
acp2md config set http.client.proxy "http://user:password@proxy.corp.example.com:8080"Avoid storing proxy credentials in the config file if it is shared or
version-controlled. Use the ACP2MD_HTTP_CLIENT_PROXY environment variable
instead.
Logging to a file
acp2md page convert by-id 123456 --log-file app.logEach run truncates the log file, so it always contains only the output of the most recent run. Use stdout or stderr to stream logs to your terminal:
acp2md page convert by-id 123456 --log-file stdout