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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

File metadata

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

File hashes

Hashes for fnug-0.1.0a7.tar.gz
Algorithm Hash digest
SHA256 98eff55dec1b40aaea65bba1437d7767569d2b96e460922b1d1cd61005cd5900
MD5 de675fc45889906cdbe7d619a1edb50a
BLAKE2b-256 4570cbbe765883a48af15387cccc1df7f6ed42c7c1a484705f1195fc6675968b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fnug-0.1.0a7-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.0a7-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 16648027eccde4f6d3963148d605cd46d5e3a0795f6cf02acaed9a2a82d39e75
MD5 5794a54a1a51371ba50d4abe9f0e9404
BLAKE2b-256 33a51c1be47ce8c0c42c8a9c88bd5ca17bfe4706493c11dd7cf9a004e9f449fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a7-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 be287281c2b67929e287c904072ba3cedb5dc0c0abd70b54b0388d66dfcc727e
MD5 83791d25386bd75e1faf03587bab9f01
BLAKE2b-256 35b7842e9d8fad6627f295781d79a0f8b781bb12074dd51403c1dbdf13258b64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a7-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0981908d198892e2232c000ae35454cf49558559a2425b25fc478fbcd5f807d6
MD5 c47854256a2657dca0c7108f987c6228
BLAKE2b-256 b22ae5d8ab3a61e8f129ca8d9344489fc977043d36c8b330b7ca77d9b42919e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a7-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 afff0b3e173028a5b9baf6a12742003b65973cc5e44e579ce461c630845d8ec0
MD5 1ce94ebe6ea0fbed1c57d0ce3294bd36
BLAKE2b-256 19d78ead24709c6060e8e5737c362675e0ab585ee469cf8ad026e174f829451a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a7-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 aa7261e05f6bb4a62aa8fbd5dab6487e038ae001dafca005ce32a0d592543a48
MD5 e113fe8c787301fa21d1ca976f92ff37
BLAKE2b-256 96fd754c8da5534443ddc53135f61de2d89fa3fcce596388f36656d8b1590fc4

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