2025-03-29 12:55:25 +05:30
# WRKFLW
2025-04-21 17:34:39 +05:30
[](https://crates.io/crates/wrkflw)
[](https://www.rust-lang.org/)
[](LICENSE)
2025-04-21 17:38:43 +05:30
[](https://github.com/bahdotsh/wrkflw/actions/workflows/build.yml)
2025-04-21 17:34:39 +05:30
[](https://crates.io/crates/wrkflw)
2025-04-06 21:05:48 +05:30
WRKFLW is a powerful command-line tool for validating and executing GitHub Actions workflows locally, without requiring a full GitHub environment. It helps developers test their workflows directly on their machines before pushing changes to GitHub.
2025-03-29 12:55:25 +05:30
2025-04-10 18:33:38 +05:30

2025-03-29 12:55:25 +05:30
## Features
2025-04-06 21:05:48 +05:30
- **TUI Interface**: A full-featured terminal user interface for managing and monitoring workflow executions
2025-03-29 12:55:25 +05:30
- **Validate Workflow Files**: Check for syntax errors and common mistakes in GitHub Actions workflow files
2025-04-06 21:05:48 +05:30
- **Execute Workflows Locally**: Run workflows directly on your machine using Docker containers
- **Emulation Mode**: Optional execution without Docker by emulating the container environment locally
- **Job Dependency Resolution**: Automatically determines the correct execution order based on job dependencies
- **Docker Integration**: Execute workflow steps in isolated Docker containers with proper environment setup
- **GitHub Context**: Provides GitHub-like environment variables and workflow commands
- **Multiple Runtime Modes**: Choose between Docker containers or local emulation for maximum flexibility
- **Action Support**: Supports various GitHub Actions types:
- Docker container actions
- JavaScript actions
- Composite actions
- Local actions
- **Special Action Handling**: Native handling for commonly used actions like `actions/checkout`
- **Output Capturing**: View logs, step outputs, and execution details
- **Parallel Job Execution**: Runs independent jobs in parallel for faster workflow execution
2025-04-21 11:51:52 +05:30
- **Trigger Workflows Remotely**: Manually trigger workflow runs on GitHub
2025-03-29 12:55:25 +05:30
## Installation
2025-04-06 21:05:48 +05:30
The recommended way to install `wrkflw` is using Rust's package manager, Cargo:
2025-03-29 12:55:25 +05:30
### Using Cargo Install (Recommended)
```bash
cargo install wrkflw
```
### From Source
Clone the repository and build using Cargo:
```bash
2025-04-21 17:32:43 +05:30
git clone https://github.com/bahdotsh/wrkflw.git
2025-03-29 12:55:25 +05:30
cd wrkflw
cargo build --release
```
The compiled binary will be available at `target/release/wrkflw` .
## Usage
2025-04-06 21:05:48 +05:30
The simplest way to use WRKFLW is to navigate to your project's root directory and run:
```bash
wrkflw
```
This will automatically detect and load all workflows from `.github/workflows` directory into the TUI interface.
WRKFLW also provides three main command modes:
2025-03-29 12:55:25 +05:30
### Validating Workflow Files
```bash
# Validate all workflow files in the default location (.github/workflows)
wrkflw validate
# Validate a specific workflow file
wrkflw validate path/to/workflow.yml
# Validate workflows in a specific directory
wrkflw validate path/to/workflows
2025-04-06 21:05:48 +05:30
# Validate with verbose output
wrkflw validate --verbose path/to/workflow.yml
2025-03-29 12:55:25 +05:30
```
2025-04-06 21:05:48 +05:30
### Running Workflows in CLI Mode
2025-03-29 12:55:25 +05:30
```bash
# Run a workflow with Docker (default)
wrkflw run .github/workflows/ci.yml
# Run a workflow in emulation mode (without Docker)
wrkflw run --emulate .github/workflows/ci.yml
# Run with verbose output
wrkflw run --verbose .github/workflows/ci.yml
```
2025-04-06 21:05:48 +05:30
### Using the TUI Interface
```bash
# Open TUI with workflows from the default directory
wrkflw tui
# Open TUI with a specific directory of workflows
wrkflw tui path/to/workflows
# Open TUI with a specific workflow pre-selected
wrkflw tui path/to/workflow.yml
# Open TUI in emulation mode
wrkflw tui --emulate
```
2025-04-21 11:51:52 +05:30
### Triggering Workflows Remotely
```bash
# Trigger a workflow remotely on GitHub
wrkflw trigger workflow-name --branch main --input key1=value1 --input key2=value2
```
2025-04-06 21:05:48 +05:30
## TUI Controls
The terminal user interface provides an interactive way to manage workflows:
- **Tab / 1-4**: Switch between tabs (Workflows, Execution, Logs, Help)
- **Up/Down or j/k**: Navigate lists
- **Space**: Toggle workflow selection
- **Enter**: Run selected workflow / View job details
- **r**: Run all selected workflows
- **a**: Select all workflows
- **n**: Deselect all workflows
- **e**: Toggle between Docker and Emulation mode
- **v**: Toggle between Execution and Validation mode
- **Esc**: Back / Exit detailed view
- **q**: Quit application
2025-03-29 12:55:25 +05:30
## Examples
### Validating a Workflow
```bash
$ wrkflw validate .github/workflows/rust.yml
2025-04-06 21:05:48 +05:30
Validating workflows in: .github/workflows/rust.yml
2025-03-29 12:55:25 +05:30
============================================================
2025-04-06 21:05:48 +05:30
✅ Valid: rust.yml
2025-03-29 12:55:25 +05:30
------------------------------------------------------------
Summary
============================================================
2025-04-06 21:05:48 +05:30
✅ 1 valid workflow file(s)
2025-03-29 12:55:25 +05:30
All workflows are valid! 🎉
```
### Running a Workflow
```bash
$ wrkflw run .github/workflows/rust.yml
Executing workflow: .github/workflows/rust.yml
============================================================
Runtime: Docker
------------------------------------------------------------
2025-04-06 21:05:48 +05:30
✅ Job succeeded: build
2025-03-29 12:55:25 +05:30
------------------------------------------------------------
2025-04-06 21:05:48 +05:30
✅ Checkout code
✅ Set up Rust
✅ Build
✅ Run tests
2025-03-29 12:55:25 +05:30
2025-04-06 21:05:48 +05:30
✅ Workflow completed successfully!
```
### Quick TUI Startup
2025-03-29 12:55:25 +05:30
2025-04-06 21:05:48 +05:30
```bash
# Navigate to project root and run wrkflw
$ cd my-project
$ wrkflw
# This will automatically load .github/workflows files into the TUI
2025-03-29 12:55:25 +05:30
```
## Requirements
2025-04-06 21:05:48 +05:30
- Rust 1.67 or later
2025-03-29 12:55:25 +05:30
- Docker (optional, for container-based execution)
2025-04-06 21:05:48 +05:30
- When not using Docker, the emulation mode can run workflows using your local system tools
2025-03-29 12:55:25 +05:30
## How It Works
2025-04-06 21:05:48 +05:30
WRKFLW parses your GitHub Actions workflow files and executes each job and step in the correct order. For Docker mode, it creates containers that closely match GitHub's runner environments. The workflow execution process:
1. **Parsing ** : Reads and validates the workflow YAML structure
2. **Dependency Resolution ** : Creates an execution plan based on job dependencies
3. **Environment Setup ** : Prepares GitHub-like environment variables and context
4. **Execution ** : Runs each job and step either in Docker containers or through local emulation
5. **Monitoring ** : Tracks progress and captures outputs in the TUI or command line
## Advanced Features
### GitHub Environment Files Support
WRKFLW supports GitHub's environment files and special commands:
- `GITHUB_OUTPUT` : For storing step outputs (`echo "result=value" >> $GITHUB_OUTPUT` )
- `GITHUB_ENV` : For setting environment variables (`echo "VAR=value" >> $GITHUB_ENV` )
- `GITHUB_PATH` : For modifying the PATH (`echo "/path/to/dir" >> $GITHUB_PATH` )
- `GITHUB_STEP_SUMMARY` : For creating step summaries (`echo "# Summary" >> $GITHUB_STEP_SUMMARY` )
### Composite Actions
WRKFLW supports composite actions, which are actions made up of multiple steps. This includes:
- Local composite actions referenced with `./path/to/action`
- Remote composite actions from GitHub repositories
- Nested composite actions (composite actions that use other actions)
### Container Cleanup
WRKFLW automatically cleans up any Docker containers created during workflow execution, even if the process is interrupted with Ctrl+C.
2025-03-29 12:55:25 +05:30
## Limitations
2025-04-06 21:05:48 +05:30
- Some GitHub-specific functionality might not work exactly as it does on GitHub
- Complex matrix builds with very large matrices may have performance limitations
- Actions that require specific GitHub environment features may need customization
- Network-isolated actions might need internet connectivity configured differently
2025-03-29 12:55:25 +05:30
## License
This project is licensed under the MIT License - see the LICENSE file for details.
2025-04-21 11:51:52 +05:30
## Remote Workflow Triggering
2025-04-21 13:56:55 +05:30
WRKFLW allows you to manually trigger workflow runs on GitHub through both the command-line interface (CLI) and the terminal user interface (TUI).
2025-04-21 11:51:52 +05:30
2025-04-21 13:56:55 +05:30
### Requirements:
1. You need a GitHub token with workflow permissions. Set it in the `GITHUB_TOKEN` environment variable:
2025-04-21 11:51:52 +05:30
```bash
export GITHUB_TOKEN=ghp_your_token_here
```
2025-04-21 13:56:55 +05:30
2. The workflow must have the `workflow_dispatch` trigger defined in your workflow YAML:
2025-04-21 11:51:52 +05:30
```yaml
on:
workflow_dispatch:
inputs:
2025-04-21 13:56:55 +05:30
name:
description: 'Person to greet'
default: 'World'
required: true
debug:
description: 'Enable debug mode'
required: false
type: boolean
default: false
2025-04-21 11:51:52 +05:30
```
2025-04-21 13:56:55 +05:30
### Triggering from CLI:
2025-04-21 11:51:52 +05:30
```bash
# Trigger a workflow using the default branch
2025-04-21 13:56:55 +05:30
wrkflw trigger workflow-name
2025-04-21 11:51:52 +05:30
2025-04-21 13:56:55 +05:30
# Trigger a workflow on a specific branch
wrkflw trigger workflow-name --branch feature-branch
2025-04-21 11:51:52 +05:30
# Trigger with input parameters
2025-04-21 13:56:55 +05:30
wrkflw trigger workflow-name --branch main --input name=Alice --input debug=true
2025-04-21 11:51:52 +05:30
```
2025-04-21 13:56:55 +05:30
After triggering, WRKFLW will provide feedback including the URL to view the triggered workflow on GitHub.
### Triggering from TUI:
1. Launch the TUI interface:
```bash
wrkflw tui
```
2. Navigate to the "Workflows" tab (use `Tab` key or press `1` ).
3. Use the arrow keys (`↑` /`↓` ) or `j` /`k` to select the desired workflow.
4. Press `t` to trigger the selected workflow.
5. If the workflow is successfully triggered, you'll see a notification in the UI.
6. You can monitor the triggered workflow's execution on GitHub using the provided URL.
### Verifying Triggered Workflows:
To verify that your workflow was triggered:
1. Visit your GitHub repository in a web browser.
2. Navigate to the "Actions" tab.
3. Look for your workflow in the list of workflow runs.
4. Click on it to view the details of the run.