<!-- SPDX-License-Identifier: Apache-2.0 -->
Operations CLI and API
Use this sub-skill when the task is about running an Airflow environment, choosing between airflow, airflowctl, and HTTP APIs, inspecting or changing configuration, starting components, testing/backfilling Dags from the command line, or diagnosing metadata DB/API/server state.
Route First
- For Dag authoring, decorators, task mapping, timetables, or Task SDK code, use
../authoring-task-sdk/first and return here only for local run/test commands. - For Helm, Docker image, Kubernetes, Celery, production deployment topology, or chart values, use
../deployment-helm-docker/and return here only for core component semantics. - For provider packages, custom providers, hooks, operators, provider CLI commands, or extension metadata, use
../providers-extensions/. - For the Go or Java SDKs, treat them as separate specialized skills; use this sub-skill only for Airflow service/API behavior they talk to.
Core Decision Rules
- Use the local
airflowCLI when you are on an Airflow host, need local configuration/metadata DB access, or are starting/checking components such asairflow scheduler,airflow dag-processor,airflow triggerer,airflow api-server,airflow db migrate,airflow dags test, orairflow tasks test. - Use
airflowctlwhen automating operations against a running remote API server: Dags, Dag runs, pools, variables, connections, assets, jobs, xcom, providers, and authentication. - Use the Stable REST API when a non-Python/non-shell client needs a durable HTTP contract, pagination, explicit request/response payloads, or integration with external automation.
- Do not bypass Airflow by writing directly to the metadata DB unless an Airflow command explicitly exists for that operation; prefer CLI/API paths that enforce validation, auth, serialization, and audit behavior.
References
references/cli-reference.md— verifiedairflowandairflowctlcommand groups, output formats, parser inspection, and safe examples.references/configuration-and-api.md—airflow.cfg, environment variable precedence, REST API vs CLI, Execution API boundary, JWT/auth notes, and airflowctl environment handling.references/operations-workflows.md— install constraints, local standalone, DB migrate/check/reset, Dag test/backfill, and component health workflows.references/troubleshooting.md— common operations failures, Airflow 3 CLI migration traps, DB/auth/config/API/Dag parsing diagnosis.scripts/inspect_airflow_cli.py— safe installed-package parser helper for confirming CLI command groups and imports without depending on the source checkout.
Fast Workflows
- Inspect installation:
airflow version,airflow info --output json,airflow providers list --output json, andpython scripts/inspect_airflow_cli.py --check-imports --which both. - Configure local state: set
AIRFLOW_HOMEbefore first run, useairflow config get-value <section> <option>, and preferAIRFLOW__{SECTION}__{KEY}for deployment overrides. - Start locally: use
airflow standalonefor a disposable all-in-one environment; use separateairflow api-server,airflow scheduler,airflow dag-processor, andairflow triggerercommands when debugging components. - Migrate/check metadata DB: use
airflow db migrate,airflow db check, andairflow db check-migrations; avoid SQLite for production deployments. - Test a Dag file in Airflow 3: use
airflow dags test <dag_id> -f <path-to-dag-file>instead of the removed--subdirflag.
Safety Notes
- Keep tokens, DB URLs, Fernet keys, and JWT signing keys out of pasted logs and generated files.
- In multi-component deployments, configure shared JWT signing material consistently for the API Server and Scheduler; mismatched or auto-generated per-process keys cause
403and token validation failures. - Treat the Execution API as internal Airflow-to-worker/component traffic, not as the public integration API for external clients.
- When using
airflowctl, configure/login to the intended environment before mutating pools, variables, connections, Dag state, or Dag runs.