diff --git a/.changeset/fix-install-jetbrains-tag.md b/.changeset/fix-install-jetbrains-tag.md new file mode 100644 index 0000000000..5e70f1f4cf --- /dev/null +++ b/.changeset/fix-install-jetbrains-tag.md @@ -0,0 +1,5 @@ +--- +"@kilocode/cli": patch +--- + +Install the latest stable CLI release when newer non-CLI or prerelease releases exist. diff --git a/install b/install index f78cbc8d1b..a12dfea549 100755 --- a/install +++ b/install @@ -183,13 +183,17 @@ else fi if [ -z "$requested_version" ]; then - url="https://github.com/Kilo-Org/kilocode/releases/latest/download/$filename" - specific_version=$(curl -s https://api.github.com/repos/Kilo-Org/kilocode/releases/latest | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p') - - if [[ $? -ne 0 || -z "$specific_version" ]]; then + # The npm latest tag tracks stable CLI releases independently of other GitHub release types. + if ! specific_version=$(curl -fsSL "https://registry.npmjs.org/-/package/%40kilocode%2Fcli/dist-tags" | + sed -n 's/.*"latest"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p'); then echo -e "${RED}Failed to fetch version information${NC}" exit 1 fi + if [[ ! "$specific_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo -e "${RED}Failed to fetch version information${NC}" + exit 1 + fi + url="https://github.com/Kilo-Org/kilocode/releases/download/v${specific_version}/$filename" else # Strip leading 'v' if present requested_version="${requested_version#v}"