spawn/netcup/kilocode.sh
A 68c53c4d3f
feat: implement netcup/kilocode integration (#751)
* feat: implement netcup/kilocode integration

Add Kilo Code support on Netcup VPS provider. This fills a missing matrix entry by combining Netcup cloud primitives with Kilo Code agent setup.

Changes:
- netcup/kilocode.sh: New script using Netcup API provisioning + Kilo Code CLI
- netcup/README.md: Added Kilo Code to available agents list
- manifest.json: Updated netcup/kilocode from "missing" to "implemented"

Agent: gap-filler-1

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: address review findings in netcup/kilocode.sh

- Add missing upload_file/run_server args to inject_env_vars_ssh (HIGH -
  prevented credential leak where API key was passed as upload_func)
- Add wait_for_cloud_init call after verify_server_connectivity (MEDIUM)
- Add shellcheck source directive and SC2154 disable
- Add server info to completion message

Agent: pr-maintainer
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Sprite <noreply@sprites.dev>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: A <6723574+louisgv@users.noreply.github.com>
2026-02-12 15:49:19 -08:00

51 lines
1.5 KiB
Bash

#!/bin/bash
# shellcheck disable=SC2154
set -eo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
# shellcheck source=netcup/lib/common.sh
if [[ -n "$SCRIPT_DIR" && -f "$SCRIPT_DIR/lib/common.sh" ]]; then
source "$SCRIPT_DIR/lib/common.sh"
else
eval "$(curl -fsSL https://raw.githubusercontent.com/OpenRouterTeam/spawn/main/netcup/lib/common.sh)"
fi
log_info "Kilo Code on Netcup"
echo ""
ensure_netcup_credentials
ensure_ssh_key
SERVER_NAME=$(get_server_name)
create_server "${SERVER_NAME}"
verify_server_connectivity "${NETCUP_SERVER_IP}"
wait_for_cloud_init "${NETCUP_SERVER_IP}" 60
log_step "Setting up server environment..."
setup_shell_environment "${NETCUP_SERVER_IP}"
log_step "Installing Kilo Code CLI..."
run_server "${NETCUP_SERVER_IP}" "npm install -g @kilocode/cli"
echo ""
if [[ -n "${OPENROUTER_API_KEY:-}" ]]; then
log_info "Using OpenRouter API key from environment"
else
OPENROUTER_API_KEY=$(get_openrouter_api_key_oauth 5180)
fi
log_step "Setting up environment variables..."
inject_env_vars_ssh "${NETCUP_SERVER_IP}" upload_file run_server \
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}" \
"KILO_PROVIDER_TYPE=openrouter" \
"KILO_OPEN_ROUTER_API_KEY=${OPENROUTER_API_KEY}"
echo ""
log_info "Netcup server setup completed successfully!"
log_info "Server: ${SERVER_NAME} (ID: ${NETCUP_SERVER_ID}, IP: ${NETCUP_SERVER_IP})"
echo ""
log_step "Starting Kilo Code..."
sleep 1
clear
interactive_session "${NETCUP_SERVER_IP}" "source ~/.bashrc && kilocode"