igt (ignore + TUI) is an interactive CLI tool for managing .gitignore templates from the official github/gitignore repository.
- 🎨 Interactive TUI - Beautiful terminal UI with fuzzy search and multi-select
- 📦 Smart Caching - Local cache with configurable TTL (default 7 days)
- 🔄 Section Management - Update templates without losing custom rules
- 🌐 GitHub Integration - Fetch templates directly from github/gitignore
- 🚀 Fast & Lightweight - Single binary with no dependencies
- 🔍 Fuzzy Search - Quickly find templates with incremental filtering
- 📋 Preview Mode - Dry-run to see changes before applying
brew tap mather/igt
brew install igtgo install github.com/mather/igt/cmd/igt@latestgit clone https://github.com/mather/igt.git
cd igt
go build -o igt ./cmd/igtSimply run igt to launch the interactive template selector:
igtUse the arrow keys to navigate, space or tab to toggle selection, enter to confirm, and esc to cancel.
Pass template names as arguments to skip the TUI:
igt Go Node PythonShow all available templates grouped by category:
igt --listSearch for specific templates:
igt --list | grep -i pythonUse dry-run mode to preview what would be added:
igt --dry-run Go NodeForce refresh the template cache from GitHub:
igt --refreshSpecify a custom output file:
igt --output path/to/.gitignore Goigt manages templates using marked sections in your .gitignore:
# Your custom rules
*.log
/dist/
### igt: Go ###
*.exe
*.test
### igt: Go ###
### igt: Node ###
node_modules/
npm-debug.log
### igt: Node ###When you re-run igt and select templates:
- Existing managed sections (between
### igt: Name ###markers) are updated - Your custom rules (outside markers) are preserved
- New templates are added at the end
- The
igt:prefix prevents conflicts with template content
Templates are cached locally in ~/.cache/igt/templates/ with a 7-day TTL:
- First run downloads the entire repository as a zip archive (one HTTP request)
- Subsequent runs use cached templates
- Cache automatically refreshes after TTL expires
- Use
--refreshto force immediate update
Since igt downloads the entire repository once and caches it locally:
- No rate limiting issues
- Works offline after initial download
- Fast subsequent operations
Usage:
igt [flags] [<template>...]
Flags:
-o, --output string Output file path (default: .gitignore)
-r, --refresh Force refresh cache
-l, --list List all templates
-n, --dry-run Dry run mode (preview changes)
-h, --help Show help
-v, --version Show version
Examples:
igt # Interactive mode
igt Go Node # Non-interactive mode
igt -l | grep -i go # List and search templates
igt -n Go # Preview changes
igt -r # Refresh cache and select
Templates are organized into three categories:
- Language - Programming language-specific templates (e.g., Go, Python, Java)
- Global - OS and editor-specific templates (e.g., macOS, Windows, Vim)
- Community - Community-contributed templates
igt/
├── cmd/igt/ # CLI entry point
├── internal/
│ ├── fetcher/ # GitHub API & caching
│ ├── merger/ # .gitignore parser & merger
│ ├── template/ # Data models
│ └── ui/ # Bubble Tea TUI
├── go.mod
└── README.md
go test ./internal/... -vgo build -o igt ./cmd/igtigt differentiates itself with:
- Interactive TUI with fuzzy search
- Managed sections that preserve custom rules
- Built-in caching with TTL
MIT
Contributions are welcome! Please feel free to submit a Pull Request.