Airflow CLI Rust is a command-line interface (CLI) application written in Rust, designed to interact with Apache Airflow. It allows users to fetch and display a list of Directed Acyclic Graphs (DAGs) and their runs from an Airflow instance. This tool is particularly useful for developers and administrators who need to quickly check the status of Airflow DAGs without accessing the Airflow web UI.
This CLI tool utilizes Airflow's REST API to fetch information about DAGs and DAG runs. It supports basic authentication to ensure secure access to your Airflow instance. Developed with Rust's powerful concurrency features and safety guarantees, Airflow CLI Rust provides a fast and reliable user experience.
- List all DAGs available in the specified Airflow instance.
- Fetch and display runs for a specified DAG.
- Supports basic authentication for secure access to Airflow's REST API.
- Rust programming language environment (installation guide)
- Access to an Apache Airflow instance with the REST API enabled
- Clone the repository to your local machine:
git clone https://github.com/ejoliet/airflow-cli-rust.git
cd airflow-cli-rust
- Build the project using Cargo, Rust's package manager and build system:
cargo build --release
This command compiles the project and generates an executable in target/release/airflow-cli-rust
.
To install and run a Rust program like the one provided on macOS, you'll need to follow these steps, including the adjustments for basic authentication with Airflow.
- Install Rust If you haven't already installed Rust, you can do so by using rustup, which is Rust's official installation method. Open your terminal and run:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
This command downloads and runs the rustup script, which installs the Rust compiler (rustc), the Rust package manager (cargo), and other useful tools. You might need to restart your terminal or source your profile script to ensure that the Rust tools are in your PATH.
Before running the CLI, ensure you have the URL of your Airflow instance and the credentials for basic authentication. The tool expects these as inputs during runtime.
You'll need to setup the environment variable to authenticate against Airflow REST API.
export AIRFLOW_PASSWORD=your_actual_password_here
export AIRFLOW_USER=your_actual_user_here
To start the CLI application, use the following command:
cargo run --release
Follow the on-screen prompts to interact with your Airflow instance.
This project relies on several external crates, including:
reqwest
for making HTTP requests.serde
andserde_json
for JSON serialization and deserialization.colored
for coloring terminal output.tokio
for async runtime.
Dependencies are managed by Cargo and defined in the Cargo.toml
file.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.