gi
gi is a local gitignore.io-style generator written in Go.
This project embeds a snapshot of gitignore templates from assets/gitignore.json
and provides a small CLI named gi for merging templates locally, without any
network requests at runtime.
Why this exists
The hosted service at https://www.toptal.com/developers/gitignore depends on
network access. In practice, it can also be blocked by Cloudflare bot checks,
which makes command-line usage unreliable and causes a relatively high failure
rate for automated or repeated requests.
This tool exists to avoid that problem entirely: it keeps the template dataset
locally in the repository and generates merged .gitignore output offline.
Install
go install github.com/tbxark/gitignore/cmd/gi@latest
Usage
Print one or more merged templates to standard output:
gi go,node
Tag matching is case-insensitive for both template key and name:
gi Go,Node
List all supported tags:
gi --tags
Print the build version:
gi --version
Behavior
- Uses only embedded local data
- Accepts comma-separated tags
- Deduplicates repeated tags while keeping first-seen order
- Writes merged
.gitignore content to standard output
- Writes usage and errors to standard error
Data Source
Template data is embedded from:
The repository also includes helper assets used to refresh that dataset.