Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ 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
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
$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:**
Expand Down
40 changes: 25 additions & 15 deletions codex-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

param(
[Parameter(Mandatory = $false)]
[string]$Tag
)

if (-not $Tag -and $env:CODEX_TAG) {
$Tag = $env:CODEX_TAG
}

$ErrorActionPreference = "Stop"

$pluginName = "data-agent-kit-starter-pack"
Expand Down Expand Up @@ -56,25 +65,26 @@ 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 {
}
$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 ($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":[]}'
Expand Down
21 changes: 17 additions & 4 deletions codex-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -25,13 +27,24 @@ 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
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
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..."
Expand Down
Loading