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.0a4.tar.gz (113.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.0a4-py3-none-win_amd64.whl (2.7 MB view details)

Uploaded Python 3Windows x86-64

fnug-0.1.0a4-py3-none-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

fnug-0.1.0a4-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.0a4.tar.gz.

File metadata

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

File hashes

Hashes for fnug-0.1.0a4.tar.gz
Algorithm Hash digest
SHA256 bce24b40dfa356657b88eefd180fc93250bd9463879b579a448fb14f6e2f560d
MD5 251d7ee8e4fbd505ebd1e176905f347a
BLAKE2b-256 9976b938b00464541c88b3f200dbaba89d3b29fd85a1d708afec17f095e9fdbd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fnug-0.1.0a4-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.0a4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 48f282aaf921e4e8af94b99fa82208b4c56153e6e6d30ef8cabccd6a34ee8992
MD5 ca6c6cb569263fa4a71777941b4c9973
BLAKE2b-256 55e5de9330101217d0567c0adccafd902734ed7acbbd834d05fac299bd7a9cf1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a4-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 655dbc1cd5feb9200b2251aa9dfaca66f3574a83b6283260f98bde7fe9d896fe
MD5 7a0583e57c1e6f9caa212256b65178c2
BLAKE2b-256 5a60a6391b8287d6cf4c1e92f2f41ee6fedbd5d13983c5b7c4364c077f9ae8e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a4-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3552e8373805a1be350084cfe8cb7ed1b95d841d223d2fef0772d50102824449
MD5 381ec21f2fe7f4293cdacc5944854a42
BLAKE2b-256 e8d00e735c2faf3c9e4e783799f578a8bee4950ed1436ae8afe90a76e7d06325

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a4-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2235680a2962e44d7074a737a33d7ef1bb2f15bcd98190bd686c63f9ac8c003d
MD5 52919f2e9bd99b57b5c8a8c3f6f8cdd8
BLAKE2b-256 3b27d8696fa4620240ecad44cac87b57ea187ba5fa805aa6ed71c87a12504bbc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a4-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6fab678185f25e933ce9d2bbf4c91f1c3824031533fbdbea3ad2006f749d0b59
MD5 938ea115ecc0b36fd2b48ab7f7b8e723
BLAKE2b-256 643bfda6df4df72b98a19ce3a41a2afadcf8b39733ed8f45d72d5fef12545d17

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