Add backend launcher scripts and refresh cleanup utility

Introduce claude-glm and claude-tk wrappers with secure keychain token lookup and backend model defaults, and replace cleanup.sh with the updated cleanup script entrypoint.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-24 21:24:10 +07:00
co-authored by Claude Opus 4.7
parent 09aaab2e42
commit 38d257e854
3 changed files with 136 additions and 1 deletions
Executable
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# claude-glm — Run Claude Code with GLM backend
#
# Usage:
# claude-glm [args...]
#
# Setup API key (reuse existing):
# macOS:
# security add-generic-password -a "$USER" -s GLM_API_KEY -w "YOUR_KEY"
# Linux:
# echo "YOUR_KEY" | secret-tool store --label "GLM API Key" service GLM_API_KEY
KEY_NAME="GLM_API_KEY"
get_token() {
if command -v security >/dev/null 2>&1; then
security find-generic-password -s "$KEY_NAME" -w 2>/dev/null && return
fi
if command -v secret-tool >/dev/null 2>&1; then
secret-tool lookup service "$KEY_NAME" 2>/dev/null && return
fi
return 1
}
TOKEN=$(get_token)
if [ -z "$TOKEN" ]; then
echo "❌ Missing GLM token ($KEY_NAME)"
exit 1
fi
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
export ANTHROPIC_AUTH_TOKEN="$TOKEN"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-4.5-air"
export ANTHROPIC_DEFAULT_SONNET_MODEL="glm-5.1"
export ANTHROPIC_DEFAULT_OPUS_MODEL="glm-5.1"
echo "→ Backend: GLM"
exec claude "$@"
Executable
+41
View File
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
# claude-gpt — Run Claude Code with GPT backend
#
# Usage:
# claude-gpt [args...]
#
# Setup API key (reuse existing):
# macOS:
# security add-generic-password -a "$USER" -s TK_AI_API_TOKEN -w "YOUR_KEY"
# Linux:
# echo "YOUR_KEY" | secret-tool store --label "AI API Token" service TK_AI_API_TOKEN
KEY_NAME="TK_AI_API_TOKEN"
get_token() {
if command -v security >/dev/null 2>&1; then
security find-generic-password -s "$KEY_NAME" -w 2>/dev/null && return
fi
if command -v secret-tool >/dev/null 2>&1; then
secret-tool lookup service "$KEY_NAME" 2>/dev/null && return
fi
return 1
}
TOKEN=$(get_token)
if [ -z "$TOKEN" ]; then
echo "❌ Missing GPT token ($KEY_NAME)"
exit 1
fi
export ANTHROPIC_BASE_URL="https://ai.acbpro.com"
export ANTHROPIC_AUTH_TOKEN="$TOKEN"
export ANTHROPIC_DEFAULT_OPUS_MODEL="gpt-5.3-codex(high)"
export ANTHROPIC_DEFAULT_SONNET_MODEL="gpt-5.3-codex(medium)"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="gpt-5.3-codex(medium)"
echo "→ Backend: GPT"
exec claude "$@"
+54 -1
View File
@@ -640,6 +640,58 @@ cleanup_cache_dir() {
# Interactive Menu System # Interactive Menu System
# ============================================================================= # =============================================================================
print_welcome_banner() {
local use_color=0
local reset=""
local i=0
local line
local -a colors=()
local -a lines=(
' __ __ __ __ ________ __'
'| \ / \ | \ | \ | \| \'
'| $$\ / $$ ______ _______ _______ | $$ ______ ______ _______ __ __ ______ | $$____ __ __ \$$$$$$$$| $$'
'| $$$\ / $$$ | \ / \ / \| $$ / \ | \ | \ | \ | \ / \ | $$ \ | \ | \ | $$ | $$'
'| $$$$\ $$$$ \$$$$$$\| $$$$$$$ | $$$$$$$| $$| $$$$$$\ \$$$$$$\| $$$$$$$\| $$ | $$| $$$$$$\ | $$$$$$$\| $$ | $$ | $$ | $$'
'| $$\$$ $$ $$ / $$| $$ | $$ | $$| $$ $$ / $$| $$ | $$| $$ | $$| $$ | $$ | $$ | $$| $$ | $$ | $$ | $$'
'| $$ \$$$| $$| $$$$$$$| $$_____ | $$_____ | $$| $$$$$$$$| $$$$$$$| $$ | $$| $$__/ $$| $$__/ $$ | $$__/ $$| $$__/ $$ | $$ | $$_____'
'| $$ \$ | $$ \$$ $$ \$$ \ \$$ \| $$ \$$ \ \$$ $$| $$ | $$ \$$ $$| $$ $$ | $$ $$ \$$ $$ | $$ | $$ \'
' \$$ \$$ \$$$$$$$ \$$$$$$$ \$$$$$$$ \$$ \$$$$$$$ \$$$$$$$ \$$ \$$ \$$$$$$ | $$$$$$$ \$$$$$$$ _\$$$$$$$ \$$ \$$$$$$$$'
' | $$ | \__| $$'
' | $$ \$$ $$'
' \$$ \$$$$$$'
)
if [ -t 1 ]; then
use_color=1
reset=$'\033[0m'
colors=(
$'\033[1;38;5;51m'
$'\033[1;38;5;87m'
$'\033[1;38;5;123m'
$'\033[1;38;5;159m'
$'\033[1;38;5;193m'
$'\033[1;38;5;220m'
$'\033[1;38;5;214m'
$'\033[1;38;5;209m'
$'\033[1;38;5;204m'
$'\033[1;38;5;198m'
$'\033[1;38;5;177m'
$'\033[1;38;5;141m'
)
fi
echo ""
for line in "${lines[@]}"; do
if [ "$use_color" -eq 1 ]; then
printf '%b%s%b\n' "${colors[$i]}" "$line" "$reset"
else
printf '%s\n' "$line"
fi
i=$((i + 1))
done
echo ""
}
# Tên các nhóm cleanup # Tên các nhóm cleanup
MENU_ITEMS=( MENU_ITEMS=(
"All" "All"
@@ -712,6 +764,7 @@ sync_all() {
# Chạy interactive menu # Chạy interactive menu
run_menu() { run_menu() {
print_welcome_banner
echo "" echo ""
echo "===== 🧹 Cleanup macOS =====" echo "===== 🧹 Cleanup macOS ====="
echo "" echo ""
@@ -856,4 +909,4 @@ for ((i = 1; i < MENU_COUNT; i++)); do
fi fi
done done
echo "===== ✅ Cleanup hoàn tất =====" echo "===== ✅ Cleanup hoàn tất ====="