diff --git a/src/rtk/devcontainer-feature.json b/src/rtk/devcontainer-feature.json index 9af8f14..aeb349a 100644 --- a/src/rtk/devcontainer-feature.json +++ b/src/rtk/devcontainer-feature.json @@ -1,13 +1,18 @@ { "name": "rtk", "id": "rtk", - "version": "1.0.0", + "version": "1.1.0", "description": "CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies.", "options": { "version": { "type": "string", "default": "latest", "description": "Version of rtk to install from GitHub releases e.g. v0.38.0" + }, + "ghtoken": { + "type": "string", + "default": "", + "description": "GitHub token to use for accessing 'latest' release API (optional, but recommended to avoid rate limits)" } } } diff --git a/src/rtk/install.sh b/src/rtk/install.sh index c3c1b28..c37d9e6 100644 --- a/src/rtk/install.sh +++ b/src/rtk/install.sh @@ -33,7 +33,13 @@ check_packages curl jq ca-certificates # Function to get the latest version from GitHub API get_latest_version() { - curl -s "${GITHUB_API_REPO_URL}/latest" | jq -r ".tag_name" + if [ -n "$GHTOKEN" ]; then + # Use the token for authentication to avoid rate limits + AUTH_HEADER="-H \"Authorization: Bearer $GHTOKEN\"" + else + AUTH_HEADER="" + fi + curl -s ${AUTH_HEADER} "${GITHUB_API_REPO_URL}/latest" | jq -r ".tag_name" } # Check if a version is passed as an argument