aboutsummaryrefslogtreecommitdiff
path: root/scripts/install-ai.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/install-ai.sh')
-rwxr-xr-xscripts/install-ai.sh29
1 files changed, 21 insertions, 8 deletions
diff --git a/scripts/install-ai.sh b/scripts/install-ai.sh
index a5b38a8..7007eed 100755
--- a/scripts/install-ai.sh
+++ b/scripts/install-ai.sh
@@ -30,8 +30,11 @@ Bootstrap .ai/ in PROJECT_PATH from canonical content at $CANONICAL.
--track Track .ai/ in the project's git history (with .gitkeep
files inside otherwise-empty sessions/, references/,
retrospectives/).
- --gitignore Append .ai/ to the project's .gitignore so session
- records stay local.
+ --gitignore Gitignore the project's personal tooling (.ai/, .claude/,
+ CLAUDE.md, AGENTS.md) so it stays local. .claude/ is
+ rulesets-owned and re-synced each startup, so git isn't how
+ it travels; ignoring it also keeps private rule copies out
+ of the repo.
If neither flag is given, the script prompts interactively.
If PROJECT_PATH is omitted, fzf-picks from ~/code/* + ~/projects/*
@@ -147,14 +150,24 @@ case "$track_mode" in
touch "$project/.ai/retrospectives/.gitkeep"
;;
gitignore)
- if [ -f "$project/.gitignore" ] && grep -qFx '.ai/' "$project/.gitignore"; then
- : # already present
- else
+ # Personal-tooling files that stay out of git in gitignore mode. .ai/
+ # holds session records; .claude/ is rulesets-owned bundle content
+ # (re-synced each startup, and it carries private rule copies); CLAUDE.md
+ # and AGENTS.md are personal tooling, project-owned but never committed.
+ # Append only the lines not already present, so a project that already
+ # ignores some of them isn't duplicated.
+ gi="$project/.gitignore"
+ needed=()
+ for pat in '.ai/' '.claude/' 'CLAUDE.md' 'AGENTS.md'; do
+ if [ -f "$gi" ] && grep -qFx "$pat" "$gi"; then continue; fi
+ needed+=("$pat")
+ done
+ if [ "${#needed[@]}" -gt 0 ]; then
{
- [ -s "$project/.gitignore" ] && echo ""
+ [ -s "$gi" ] && echo ""
echo "# Claude Code per-project tooling"
- echo ".ai/"
- } >> "$project/.gitignore"
+ printf '%s\n' "${needed[@]}"
+ } >> "$gi"
fi
;;
esac