mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-22 08:01:32 +01:00
`./setup --host codex` now adds gstack's skill-routing hint and destructive-command check to Codex's `~/.codex/hooks.json`, next to your own hooks, so Codex users get the same guardrails Claude Code users have. Codex runs a hook only after you trust it, so nothing fires until you accept gstack's hooks at Codex's startup prompt or in `/hooks`; `gstack-doctor` shows whether you have. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/red-team#1 reader=red-team
12 lines
737 B
Bash
Executable File
12 lines
737 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Bash shim for Codex: Codex runs hook commands through a login shell, so this
|
|
# wrapper makes the TypeScript hook executable via bun. ${CODEX_HOME}/hooks.json
|
|
# references it through the Codex runtime root (${CODEX_HOME}/skills/gstack,
|
|
# whose hosts/codex/hooks links here), so pwd -P finds the checkout.
|
|
#
|
|
# FAIL-OPEN: every failure path — bun missing, script crash — still exits 0.
|
|
GSTACK_BUN_CONFIG=/dev/null; case "${OSTYPE:-}" in msys*|cygwin*) if command -v cygpath >/dev/null 2>&1; then GSTACK_BUN_CONFIG=NUL; fi ;; esac
|
|
HERE="$(cd "$(dirname "$0")" && pwd -P)" || exit 0
|
|
GSTACK_HOOK_HOST=codex bun --no-env-file --config="${GSTACK_BUN_CONFIG:-/dev/null}" "$HERE/codex-skill-route-hook.ts" || true
|
|
exit 0
|