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.0a5.tar.gz (126.2 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.0a5-py3-none-win_amd64.whl (3.5 MB view details)

Uploaded Python 3Windows x86-64

fnug-0.1.0a5-py3-none-manylinux_2_28_x86_64.whl (3.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

fnug-0.1.0a5-py3-none-manylinux_2_28_aarch64.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

fnug-0.1.0a5-py3-none-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

fnug-0.1.0a5-py3-none-macosx_10_12_x86_64.whl (3.1 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for fnug-0.1.0a5.tar.gz
Algorithm Hash digest
SHA256 09ec6aa4863cfd2a36c974ffbfcc81b9b5ab32292e48578042789327807a64f1
MD5 6b750292c16ba734e6293909903cdca2
BLAKE2b-256 b02bf949603100905724e7cbfa4440467dd1d09df74ce583c7dd24e1ffeec527

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fnug-0.1.0a5-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.5 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.0a5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6f56e9b40a22e704014e071b7f5d9078293c63badecbb18de9532ea04ce553a9
MD5 34a197a8ec17c15018987343adcfa4d6
BLAKE2b-256 b205fbeabe89c32310c6b7bfd0f5c54ea927cdaef11fc2dde8a49c8c26c63bda

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a5-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 edb0b0bab4e6bd458ea4c703048bd9339971662e4c0f3501cb09ec9519098a77
MD5 7000e8b49d6b7e8e9e54436a8e6fc714
BLAKE2b-256 ab27a940a7afc569dd7275513f049aa8ff89a537d5857391a6476aa54cc1f51b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a5-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8b74a142c678887665349ee6dada81f429ba570c2d48bf6e6e3f4a78a8bcb97a
MD5 9980486f3a9d4abb1dcaca03c5d825c1
BLAKE2b-256 151b38e5b8ffd259c01a1976644aed4636c50ee2ee90d530fee1c6b22be04470

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1f782a1234da2d8382153908ef6556248c6f1f3d4f4f5579fce8ac9b76c4a318
MD5 3fc512a1983a3206f95276f6ee103c41
BLAKE2b-256 d7f3d00bb7a0938577c409ce98a833684191bf7e5dbc1c3e1ab45e61b09b9577

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a5-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0071a43335e7c764d34970367e94b258c60a2204437e87935be1ae47e481d228
MD5 fce9ea363a48861cf3a4448b64979011
BLAKE2b-256 6734bc3e93d3c6eab2ed5c57046dec5efc54a369ad60280d63b1bcb45cce1085

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