mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-10-24 01:24:18 +08:00
fix: replace leftover opencode branding in install-kilo, restore upstream install
This commit is contained in:
+20
-20
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# kilocode_change - new file
|
||||
set -euo pipefail
|
||||
APP=opencode
|
||||
APP=kilo
|
||||
|
||||
MUTED='\033[0;2m'
|
||||
RED='\033[0;31m'
|
||||
@@ -12,7 +12,7 @@ usage() {
|
||||
cat <<EOF
|
||||
Kilo Code Installer
|
||||
|
||||
Usage: install.sh [options]
|
||||
Usage: install-kilo [options]
|
||||
|
||||
Options:
|
||||
-h, --help Display this help message
|
||||
@@ -21,9 +21,9 @@ Options:
|
||||
--no-modify-path Don't modify shell config files (.zshrc, .bashrc, etc.)
|
||||
|
||||
Examples:
|
||||
curl -fsSL https://kilo.ai/install | bash
|
||||
curl -fsSL https://kilo.ai/install | bash -s -- --version 1.0.180
|
||||
./install --binary /path/to/opencode
|
||||
curl -fsSL https://kilo.ai/cli/install | bash
|
||||
curl -fsSL https://kilo.ai/cli/install | bash -s -- --version 1.0.180
|
||||
./install-kilo --binary /path/to/kilo
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
INSTALL_DIR=$HOME/.opencode/bin
|
||||
INSTALL_DIR=$HOME/.kilo/bin
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
|
||||
# If --binary is provided, skip all download/detection logic
|
||||
@@ -206,11 +206,11 @@ print_message() {
|
||||
}
|
||||
|
||||
check_version() {
|
||||
if command -v opencode >/dev/null 2>&1; then
|
||||
opencode_path=$(which opencode)
|
||||
if command -v kilo >/dev/null 2>&1; then
|
||||
kilo_path=$(which kilo)
|
||||
|
||||
## Check the installed version
|
||||
installed_version=$(opencode --version 2>/dev/null || echo "")
|
||||
installed_version=$(kilo --version 2>/dev/null || echo "")
|
||||
|
||||
if [[ "$installed_version" != "$specific_version" ]]; then
|
||||
print_message info "${MUTED}Installed version: ${NC}$installed_version."
|
||||
@@ -262,7 +262,7 @@ download_with_progress() {
|
||||
fi
|
||||
|
||||
local tmp_dir=${TMPDIR:-/tmp}
|
||||
local basename="${tmp_dir}/opencode_install_$$"
|
||||
local basename="${tmp_dir}/kilo_install_$$"
|
||||
local tracefile="${basename}.trace"
|
||||
|
||||
rm -f "$tracefile"
|
||||
@@ -274,7 +274,7 @@ download_with_progress() {
|
||||
trap "trap - RETURN; rm -f \"$tracefile\"; printf '\033[?25h' >&4; exec 4>&-" RETURN
|
||||
|
||||
(
|
||||
curl --trace-ascii "$tracefile" -s -L -o "$output" "$url"
|
||||
curl --trace-ascii "$tracefile" -fsL -o "$output" "$url"
|
||||
) &
|
||||
local curl_pid=$!
|
||||
|
||||
@@ -313,12 +313,12 @@ download_with_progress() {
|
||||
|
||||
download_and_install() {
|
||||
print_message info "\n${MUTED}Installing ${NC}Kilo Code ${MUTED}version: ${NC}$specific_version"
|
||||
local tmp_dir="${TMPDIR:-/tmp}/opencode_install_$$"
|
||||
local tmp_dir="${TMPDIR:-/tmp}/kilo_install_$$"
|
||||
mkdir -p "$tmp_dir"
|
||||
|
||||
if [[ "$os" == "windows" ]] || ! [ -t 2 ] || ! download_with_progress "$url" "$tmp_dir/$filename"; then
|
||||
# Fallback to standard curl on Windows, non-TTY environments, or if custom progress fails
|
||||
curl -# -L -o "$tmp_dir/$filename" "$url"
|
||||
curl -f# -L -o "$tmp_dir/$filename" "$url"
|
||||
fi
|
||||
|
||||
if [ "$os" = "linux" ]; then
|
||||
@@ -327,15 +327,15 @@ download_and_install() {
|
||||
unzip -q "$tmp_dir/$filename" -d "$tmp_dir"
|
||||
fi
|
||||
|
||||
mv "$tmp_dir/opencode" "$INSTALL_DIR"
|
||||
chmod 755 "${INSTALL_DIR}/opencode"
|
||||
mv "$tmp_dir/kilo" "$INSTALL_DIR"
|
||||
chmod 755 "${INSTALL_DIR}/kilo"
|
||||
rm -rf "$tmp_dir"
|
||||
}
|
||||
|
||||
install_from_binary() {
|
||||
print_message info "\n${MUTED}Installing ${NC}Kilo Code ${MUTED}from: ${NC}$binary_path"
|
||||
cp "$binary_path" "${INSTALL_DIR}/opencode"
|
||||
chmod 755 "${INSTALL_DIR}/opencode"
|
||||
cp "$binary_path" "${INSTALL_DIR}/kilo"
|
||||
chmod 755 "${INSTALL_DIR}/kilo"
|
||||
}
|
||||
|
||||
if [ -n "$binary_path" ]; then
|
||||
@@ -353,9 +353,9 @@ add_to_path() {
|
||||
if grep -Fxq "$command" "$config_file"; then
|
||||
print_message info "Command already exists in $config_file, skipping write."
|
||||
elif [[ -w $config_file ]]; then
|
||||
echo -e "\n# opencode" >> "$config_file"
|
||||
echo -e "\n# kilo" >> "$config_file"
|
||||
echo "$command" >> "$config_file"
|
||||
print_message info "${MUTED}Successfully added ${NC}opencode ${MUTED}to \$PATH in ${NC}$config_file"
|
||||
print_message info "${MUTED}Successfully added ${NC}kilo ${MUTED}to \$PATH in ${NC}$config_file"
|
||||
else
|
||||
print_message warning "Manually add the directory to $config_file (or similar):"
|
||||
print_message info " $command"
|
||||
@@ -439,7 +439,7 @@ echo -e ""
|
||||
echo -e "${MUTED}Kilo includes free models so you can start immediately:${NC}"
|
||||
echo -e ""
|
||||
echo -e "cd <project> ${MUTED}# Open directory${NC}"
|
||||
echo -e "opencode ${MUTED}# Run command${NC}"
|
||||
echo -e "kilo ${MUTED}# Run Kilo${NC}"
|
||||
echo -e ""
|
||||
echo -e "${MUTED}For more information visit ${NC}https://kilo.ai/docs"
|
||||
echo -e ""
|
||||
|
||||
Reference in New Issue
Block a user