Skip to content

Commit 5025ab6

Browse files
committed
ai-cli versions generation
1 parent eef7da7 commit 5025ab6

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

ai-cli/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,17 @@ Generate version tag based on installed tool versions:
2222

2323
This will:
2424
1. Build image locally
25-
2. Extract versions of codex, claude-code, and copilot
26-
3. Generate combined tag (e.g., `codex-1.0.0_claude-2.1.0_copilot-1.5.0`)
25+
2. Extract versions of claude-code, codex, and copilot
26+
3. Generate combined tag (e.g., `claude-2.0.36_codex-0.56.0_copilot-0.0.354`)
27+
- Apps sorted alphabetically: claude, codex, copilot
2728
4. Update `config.sh` with generated tag
29+
5. Create git tag `ai-cli-<TAG>`
30+
6. Display push command for publishing
31+
32+
Then push the tag:
33+
```bash
34+
git push origin ai-cli-<TAG>
35+
```
2836

2937
## Build
3038

ai-cli/config.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
#!/usr/bin/env bash
22

3-
export TAG=codex-0.56.0_claude-2.0.36_copilot-0.0.354
3+
# Run ./generate-version-tag.sh to auto-generate this tag
4+
# Apps sorted alphabetically: claude, codex, copilot
5+
export TAG=claude-2.0.36_codex-0.56.0_copilot-0.0.354

ai-cli/generate-version-tag.sh

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ docker build -t "${IMAGE_NAME}:temp" "${SCRIPT_DIR}" --no-cache
1010

1111
echo "Extracting tool versions..."
1212

13+
# Extract Claude Code version
14+
CLAUDE_VERSION=$(docker run --rm "${IMAGE_NAME}:temp" bash -c "npm list -g @anthropic-ai/claude-code --depth=0 2>/dev/null | grep @anthropic-ai/claude-code | sed 's/.*@anthropic-ai\/claude-code@//' | sed 's/ .*//' || echo 'unknown'")
15+
echo " Claude: ${CLAUDE_VERSION}"
16+
1317
# Extract OpenAI Codex version
1418
CODEX_VERSION=$(docker run --rm "${IMAGE_NAME}:temp" bash -c "npm list -g @openai/codex --depth=0 2>/dev/null | grep @openai/codex | sed 's/.*@openai\/codex@//' | sed 's/ .*//' || echo 'unknown'")
1519
echo " Codex: ${CODEX_VERSION}"
1620

17-
# Extract Claude Code version
18-
CLAUDE_VERSION=$(docker run --rm "${IMAGE_NAME}:temp" bash -c "npm list -g @anthropic-ai/claude-code --depth=0 2>/dev/null | grep @anthropic-ai/claude-code | sed 's/.*@anthropic-ai\/claude-code@//' | sed 's/ .*//' || echo 'unknown'")
19-
echo " Claude Code: ${CLAUDE_VERSION}"
20-
2121
# Extract GitHub Copilot version
2222
COPILOT_VERSION=$(docker run --rm "${IMAGE_NAME}:temp" bash -c "npm list -g @github/copilot --depth=0 2>/dev/null | grep @github/copilot | sed 's/.*@github\/copilot@//' | sed 's/ .*//' || echo 'unknown'")
2323
echo " Copilot: ${COPILOT_VERSION}"
2424

2525
# Clean up temporary image
2626
docker rmi "${IMAGE_NAME}:temp" >/dev/null 2>&1 || true
2727

28-
# Generate combined tag
29-
TAG="codex-${CODEX_VERSION}_claude-${CLAUDE_VERSION}_copilot-${COPILOT_VERSION}"
28+
# Generate combined tag (alphabetically sorted: claude, codex, copilot)
29+
TAG="claude-${CLAUDE_VERSION}_codex-${CODEX_VERSION}_copilot-${COPILOT_VERSION}"
3030

3131
echo ""
3232
echo "Generated tag: ${TAG}"
@@ -39,3 +39,13 @@ export TAG=${TAG}
3939
EOF
4040

4141
echo "config.sh updated with TAG=${TAG}"
42+
43+
# Create git tag
44+
GIT_TAG="ai-cli-${TAG}"
45+
echo ""
46+
echo "Creating git tag: ${GIT_TAG}"
47+
git tag "${GIT_TAG}" 2>/dev/null && echo "Git tag created: ${GIT_TAG}" || echo "Git tag already exists: ${GIT_TAG}"
48+
49+
echo ""
50+
echo "To push to remote, run:"
51+
echo " git push origin ${GIT_TAG}"

0 commit comments

Comments
 (0)