feat(gi): bundled boilerplate fallback + -c/--custom template flag #179

Merged
rootiest merged 1 commits from feat/gi-boilerplate-fallback-and-custom into main 2026-09-24 04:54:42 +00:00
1 Commits
Author SHA1 Message Date
rootiest 8b08b4d5e5 feat(gi): bundled boilerplate fallback + -c/--custom template flag
CI / test (pull_request) Skipped
Boilerplate mode used to hard-error when $GITIGNORE_BOILERPLATE was unset,
so gi -b/-c only worked for users with a personal template configured
(typically via .user-dots). Add a resolution chain:

  1. -c/--custom PATH, if given
  2. $GITIGNORE_BOILERPLATE, if set
  3. bundled standard template (data/gi/boilerplate.gitignore)

The bundled template covers common OS junk, scratch/debug/temp dirs, and
AI tool session state (.claude*, .gemini*, .antigravity*, .agy*, .agents*,
.remember*) -- but deliberately does NOT ignore CLAUDE.md/AGENTS.md/
GEMINI.md/ANTIGRAVITY.md themselves, since committing those is increasingly
normal and agents-init already owns their placement.

-c implies boilerplate mode (like -b) so `gi -c template` works standalone.

Also fixes a latent bug in gi's final line: `test $needs_git -eq 1; and
gitignore-scrub` leaked its own boolean as the function's exit status
whenever needs_git was 0, so e.g. `gi -o python` returned 1 on success.
Same seam this change already touches; fixed with an explicit `return 0`.
2026-09-24 00:41:34 -04:00