mirror of https://github.com/garrytan/gstack.git
fix: add --local flag for project-scoped gstack install
Users evaluating gstack in a project fork currently have no way to avoid polluting their global ~/.claude/skills/ directory. The --local flag installs skills to ./.claude/skills/ in the current working directory instead, so Claude Code picks them up only for that project. Codex is not supported in local mode (it doesn't read project-local skill directories). Default behavior is unchanged. Fixes #229
This commit is contained in:
parent
1f4b6fd7a2
commit
eb2a356210
23
setup
23
setup
|
|
@ -17,12 +17,14 @@ case "$(uname -s)" in
|
||||||
MINGW*|MSYS*|CYGWIN*|Windows_NT) IS_WINDOWS=1 ;;
|
MINGW*|MSYS*|CYGWIN*|Windows_NT) IS_WINDOWS=1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# ─── Parse --host flag ─────────────────────────────────────────
|
# ─── Parse flags ──────────────────────────────────────────────
|
||||||
HOST="claude"
|
HOST="claude"
|
||||||
|
LOCAL_INSTALL=0
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--host) HOST="$2"; shift 2 ;;
|
--host) HOST="$2"; shift 2 ;;
|
||||||
--host=*) HOST="${1#--host=}"; shift ;;
|
--host=*) HOST="${1#--host=}"; shift ;;
|
||||||
|
--local) LOCAL_INSTALL=1; shift ;;
|
||||||
*) shift ;;
|
*) shift ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
@ -32,6 +34,18 @@ case "$HOST" in
|
||||||
*) echo "Unknown --host value: $HOST (expected claude, codex, or auto)" >&2; exit 1 ;;
|
*) echo "Unknown --host value: $HOST (expected claude, codex, or auto)" >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# --local: install to .claude/skills/ in the current working directory
|
||||||
|
if [ "$LOCAL_INSTALL" -eq 1 ]; then
|
||||||
|
if [ "$HOST" = "codex" ]; then
|
||||||
|
echo "Error: --local is only supported for Claude Code (not Codex)." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
SKILLS_DIR="$(pwd)/.claude/skills"
|
||||||
|
mkdir -p "$SKILLS_DIR"
|
||||||
|
HOST="claude"
|
||||||
|
INSTALL_CODEX=0
|
||||||
|
fi
|
||||||
|
|
||||||
# For auto: detect which agents are installed
|
# For auto: detect which agents are installed
|
||||||
INSTALL_CLAUDE=0
|
INSTALL_CLAUDE=0
|
||||||
INSTALL_CODEX=0
|
INSTALL_CODEX=0
|
||||||
|
|
@ -212,7 +226,12 @@ SKILLS_BASENAME="$(basename "$SKILLS_DIR")"
|
||||||
if [ "$INSTALL_CLAUDE" -eq 1 ]; then
|
if [ "$INSTALL_CLAUDE" -eq 1 ]; then
|
||||||
if [ "$SKILLS_BASENAME" = "skills" ]; then
|
if [ "$SKILLS_BASENAME" = "skills" ]; then
|
||||||
link_claude_skill_dirs "$GSTACK_DIR" "$SKILLS_DIR"
|
link_claude_skill_dirs "$GSTACK_DIR" "$SKILLS_DIR"
|
||||||
echo "gstack ready (claude)."
|
if [ "$LOCAL_INSTALL" -eq 1 ]; then
|
||||||
|
echo "gstack ready (project-local)."
|
||||||
|
echo " skills: $SKILLS_DIR"
|
||||||
|
else
|
||||||
|
echo "gstack ready (claude)."
|
||||||
|
fi
|
||||||
echo " browse: $BROWSE_BIN"
|
echo " browse: $BROWSE_BIN"
|
||||||
else
|
else
|
||||||
echo "gstack ready (claude)."
|
echo "gstack ready (claude)."
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue