From 162294362f6cf3377bdfd4a9c8d214a154eca2e6 Mon Sep 17 00:00:00 2001 From: Chris La Date: Tue, 10 Mar 2026 12:39:50 -0700 Subject: [PATCH 1/2] Default INSTALL_DIR to current directory instead of /usr/local/bin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When run by strawhub, INSTALL_DIR is set to the package directory. Remove sudo fallback — error out if target directory is not writable. Co-Authored-By: Claude Opus 4.6 --- strawpot_codex/install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/strawpot_codex/install.sh b/strawpot_codex/install.sh index 2e8850a..2546356 100644 --- a/strawpot_codex/install.sh +++ b/strawpot_codex/install.sh @@ -12,9 +12,10 @@ case "$OS" in *) echo "Unsupported OS: $OS" >&2; exit 1 ;; esac -# Default install directory +# Default install directory — current working directory. +# When run by strawhub, INSTALL_DIR is set to the package directory. if [ -z "$INSTALL_DIR" ]; then - INSTALL_DIR="/usr/local/bin" + INSTALL_DIR="$(pwd)" fi # Detect architecture @@ -44,8 +45,8 @@ mkdir -p "$INSTALL_DIR" if [ -w "$INSTALL_DIR" ]; then mv "${BINARY_NAME}" "${INSTALL_DIR}/${BINARY_NAME}" else - echo "Moving to ${INSTALL_DIR} (requires sudo)..." - sudo mv "${BINARY_NAME}" "${INSTALL_DIR}/${BINARY_NAME}" + echo "Error: cannot write to ${INSTALL_DIR}" >&2 + exit 1 fi echo "Installed to ${INSTALL_DIR}/${BINARY_NAME}" From 435c942b1d8d6ad25dd31485234564004efdf6d4 Mon Sep 17 00:00:00 2001 From: Chris La Date: Fri, 13 Mar 2026 16:33:05 -0700 Subject: [PATCH 2/2] Add npm as tool prerequisite in AGENT.md Declares npm as a required tool so that validate_agent() can detect when Node.js is missing before attempting to install the CLI. Co-Authored-By: Claude Opus 4.6 --- strawpot_codex/AGENT.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/strawpot_codex/AGENT.md b/strawpot_codex/AGENT.md index eb78afe..ab24a9b 100644 --- a/strawpot_codex/AGENT.md +++ b/strawpot_codex/AGENT.md @@ -10,6 +10,8 @@ metadata: macos: curl -fsSL https://raw.githubusercontent.com/strawpot/strawpot_codex_cli/main/strawpot_codex/install.sh | sh linux: curl -fsSL https://raw.githubusercontent.com/strawpot/strawpot_codex_cli/main/strawpot_codex/install.sh | sh tools: + npm: + description: Node.js package manager (https://nodejs.org) codex: description: OpenAI Codex CLI install: