MVP: keep only prompts/system_prompt.md and CodexHelper/CodexHelper.sh; remove NEWSTART artifacts

This commit is contained in:
2025-09-17 12:27:58 -05:00
parent 4f5177d214
commit 5773fa03ac
4 changed files with 41 additions and 131 deletions

33
CodexHelper/CodexHelper.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -euo pipefail
# CodexHelper.sh — minimal wrapper to invoke Codex CLI
# - Finds a codex binary (env `CODEX_BIN`, or `codex`, or `codex-cli`)
# - Uses the repository's prompts/system_prompt.md by default
# - Passes through any extra args to the codex binary
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="${SCRIPT_DIR}/.."
SYSTEM_PROMPT_PATH="${REPO_ROOT}/prompts/system_prompt.md"
if [[ ! -f "${SYSTEM_PROMPT_PATH}" ]]; then
echo "Error: system prompt not found at ${SYSTEM_PROMPT_PATH}" >&2
exit 1
fi
# Binary detection per NEWSTART.md guidance
if [[ -n "${CODEX_BIN:-}" ]]; then
BIN="${CODEX_BIN}"
elif command -v codex >/dev/null 2>&1; then
BIN="$(command -v codex)"
elif command -v codex-cli >/dev/null 2>&1; then
BIN="$(command -v codex-cli)"
else
echo "Error: Could not find codex binary. Set CODEX_BIN or install 'codex'/'codex-cli'." >&2
exit 1
fi
# Try a common flag name for supplying a system prompt. Adjust if needed.
# Additional args are forwarded so callers can customize behavior.
exec "${BIN}" --system-prompt "${SYSTEM_PROMPT_PATH}" "$@"