Airflowx (afx) is a command line application to interact with the airflow deployment via its REST API.
Find the summary of supported commands below. Detailed documentation of the commands can be found here.
afx config set-context [-h] <context-name> [--server=<URL>] [--username=<name>] [--password=<pass>]
afx config get-contexts [-h]
afx config current-context [-h]
afx config use-context [-h] <context-name>
afx config remove-context [-h] <context-name>
afx dags list [-h] [--only-active] [--paused] [--pattern-string=<dagIdPatternString>]
afx dags list-runs [-h] <DAG ID> [--sort-reverse] [--limit=<number>] [--state=<states>]
afx dags stat [-h] [--all] [<dagIdList>[,<dagIdList>...]]
afx dags details [-h] <DAG ID> [-v]
afx dags pause [-h] [--all] [--dag-id=<dagId>] [--pattern=<dagIdPattern>]
afx dags unpause [-h] [--all] [--dag-id=<dagId>] [--pattern=<dagIdPattern>]
afx modify run [-h] <DAG ID> --run=<DAG Run ID> --state=<state>
afx import-errors [-h]
Grab the uber jar file or the native linux binary from the latest release.
The jar needs Java 21.0.6 or newer to run. Run the jar using:
java -jar airflowx-*.jar <argument-1> <argument-2>For easier syntax set up an alias to run the jar.
This binary is built and tested on linux. Start by renaming the native binary file to afx.
Add the file path to PATH or move the afx binary to a location that already exists in the PATH
variable.
To have auto-completion run the afx-completion bash script in the bash shell.
- At the moment this CLI app supports the
api/v1airflow endpoint. This CLI app was tested with airflow2.10.5. - The CLI app currently supports the
basic_authairflow backend authentication only. - No test coverage, oops!!
This project uses Quarkus, the Supersonic Subatomic Java Framework and picocli.
This needs Java 21.0.6 or newer. To build the native executable it needs GraalVM.
You can run your application in dev mode that enables live coding using:
./gradlew quarkusDev
NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
The application can be packaged using:
./gradlew build
It produces the quarkus-run.jar file in the build/quarkus-app/ directory.
Be aware that it’s not an über-jar as the dependencies are copied into the
build/quarkus-app/lib/ directory.
The application is now runnable using java -jar build/quarkus-app/quarkus-run.jar.
If you want to build an über-jar, execute the following command:
./gradlew build -Dquarkus.package.jar.type=uber-jar
The application, packaged as an über-jar, is now runnable using java -jar build/*-runner.jar.
You can create a native executable using:
./gradlew build -Dquarkus.native.enabled=true
Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
./gradlew build -Dquarkus.native.enabled=true -Dquarkus.native.container-build=true
You can then execute your native executable with: ./build/*-runner
If you want to learn more about building native executables, please consult https://quarkus.io/guides/gradle-tooling.
To have command auto-completion in bash install the afx-completion bash script. Airflowx can auto complete the available dag ids in relevant commands on pressing tab twice.
Picocli can automatically recreate the bash auto-completion script. Before creating the
auto-completion script build the jar using ./gradlew clean build.
On windows recreate the afx-completion script using:
java -cp "build/quarkus-app/app/*;build/quarkus-app/lib/main/*;build/quarkus-app/quarkus-run.jar" \
picocli.AutoComplete -n afx \
--force com.airflowx.command.AirflowxCommand \
--completionScript afx-completionOn linux recreate the afx-completion script using (note the semicolon to colon change):
java -cp "build/quarkus-app/app/*:build/quarkus-app/lib/main/*:build/quarkus-app/quarkus-run.jar" \
picocli.AutoComplete -n afx \
--force com.airflowx.command.AirflowxCommand \
--completionScript afx-completion