Skip to content

gi

Usage
gi [-h] [-b] [-p] [-o] [-s] [-f] [-c TEMPLATE] [-l] [targets...]

Generates .gitignore content by querying the gitignore.io API. Appends results to the repository’s .gitignore with MD5-based deduplication — patterns already present are not re-appended — or prints to stdout with -o/--stdout. Boilerplate mode uses $GITIGNORE_BOILERPLATE if set, a -c/--custom template if given, or falls back to the bundled standard template (data/gi/boilerplate.gitignore) when neither is configured. Supports generic boilerplate and interactive prompt modes.

-h, --help Show help message
-d, --description Show the function description
-l, --list List all supported targets from the API
-b, --boilerplate Append boilerplate (implied by -c)
-p, --prompt Prompt for patterns to append
-o, --stdout Print generated content to stdout instead of .gitignore
-s, --silent Suppress progress output (errors and prompts still show)
-f, --force Bypass prompts, proceeding with the default action
-c, --custom PATH Use PATH as the boilerplate template instead of $GITIGNORE_BOILERPLATE
targets Comma- or space-separated list of language/tool names
0 Patterns appended, or resolved with -o/--stdout or -l/--list
1 Not in a git repository, API fetch failed, or curl is not installed
2 Unknown option

With -o/--stdout, the fetched .gitignore pattern text, printed to stdout. With -l/--list, the supported target list, printed to stdout.

Terminal window
gi python,venv
gi -b -p
gi -o node > .gitignore
gi -f # skip prompt, proceed with no patterns
gi -c ~/my-template.gitignore

Dependencies: curl, md5sum, md5, gitignore-scrub

Classification: self-limiting(grep,cat), network, blocking-prompt