A TUI command runner based on git changes
Project description
Fnug
[!WARNING] The main branch is currently undergoing a refactor to Rust. If you're looking for the latest Python version, see the
pythonbranch.
Fnug is a TUI command runner that automatically selects and executes lint and test commands based on git changes or file watching. Think of it as a terminal multiplexer (like tmux), but purpose-built for running your dev commands side by side.
Features
- TUI with full keyboard and mouse support — navigate, select, and run commands from a terminal UI
- Git integration — automatically select commands based on uncommitted file changes
- File watching — monitor the file system and re-select commands when files change
- Terminal emulation with scrollback — full PTY support for interactive commands and long output
- Headless mode (
fnug check) — run selected commands without the TUI, useful for CI and pre-commit hooks - Git hook integration (
fnug init-hooks) — install a pre-commit hook that runsfnug check - Search/filter — press
/to filter the command tree - Command dependencies — define
depends_onto control execution order - Environment variables — set per-command or per-group env vars
- Configurable scrollback — set scrollback buffer size per command
- Nested command groups — organize commands into a hierarchical tree with inherited settings
Installation
From crates.io
cargo install fnug
From GitHub Releases
Download a prebuilt binary from GitHub Releases.
With Nix
# Run directly
nix run github:nickolaj-jepsen/fnug
# Or install to profile
nix profile install github:nickolaj-jepsen/fnug
From source
git clone https://github.com/nickolaj-jepsen/fnug.git
cd fnug
cargo install --path .
Usage
Run fnug in a directory with a .fnug.yaml configuration file (or pass -c path/to/config.yaml).
Subcommands
| Command | Description |
|---|---|
fnug |
Launch the TUI |
fnug check |
Run selected commands headlessly (exit code reflects pass/fail) |
fnug check --fail-fast |
Stop on first failure |
fnug init-hooks |
Install a git pre-commit hook that runs fnug check |
fnug init-hooks --force |
Overwrite an existing pre-commit hook |
Configuration
Fnug searches for .fnug.yaml, .fnug.yml, or .fnug.json from the current directory upward.
Minimal example
fnug_version: 0.1.0
name: my-project
commands:
- name: hello
cmd: echo world
Git auto-selection
Select commands based on uncommitted changes. Re-trigger with g in the TUI.
fnug_version: 0.1.0
name: my-project
commands:
- name: lint
cmd: cargo clippy
auto:
git: true
path:
- "./src"
regex:
- "\\.rs$"
File watching
Monitor the file system and select commands when matching files change. Can be combined with git auto.
fnug_version: 0.1.0
name: my-project
commands:
- name: test
cmd: cargo test
auto:
watch: true
path:
- "./src"
regex:
- "\\.rs$"
Nested groups with inheritance
Groups inherit cwd, auto, and env settings from their parent.
fnug_version: 0.1.0
name: my-project
children:
- name: backend
auto:
git: true
watch: true
path:
- "./src"
regex:
- "\\.rs$"
commands:
- name: fmt
cmd: cargo fmt
- name: test
cmd: cargo test
- name: clippy
cmd: cargo clippy
Advanced example
See this project's .fnug.yaml for a full example.
Keyboard Shortcuts
| Key | Context | Action |
|---|---|---|
j / ↓ |
Tree | Move down |
k / ↑ |
Tree | Move up |
h / ← |
Tree | Collapse group / Deselect command |
l / → |
Tree | Expand group / Select command |
Space |
Tree | Toggle expand/select |
Enter |
Tree | Run all selected commands |
r |
Tree | Run current command |
s |
Tree | Stop current command |
c |
Tree | Clear current command |
g |
Tree | Git auto-select |
/ |
Tree | Search/filter commands |
Esc |
Search | Clear search |
L |
Tree | Toggle log panel |
Tab |
Tree | Focus terminal |
Esc |
Terminal | Back to tree |
Ctrl+R |
Global | Toggle fullscreen |
Ctrl+C |
Global | Quit |
q |
Tree | Quit |
Mouse
- Click a tree item to select it
- Double-click a command to run it, or a group to expand/collapse
- Click the selection orb (●/○) or arrow (▼/▶) to toggle
- Drag the separator between tree and terminal to resize
- Scroll wheel in the terminal panel to scroll output
Demo
Old version (pre 0.1.0)
https://github.com/nickolaj-jepsen/fnug/assets/1039554/8f8a4d34-8beb-4fb4-9bbc-6fd0a4a384be
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fnug-0.1.0a3.tar.gz.
File metadata
- Download URL: fnug-0.1.0a3.tar.gz
- Upload date:
- Size: 113.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f9f3baa3853f468eaa55d2a944769ef644ab0e872271c627e9e5d98f258baa1
|
|
| MD5 |
b202e4e8a67b3076e5ab6a97e9e2980b
|
|
| BLAKE2b-256 |
9003d2a5d584f45cef3893a9f3d64167228c1bf511dd60bd2578557f38a6218b
|
File details
Details for the file fnug-0.1.0a3-py3-none-win_amd64.whl.
File metadata
- Download URL: fnug-0.1.0a3-py3-none-win_amd64.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
253fe911f9c931a33bf57c9a9233528d53bbf8e30c0ef1bf0d7bd4556e051071
|
|
| MD5 |
6b880f167137ec2ed3b0c4bb638798a0
|
|
| BLAKE2b-256 |
2450bfe873c4ab242c989996f71941924eb3d469290802814380ee9548938e5f
|
File details
Details for the file fnug-0.1.0a3-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: fnug-0.1.0a3-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95b2a002ed039a4035651da89994c7c60291786995bbddde57db931a46b64d58
|
|
| MD5 |
2d6ded0f4b6e96479c54670fe8aa097d
|
|
| BLAKE2b-256 |
284badcd6513f94c35674dfa1fdaa52dfc96eec3161dd4d48a6d6d666d3ed595
|
File details
Details for the file fnug-0.1.0a3-py3-none-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: fnug-0.1.0a3-py3-none-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 2.4 MB
- Tags: Python 3, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acf26854eb843a48ddc5652541b80740008e44da8cb275dbaf5c16fd84c4fa85
|
|
| MD5 |
fda63400fd604bf9ea2a1807fc108a65
|
|
| BLAKE2b-256 |
7f106aafd87770d86c058e0a4e7272943294edb45e67490d01aa859d459ef46f
|
File details
Details for the file fnug-0.1.0a3-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: fnug-0.1.0a3-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.3 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f26de6c21fd185b266aa20a30290ddbe4017b84b8a00e254fca05a58784e2553
|
|
| MD5 |
5a320d1725170c79fe3c1d695479987b
|
|
| BLAKE2b-256 |
8a59242cefeb901204f29210bde07ae5bae951e3483151985a57db2a886a0248
|
File details
Details for the file fnug-0.1.0a3-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: fnug-0.1.0a3-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69eba131c67be900ed12e2850882c9a0955e40e5e2ee832663af1764813a60c2
|
|
| MD5 |
030911689d7606fb3221caa231cbd130
|
|
| BLAKE2b-256 |
ae599676879c36e9784e904e6cea11d86c1ceedce84b8fad9c8a59e430a003a0
|