diff --git a/README.md b/README.md index 0970f5d7..2923461b 100644 --- a/README.md +++ b/README.md @@ -54,9 +54,13 @@ EOF **Use**: ```bash -ccs # Use default profile -ccs glm # Use GLM profile -ccs son # Use Sonnet profile +ccs # Use default profile +ccs glm # Use GLM profile +ccs son # Use Sonnet profile + +# Utility commands +ccs --version # Show CCS version +ccs --help # Show Claude CLI help ``` ## Why CCS? diff --git a/README.vi.md b/README.vi.md index e8c1daab..6352c0e2 100644 --- a/README.vi.md +++ b/README.vi.md @@ -54,9 +54,13 @@ EOF **Sử dụng**: ```bash -ccs # Dùng profile mặc định -ccs glm # Dùng GLM profile -ccs son # Dùng Sonnet profile +ccs # Dùng profile mặc định +ccs glm # Dùng GLM profile +ccs son # Dùng Sonnet profile + +# Lệnh tiện ích +ccs --version # Hiển thị phiên bản CCS +ccs --help # Hiển thị trợ giúp Claude CLI ``` ## Tại Sao Nên Dùng CCS? diff --git a/ccs b/ccs index 7bf5bd6b..4b5c0fef 100755 --- a/ccs +++ b/ccs @@ -1,9 +1,25 @@ #!/usr/bin/env bash set -euo pipefail +# Version +CCS_VERSION="1.1.0" + CONFIG_FILE="${CCS_CONFIG:-$HOME/.ccs/config.json}" PROFILE="${1:-default}" +# Special case: version command +if [[ "$PROFILE" == "version" || "$PROFILE" == "--version" || "$PROFILE" == "-v" ]]; then + echo "CCS (Claude Code Switch) version $CCS_VERSION" + echo "https://github.com/kaitranntt/ccs" + exit 0 +fi + +# Special case: help command (forward to Claude CLI) +if [[ "$PROFILE" == "--help" || "$PROFILE" == "-h" || "$PROFILE" == "help" ]]; then + shift # Remove the help argument + exec claude --help "$@" +fi + # Check config exists if [[ ! -f "$CONFIG_FILE" ]]; then echo "Error: Config file not found: $CONFIG_FILE" diff --git a/ccs.ps1 b/ccs.ps1 index 52112ab6..9289b820 100644 --- a/ccs.ps1 +++ b/ccs.ps1 @@ -12,6 +12,32 @@ param( $ErrorActionPreference = "Stop" +# Version +$CCS_VERSION = "1.1.0" + +# Special case: version command +if ($Profile -eq "version" -or $Profile -eq "--version" -or $Profile -eq "-v") { + Write-Host "CCS (Claude Code Switch) version $CCS_VERSION" + Write-Host "https://github.com/kaitranntt/ccs" + exit 0 +} + +# Special case: help command (forward to Claude CLI) +if ($Profile -eq "--help" -or $Profile -eq "-h" -or $Profile -eq "help") { + try { + if ($RemainingArgs) { + & claude --help @RemainingArgs + } else { + & claude --help + } + exit $LASTEXITCODE + } catch { + Write-Host "Error: Failed to execute claude --help" -ForegroundColor Red + Write-Host $_.Exception.Message + exit 1 + } +} + # Special case: "default" profile just runs claude directly (no profile switching) if ($Profile -eq "default") { try {