From 8515f550437ee50fddca60ad4e545878167963fc Mon Sep 17 00:00:00 2001 From: Daniel Rosales Date: Thu, 30 Apr 2026 18:09:54 +0000 Subject: [PATCH 1/4] feat: update the codex install scripts to use a tag --- README.md | 6 ++++-- codex-install.ps1 | 31 ++++++++++++++++--------------- codex-install.sh | 18 ++++++++++++++---- 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 18c1854..d3c3f8c 100644 --- a/README.md +++ b/README.md @@ -78,12 +78,14 @@ Run the `claude` command to start the agent, then follow these steps: **macOS / Linux:** ```bash -curl -sSL https://raw.githubusercontent.com/gemini-cli-extensions/data-agent-kit-starter-pack/0.1.1/codex-install.sh | bash +# Pass the version as a parameter if you want to pin to a specific release +curl -sSL https://raw.githubusercontent.com/gemini-cli-extensions/data-agent-kit-starter-pack/0.1.1/codex-install.sh | bash -s -- 0.1.1 ``` **Windows:** ```powershell -irm https://raw.githubusercontent.com/gemini-cli-extensions/data-agent-kit-starter-pack/0.1.1/codex-install.ps1 | iex +# Pass the version as a parameter if you want to pin to a specific release +& ([scriptblock]::Create((irm https://raw.githubusercontent.com/gemini-cli-extensions/data-agent-kit-starter-pack/0.1.1/codex-install.ps1))) -Tag 0.1.1 ``` 2. **Install the plugin in Codex:** diff --git a/codex-install.ps1 b/codex-install.ps1 index 990fe55..d29e3b2 100644 --- a/codex-install.ps1 +++ b/codex-install.ps1 @@ -12,6 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +param( + [Parameter(Mandatory = $false)] + [string]$Tag +) + $ErrorActionPreference = "Stop" $pluginName = "data-agent-kit-starter-pack" @@ -56,25 +61,21 @@ Write-Host "--- $pluginName Installer for Codex ---" New-Item -ItemType Directory -Force -Path $pluginsRoot | Out-Null if (Test-Path $installDir) { - try { - & git -C $installDir rev-parse --is-inside-work-tree 2>$null | Out-Null - } catch { - } + Write-Host "Removing existing plugin at $installDir for clean install..." + Remove-Item -LiteralPath $installDir -Recurse -Force +} - if ($LASTEXITCODE -eq 0) { - Write-Host "Updating existing plugin at $installDir..." - Invoke-GitCommand -Arguments @("-C", $installDir, "pull") - } else { - Write-Host "Existing directory at $installDir is not a valid git checkout. Reinstalling..." - Remove-Item -LiteralPath $installDir -Recurse -Force - Write-Host "Cloning plugin to $installDir..." - Invoke-GitCommand -Arguments @("clone", $repoUrl, $installDir) - } +if ($Tag) { + Write-Host "Cloning plugin version $Tag to $installDir..." + Invoke-GitCommand -Arguments @("clone", "--depth", "1", "--branch", $Tag, $repoUrl, $installDir) } else { - Write-Host "Cloning plugin to $installDir..." - Invoke-GitCommand -Arguments @("clone", $repoUrl, $installDir) + Write-Host "Cloning plugin default branch to $installDir..." + Invoke-GitCommand -Arguments @("clone", "--depth", "1", $repoUrl, $installDir) } +Write-Host "Removing git metadata..." +Remove-Item -LiteralPath (Join-Path $installDir ".git") -Recurse -Force + if (-not (Test-Path $marketplaceFile)) { Write-Host "Creating new personal marketplace..." Write-TextFileNoBom -Path $marketplaceFile -Content '{"name":"personal","plugins":[]}' diff --git a/codex-install.sh b/codex-install.sh index 761a036..2cee6aa 100755 --- a/codex-install.sh +++ b/codex-install.sh @@ -15,6 +15,8 @@ set -e +TAG=$1 + PLUGIN_NAME="data-agent-kit-starter-pack" REPO_URL="https://github.com/gemini-cli-extensions/data-agent-kit-starter-pack" INSTALL_DIR="$HOME/.agents/plugins/$PLUGIN_NAME" @@ -25,13 +27,21 @@ echo "--- $PLUGIN_NAME Installer for Codex ---" # 1. Download/Update Plugin Content mkdir -p "$HOME/.agents/plugins" if [ -d "$INSTALL_DIR" ]; then - echo "Updating existing plugin at $INSTALL_DIR..." - cd "$INSTALL_DIR" && git pull + echo "Removing existing plugin at $INSTALL_DIR for clean install..." + rm -rf "$INSTALL_DIR" +fi + +if [ -n "$TAG" ]; then + echo "Cloning plugin version $TAG to $INSTALL_DIR..." + git clone --depth 1 --branch "$TAG" "$REPO_URL" "$INSTALL_DIR" else - echo "Cloning plugin to $INSTALL_DIR..." - git clone "$REPO_URL" "$INSTALL_DIR" + echo "Cloning plugin default branch to $INSTALL_DIR..." + git clone --depth 1 "$REPO_URL" "$INSTALL_DIR" fi +echo "Removing git metadata..." +rm -rf "$INSTALL_DIR/.git" + # 2. Register with Codex Marketplace if [ ! -f "$MARKETPLACE_FILE" ]; then echo "Creating new personal marketplace..." From cb1c0b182a83de052922c16030428ff04fecb286 Mon Sep 17 00:00:00 2001 From: Daniel Rosales Date: Thu, 30 Apr 2026 18:19:12 +0000 Subject: [PATCH 2/4] update readme --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index d3c3f8c..fdba479 100644 --- a/README.md +++ b/README.md @@ -78,13 +78,11 @@ Run the `claude` command to start the agent, then follow these steps: **macOS / Linux:** ```bash -# Pass the version as a parameter if you want to pin to a specific release curl -sSL https://raw.githubusercontent.com/gemini-cli-extensions/data-agent-kit-starter-pack/0.1.1/codex-install.sh | bash -s -- 0.1.1 ``` **Windows:** ```powershell -# Pass the version as a parameter if you want to pin to a specific release & ([scriptblock]::Create((irm https://raw.githubusercontent.com/gemini-cli-extensions/data-agent-kit-starter-pack/0.1.1/codex-install.ps1))) -Tag 0.1.1 ``` From d41de2fece32fe8f3c3d2a0d08c8c5304c829bc6 Mon Sep 17 00:00:00 2001 From: Daniel Rosales Date: Thu, 30 Apr 2026 19:40:04 +0000 Subject: [PATCH 3/4] fix the ps script --- README.md | 2 +- codex-install.ps1 | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fdba479..e6d21dd 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ curl -sSL https://raw.githubusercontent.com/gemini-cli-extensions/data-agent-kit **Windows:** ```powershell -& ([scriptblock]::Create((irm https://raw.githubusercontent.com/gemini-cli-extensions/data-agent-kit-starter-pack/0.1.1/codex-install.ps1))) -Tag 0.1.1 +$env:CODEX_TAG="0.1.1"; irm https://raw.githubusercontent.com/gemini-cli-extensions/data-agent-kit-starter-pack/0.1.1/codex-install.ps1 | iex ``` 2. **Install the plugin in Codex:** diff --git a/codex-install.ps1 b/codex-install.ps1 index d29e3b2..c057d6c 100644 --- a/codex-install.ps1 +++ b/codex-install.ps1 @@ -17,6 +17,10 @@ param( [string]$Tag ) +if (-not $Tag -and $env:CODEX_TAG) { + $Tag = $env:CODEX_TAG +} + $ErrorActionPreference = "Stop" $pluginName = "data-agent-kit-starter-pack" From ea6c64020400aa675b550a25228ac2da0b58763c Mon Sep 17 00:00:00 2001 From: Daniel Rosales Date: Mon, 4 May 2026 21:23:49 +0000 Subject: [PATCH 4/4] rename directory instead of deleting the plugin directory --- codex-install.ps1 | 9 +++++++-- codex-install.sh | 7 +++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/codex-install.ps1 b/codex-install.ps1 index c057d6c..6a900ab 100644 --- a/codex-install.ps1 +++ b/codex-install.ps1 @@ -65,8 +65,13 @@ Write-Host "--- $pluginName Installer for Codex ---" New-Item -ItemType Directory -Force -Path $pluginsRoot | Out-Null if (Test-Path $installDir) { - Write-Host "Removing existing plugin at $installDir for clean install..." - Remove-Item -LiteralPath $installDir -Recurse -Force + $timestamp = Get-Date -Format "yyyyMMdd_HHmmss" + $backupName = "$pluginName" + "_backup_" + $timestamp + $backupPath = Join-Path (Split-Path $installDir) $backupName + Write-Host "Backing up existing plugin to $backupPath..." + Rename-Item -LiteralPath $installDir -NewName $backupName + Write-Host "Notice: Your previous installation has been backed up to $backupPath." + Write-Host "You can delete it if you do not need it." } if ($Tag) { diff --git a/codex-install.sh b/codex-install.sh index 2cee6aa..cad675c 100755 --- a/codex-install.sh +++ b/codex-install.sh @@ -27,8 +27,11 @@ echo "--- $PLUGIN_NAME Installer for Codex ---" # 1. Download/Update Plugin Content mkdir -p "$HOME/.agents/plugins" if [ -d "$INSTALL_DIR" ]; then - echo "Removing existing plugin at $INSTALL_DIR for clean install..." - rm -rf "$INSTALL_DIR" + BACKUP_DIR="${INSTALL_DIR}_backup_$(date +%Y%m%d_%H%M%S)" + echo "Backing up existing plugin to $BACKUP_DIR..." + mv "$INSTALL_DIR" "$BACKUP_DIR" + echo "Notice: Your previous installation has been backed up to $BACKUP_DIR." + echo "You can delete it if you do not need it." fi if [ -n "$TAG" ]; then