Skip to main content

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 python branch.

CI Crates.io

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.

image

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 runs fnug check
  • Search/filter — press / to filter the command tree
  • Command dependencies — define depends_on to 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fnug-0.1.0a2.tar.gz (112.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fnug-0.1.0a2-py3-none-win_amd64.whl (2.7 MB view details)

Uploaded Python 3Windows x86-64

fnug-0.1.0a2-py3-none-manylinux_2_28_x86_64.whl (2.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

fnug-0.1.0a2-py3-none-manylinux_2_28_aarch64.whl (2.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

fnug-0.1.0a2-py3-none-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

fnug-0.1.0a2-py3-none-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file fnug-0.1.0a2.tar.gz.

File metadata

  • Download URL: fnug-0.1.0a2.tar.gz
  • Upload date:
  • Size: 112.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.4

File hashes

Hashes for fnug-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 e9f5d174c0afa23a17a210080bd3a323503818b58a78bbce56802c67c6febf24
MD5 8d6cc87fa8fa23f74797bdede7979028
BLAKE2b-256 d2c5a14d41ed09e1bdc508a2825add5e64f2c8879f6ad90b3566a3b39e487b5a

See more details on using hashes here.

File details

Details for the file fnug-0.1.0a2-py3-none-win_amd64.whl.

File metadata

  • Download URL: fnug-0.1.0a2-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

Hashes for fnug-0.1.0a2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9719da230d0da6c221899575efd157f731d704808ac041d1af32c4d48f2374f5
MD5 60ddfd40e338806ca605b4da6c0b606c
BLAKE2b-256 82fb88f63a78d55f2c21feed2a187f45e768384b40e5572dbefbb4f2e7ae5a90

See more details on using hashes here.

File details

Details for the file fnug-0.1.0a2-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for fnug-0.1.0a2-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 74b08dab6456962172dc31a9cd4edb4397993d746c46ccb8bc715da38aa44bd2
MD5 2fee692b911b822e727daa38e31faad9
BLAKE2b-256 5a6a54d45b4dde5fbb41d3c8bf35a53ed4894c6ba3fd8e27f1bf13340baca006

See more details on using hashes here.

File details

Details for the file fnug-0.1.0a2-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for fnug-0.1.0a2-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0f8767c936b0d9b155590eb7c5f0dff88c4e050a7b7e2122a3f6d11e59d578f2
MD5 8dd2398d62b580d322a252b4688469b8
BLAKE2b-256 9888ccf1ba3f0f3f6a1cc7183bac4de91cfb67a89ab7e5804328bff9e545f12a

See more details on using hashes here.

File details

Details for the file fnug-0.1.0a2-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for fnug-0.1.0a2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6352ad032b7c1f0f092907e453c8b99045e5a51d24cdc18ed6aee5fbe6ab8723
MD5 5f30801448e7f2e3d3233d877cbde3b8
BLAKE2b-256 43141d692d9fb466fff2d96badb59664ed7b6af26d6800f8bb4450a17a0b418a

See more details on using hashes here.

File details

Details for the file fnug-0.1.0a2-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for fnug-0.1.0a2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4a8cd721959d8a4bff202ca4a062910da86646a7bb7ede127eb6a33e4c023c1f
MD5 66fbabea93adf5b0ab26a9830d721791
BLAKE2b-256 0664abf7c9b2fe38237cdaf317c98d4f6dacd23b4d6c23744d913390bf48c9d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page