Environment Variables
Environment variables and credential configuration for the FlyDocs CLI.
The FlyDocs CLI reads several environment variables for authentication, endpoint configuration, and telemetry control. These variables take priority over file-based configuration, making them the right choice for CI pipelines and multi-workspace setups.
Variables
| Variable | Description |
|---|---|
FLYDOCS_API_KEY |
Relay API key (fdk_...). Highest priority in credential resolution.
Set this in CI environments or when you need to override project and global credentials.
|
FLYDOCS_WORKSPACE_ID | Workspace ID override. Useful when a single API key has access to multiple workspaces and you want to target a specific one. |
FLYDOCS_RELAY_URL | Custom relay endpoint. Defaults to the production relay server. For development and testing only. |
FLYDOCS_TELEMETRY |
Set to 0 to disable telemetry. Overrides the settings file.
Equivalent to running flydocs telemetry disable.
|
CI / CONTINUOUS_INTEGRATION | Standard CI environment markers. The CLI detects these for telemetry context -- no special behavior is triggered, but telemetry events are tagged as originating from a CI environment. |
Credential Resolution Order
When the CLI needs an API key, it checks these sources in priority order. The first valid key found is used.
- FLYDOCS_API_KEY environment variable
- .flydocs/credentials.json in the project directory (created with
flydocs init --project-key) - .flydocs-workspace.json parent directory credentials (for multi-repo workspaces where the workspace root holds shared credentials)
- ~/.flydocs/credentials global credentials file (the default, created by
flydocs initorflydocs auth)
When to Use Each Method
| Method | Best For |
|---|---|
| Environment variable | CI/CD pipelines, Docker containers, temporary overrides |
| Project-scoped credentials | Repos that use a different workspace than your global default |
| Workspace root credentials | Multi-repo workspaces sharing a single API key across sibling repos |
| Global credentials | Day-to-day development on a single machine (the default) |
Config File Locations
| File | Location | Purpose |
|---|---|---|
credentials | ~/.flydocs/credentials | Global API key storage. File permissions set to 600. |
credentials.json | .flydocs/credentials.json | Project-scoped API key. Created with --project-key. |
config.json | .flydocs/config.json | Project configuration: tier, provider, labels, active projects. |
workspace.json | .flydocs-workspace.json | Multi-repo workspace topology. Created at the workspace root. |
Examples
CI Pipeline
Set the API key as a secret in your CI environment:
export FLYDOCS_API_KEY=fdk_your_key_here
flydocs sync Disable Telemetry
Disable telemetry globally via environment variable:
export FLYDOCS_TELEMETRY=0 Or use the CLI command for a persistent setting:
flydocs telemetry disable Multi-Workspace Override
Target a specific workspace when your key has access to multiple:
FLYDOCS_WORKSPACE_ID=ws_abc123 flydocs sync