Skip to content

Latest commit

 

History

History
70 lines (51 loc) · 3.34 KB

AGENTS.md

File metadata and controls

70 lines (51 loc) · 3.34 KB

AGENTS.md - fire-git

Bash TUI tool that automates Git config (user.name/user.email). Version 1.2.0 (single copy in src/firegit.sh:4; bump with any version change). No external runtime deps; plain bash.

Layout & Entry Points

  • src/firegit.sh — entry point. Args: -h/--help, --check, --reset, --tutorial, else TUI. Uses set -e. Sources libs in this fixed order: output, detect, validate, tui (order matters only because tui.sh/validate.sh call each other's functions).
  • src/lib/output.sh — banner/help/print functions. detect.sh — OS/env/package-manager detection + install_git (runs eval on install cmd). validate.sh — config check/reset, email regex, extra settings, tutorial. tui.sh — interactive menu.
  • packages/ — packaging stubs (PKGBUILD, .spec, nix, snap). installer.sh is a one-liner piped via curl|bash. DOCS/ — guides. tests/run_tests.sh — suite.

Naming: dionarley everywhere

  • GitHub owner/remote, README, installer, and all package specs use dionarley (git remote is github.com/dionarley/fire-git). The Flatpak id/filename also uses dionarley (flatpak/com.github.dionarley.fire-git.yaml) — the test suite asserts that exact filename (tests/run_tests.sh:176), so keep this casing in all new URLs/package specs.

Commands

./tests/run_tests.sh          # run full suite; exit non-zero on any failure
bash -c 'source tests/run_tests.sh; test_syntax'   # NOTE: sourcing runs the WHOLE suite
bash -n src/firegit.sh && bash -n src/lib/*.sh      # syntax check all
shellcheck src/firegit.sh src/lib/*.sh              # if installed
  • No test framework/packages; tests are static grep checks that assert strings/patterns exist in source (e.g. grep -q "run_tui_menu"). They do not exercise runtime behavior, so a passing suite does not prove the tool runs — run the script manually too.
  • Test invocations at the bottom of run_tests.sh are unguarded (no module guard), so source it triggers the whole suite once, then your target a 2nd time. Fine for a single re-run.

Runtime Env Vars

  • GIT_NAME, GIT_EMAIL (skip prompts; read directly), APPLY_ADDITIONAL (default true).

Docker (buildable image)

docker compose run --rm test    # build + run suite; 19/19 exit non-zero on failure
docker run --rm -it fire-git-dev                # interactive TUI
docker run --rm fire-git-dev --check           # flags append to ENTRYPOINT

An Alpine (3.20) image installing bash/git/shellcheck. The Dockerfile uses ENTRYPOINT, so args append as subcommands; docker run fire-git-dev --check works via entrypoint append. Compose test/dev mount . to /app; override the test entrypoint via compose, not command (because command would replace the ENTRYPOINT, not append to it).

Gotchas

  • Only touches Git config via --global; the Flatpak manifest uses --filesystem=home / --share=network / --device=all — keep sandbox minimal when editing.

Style

  • Functions snake_case; variables/consts UPPER_SNAKE_CASE; scripts/lowercase.
  • 2-space indent; quote all expansions ("$VAR"); set -e; shebang #!/usr/bin/env bash.
  • Output via print_info/success/warning/error; comments minimal.
  • Never commit creds/tokens.

Commit Style (imperative)

"Add TUI menu system", "Fix existing config check logic", "Update runtime to 23.08".