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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

File metadata

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

File hashes

Hashes for fnug-0.1.0a6.tar.gz
Algorithm Hash digest
SHA256 566e68106603e1deef7a2ad1f8efc9e80dc6a4a592fcc5269190f1772ef00972
MD5 3a4187870a608dffd17cc97e364bee0f
BLAKE2b-256 487f9f8c55d7bed6ed0a88d35ca4dbaa8ac018e8e11e8f2a5f69d799d63d4df1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fnug-0.1.0a6-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.0a6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6a118bf1da302d43ce293628b1a58b790eacc824fccb523c9030da8787c91046
MD5 b2e9d7362d5dcbc230d3ffce81a6d6d8
BLAKE2b-256 63519d1e04c6df59c75514f74fb9b440c3d7923bc709d981026eac4a7d138677

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a6-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 32f5ac6fe54eef11f87a207adf57414e34268d351cce8f4d258f42f961d4e07e
MD5 8bbe7b71aeb1b914177acd6d938e3e25
BLAKE2b-256 97eb9460f0500a216d321dfe9f5bdda175239cea02dbde5c55138f216db9a1b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a6-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d89248d7128ad32d0aa5483c791278715f3b5229191fdb3ac42e87ac3797b361
MD5 9870888801b928b175e60737936f705f
BLAKE2b-256 f754895876c732ce98b096a5f9739bba3c9124086a37081a995a1dda27c74774

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a6-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a40d23c2d2ae4073e5d6655ee61713ffc2b7166a380980c2312cda1212893474
MD5 b5ea29b630e0101d903e3968e035a0e2
BLAKE2b-256 a33b1b4f63068cb948a70e98b76bdbac20227639eca8049e67adb57a005c1c95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fnug-0.1.0a6-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0ff1ef312ab9c0c1e93204a54b48cc392d70ba155cad13de1aa4b888b43089ea
MD5 e74206b15202f9fb77358f4b6a6e384d
BLAKE2b-256 5e2c975022fa7f89f9c29af0704a673d41a83c89d2a8b72073c0c2e40bd22691

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