Skip to content

programmersd21/gitnibble

Repository files navigation

gitnibble

Demo

CI Crates.io Downloads License Platform Built with

Instant, offline-first, context-aware .gitignore generator and manager in Rust with a ratatui-based terminal UI.

Zero network calls by default. Embedded templates for ~60+ languages, frameworks, and tools.

Features

  • Instant cold-start: Sub-20ms startup time with zero async runtime overhead.
  • Safe by Default: Additive-only merges. Never deletes or alters existing custom ignore rules.
  • Context-Aware Workspace Scanner: Scans workspace root to detect languages, frameworks, IDEs, and OS settings.
  • Ratatui TUI: Three-pane interface with 12 curated truecolor themes, fuzzy search, and real-time diff preview.
  • Scriptable CLI: Non-interactive commands with exit codes designed for CI/CD pipelines and git hooks.
  • Zero Network Overhead: Embedded offline templates with optional opt-in --features fetch for remote retrieval.

Themes

catppuccin_mocha, tokyo_night, dracula, nord, obsidian, solarized, gruvbox, rose_pine, everforest, kanagawa, monokai_pro, one_dark

Press t in the TUI to open the theme selector.

Installation

cargo install gitnibble-rs

Or build from source:

git clone https://github.com/programmersd21/gitnibble.git
cd gitnibble
cargo build --release

Keyboard Shortcuts (TUI)

Key Action
j / Down Move selection down
k / Up Move selection up
Space Toggle template selection
a Select all detected templates
c Clear selection
/ Fuzzy search templates
Tab Switch active pane (Stack / Templates / Diff)
r Rescan workspace
t Open theme selector
Enter Apply selected templates to .gitignore
y Copy diff preview to clipboard
? Toggle help modal
q / Esc Quit

CLI Usage

# Detect project stack without launching TUI
gitnibble detect

# Preview changes for specified templates
gitnibble diff Rust Node macOS

# Add templates non-interactively
gitnibble add Rust Node --yes

# Perform dry-run without writing to disk
gitnibble add Python --dry-run

# Launch interactive TUI
gitnibble

Exit Codes (CLI Diff Mode)

  • 0: Success / no pending changes to write
  • 1: Pending changes exist (diff detected)
  • 2: Execution error / template not found

Why not gitignore.io?

  • Offline & Instant: No HTTP requests, latency, or remote server reliance. Works on air-gapped systems.
  • Non-Destructive Merge Engine: Safely appends rules without destroying custom notes or manual rules.
  • CLI & Scripting Composability: Integrates cleanly into pre-commit hooks with meaningful exit codes.

License

MIT