Configuration
How the CLI resolves its API URL, key and project: flags, environment variables and the config file.
The CLI has three settings that matter: the API URL, the API key and the project. Each one resolves in the same order:
flag > environment variable > config file > default
The API key is the exception: it’s never read from the config file. It comes from --api-key, WINDPAINT_API_KEY, or the credentials file written by auth login.
| Setting | Flag | Environment variable | Config file | Default |
|---|---|---|---|---|
| API URL | --api-url | WINDPAINT_API_URL | api.url | https://api.windpaint.ai |
| API key | --api-key | WINDPAINT_API_KEY | none (credentials.json) | none |
| Project | --project | WINDPAINT_PROJECT | project | your organization’s default project |
| Config directory | --config-dir | WINDPAINT_CONFIG_DIR | ~/.windpaint | |
| Config file | --config | WINDPAINT_CONFIG | <config dir>/config.yaml |
Config file
~/.windpaint/config.yaml is optional. A missing file is the same as an empty one.
# ~/.windpaint/config.yaml
api:
url: https://api.windpaint.ai
project: launch-video
| Key | Description |
|---|---|
api.url | API base URL, without /v1. You only need this if Windpaint support gives you a different endpoint. |
project | Default project, by id or slug. windpaint projects select writes this key. |
Edit the file by hand or let projects select manage project. There’s no config set command.
The config directory holds two files:
| File | Contents |
|---|---|
config.yaml | API URL and default project |
credentials.json | The API key or session token saved by auth login (mode 0600) |
--config moves only config.yaml. --config-dir moves both, which is useful for keeping separate setups side by side:
WINDPAINT_CONFIG_DIR=~/.windpaint-client-a windpaint auth login --api-key aak_...
WINDPAINT_CONFIG_DIR=~/.windpaint-client-a windpaint balance
Environment variables
| Variable | Flag equivalent | Description |
|---|---|---|
WINDPAINT_API_KEY | --api-key | API key. Overrides the saved credentials. |
WINDPAINT_API_URL | --api-url | API base URL. |
WINDPAINT_PROJECT | --project | Project id or slug. Overrides the config file. |
WINDPAINT_CONFIG_DIR | --config-dir | Config directory. |
WINDPAINT_CONFIG | --config | Config file path. |
Global flags
Every command accepts these.
| Flag | Description |
|---|---|
--api-key <key> | API key for this command. |
--api-url <url> | API base URL for this command. |
--project <id|slug> | Project for this command. |
--config <path> | Config file to read. |
--config-dir <path> | Config directory (config file and credentials). |
--json | Print JSON on stdout. Same as --format json. |
--format <auto|json|text> | auto (default) prints tables in a terminal and JSON otherwise. text forces tables. |
-q, --quiet | No progress messages on stderr. Errors still print. |
-h, --help | Help for any command. |
-v, --version | Print the version number. |
See Scripting and agents for how output modes and stderr work.
Project selection
Every generation request, upload, asset and product run belongs to a project. The CLI sends the selected project as the X-Windpaint-Project header; with no project set, the API uses your organization’s default project. See Organizations and projects.
The project resolves from, highest first:
--projecton the commandWINDPAINT_PROJECTprojectinconfig.yaml, written bywindpaint projects select- Your organization’s default project
Save a default once:
windpaint projects select launch-video
Selected project launch-video (5b0c2d7e-8f61-4c1a-9e3d-2a7b6c4f8e90)
select checks that the project exists and isn’t archived, then saves its slug. Clear it to go back to the organization default:
windpaint projects select --clear
Override it for one command:
windpaint assets --project product-shots
Show the resolved configuration
windpaint config show
API URL https://api.windpaint.ai (default)
API key aak_…9f3e (env)
Project launch-video (config)
Config file /Users/you/.windpaint/config.yaml
Config dir /Users/you/.windpaint
Each value shows where it came from: flag, env, config, credentials (the API key saved by auth login) or default. The key is redacted to its first and last four characters. When no project is set, Project reads API key default, meaning the API picks your organization’s default project.
Run this first when a command uses the wrong key or project. config show doesn’t call the API, so it works offline and without a key.
With --json:
{
"api_key": "aak_…9f3e",
"api_url": "https://api.windpaint.ai",
"config_dir": "/Users/you/.windpaint",
"config_file": "/Users/you/.windpaint/config.yaml",
"project": "launch-video",
"sources": {
"api_key": "env",
"api_url": "default",
"project": "config"
}
}
Next
Scripting and agents
JSON output, stderr progress, error shape and exit codes.