From 2f7eae9ef37f877e180b759454a0dcf4360dfb7d Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Thu, 18 Dec 2025 21:44:38 +0100 Subject: [PATCH 1/2] installs codex the same way as chrome-devtools-mcp --- bin/y-chrome-devtools-mcp | 2 +- bin/y-openai-codex | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100755 bin/y-openai-codex diff --git a/bin/y-chrome-devtools-mcp b/bin/y-chrome-devtools-mcp index 71c9cc40..eb263904 100755 --- a/bin/y-chrome-devtools-mcp +++ b/bin/y-chrome-devtools-mcp @@ -18,7 +18,7 @@ else ACTUAL_VERSION=$VERSION fi -BIN_DIR="$YBIN/y-$PACKAGE_NAME-$ACTUAL_VERSION-bin" +BIN_DIR="$YBIN/$(basename $0)-$ACTUAL_VERSION-bin" # Download and install if not already cached if [ ! -d "$BIN_DIR" ]; then diff --git a/bin/y-openai-codex b/bin/y-openai-codex new file mode 100755 index 00000000..45872c57 --- /dev/null +++ b/bin/y-openai-codex @@ -0,0 +1,37 @@ +#!/bin/sh +[ -z "$DEBUG" ] || set -x +set -e + +YBIN="$(dirname $0)" +PACKAGE_NAME="@openai/codex" +VERSION="latest" + +if ! command -v npm &> /dev/null; then + echo "npm is required but not installed" 1>&2 + exit 1 +fi + +# Get the package version info +if [ "$VERSION" = "latest" ]; then + ACTUAL_VERSION=$(cd $YBIN; npm view $PACKAGE_NAME version) +else + ACTUAL_VERSION=$VERSION +fi + +BIN_DIR="$YBIN/$(basename $0)-$ACTUAL_VERSION-bin" + +# Download and install if not already cached +if [ ! -d "$BIN_DIR" ]; then + echo "Installing $PACKAGE_NAME@$ACTUAL_VERSION..." 1>&2 + + TEMP_DIR=$(mktemp -d) + trap "rm -rf $TEMP_DIR" EXIT + + cd "$TEMP_DIR" + npm install "$PACKAGE_NAME@$ACTUAL_VERSION" --prefix . --no-save --omit=dev --ignore-scripts + + # Move the installed package to cache + mv "$TEMP_DIR/node_modules/$PACKAGE_NAME" "$BIN_DIR" +fi + +/usr/bin/env node $BIN_DIR/bin/codex.js "$@" From 34311008c5de3e6c7836b21aff9c284dd14bfd74 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Thu, 25 Dec 2025 16:19:34 +0100 Subject: [PATCH 2/2] LLMs tend to use npx even when there is tooling available leading to unnecessary command un-confirmation and correction prompts --- README.md | 2 +- bin/npx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100755 bin/npx diff --git a/README.md b/README.md index fb08217f..3f87ef81 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Add the following to env: ``` export YSTACK_HOME=/Users/me/Yolean/ystack -export PATH=$PATH:$YSTACK_HOME/bin +export PATH=$YSTACK_HOME/bin:$PATH ``` Note that ystach should be after system path entries because it contains fallback impls for MacOS such as `basepath` and `sha256sum`. diff --git a/bin/npx b/bin/npx new file mode 100755 index 00000000..2bd6f213 --- /dev/null +++ b/bin/npx @@ -0,0 +1,3 @@ +#!/usr/bin/env sh +echo "npx disallowed with ystack (use explicitly installed dependencies instead)" >&2 +exit 1