Adds shell integration for automatic Gas Town context detection. Features: - `gt enable` / `gt disable` - Global on/off switch - `gt shell install|remove|status` - Shell integration management - `gt rig quick-add [path]` - One-command project setup - `gt uninstall` - Clean removal with options - Shell hook auto-sets GT_TOWN_ROOT/GT_RIG on cd Implementation: - XDG-compliant state storage (~/.local/state/gastown/) - Safe RC file manipulation with block markers - Environment overrides (GASTOWN_DISABLED/ENABLED) - Doctor check for global state validation Co-authored-by: Sohail Mohammad <sohailm25@gmail.com>
19 lines
522 B
Bash
Executable File
19 lines
522 B
Bash
Executable File
#!/bin/bash
|
|
# ABOUTME: Wrapper script that runs gt prime before launching codex.
|
|
# ABOUTME: Ensures Gas Town context is available in Codex sessions.
|
|
|
|
set -e
|
|
|
|
gastown_enabled() {
|
|
[[ -n "$GASTOWN_DISABLED" ]] && return 1
|
|
[[ -n "$GASTOWN_ENABLED" ]] && return 0
|
|
local state_file="$HOME/.local/state/gastown/state.json"
|
|
[[ -f "$state_file" ]] && grep -q '"enabled":\s*true' "$state_file" 2>/dev/null
|
|
}
|
|
|
|
if gastown_enabled && command -v gt &>/dev/null; then
|
|
gt prime 2>/dev/null || true
|
|
fi
|
|
|
|
exec codex "$@"
|