feat: Add kilocode on Northflank (#271)

Agent: gap-filler

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-02-10 15:24:53 -08:00 committed by GitHub
parent f1374a112a
commit 637aa401e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 56 additions and 1 deletions

View file

@ -1073,7 +1073,7 @@
"northflank/gptme": "implemented",
"northflank/opencode": "missing",
"northflank/plandex": "missing",
"northflank/kilocode": "missing",
"northflank/kilocode": "implemented",
"railway/claude": "implemented",
"railway/openclaw": "implemented",
"railway/nanoclaw": "implemented",

55
northflank/kilocode.sh Normal file
View file

@ -0,0 +1,55 @@
#!/bin/bash
set -eo pipefail
# Source common functions - local or remote fallback
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
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/northflank/lib/common.sh)"
fi
log_info "Kilo Code on Northflank"
echo ""
ensure_northflank_cli
ensure_northflank_token
SERVICE_NAME=$(get_server_name)
PROJECT_NAME=$(get_project_name)
create_server "${SERVICE_NAME}"
wait_for_cloud_init
log_warn "Installing Kilo Code..."
run_server "curl -fsSL https://bun.sh/install | bash && export PATH=\"\$HOME/.bun/bin:\$PATH\" && bun install -g @kilocode/cli"
# Verify installation
if ! run_server "command -v kilocode &> /dev/null"; then
log_error "kilocode installation verification failed"
log_error "The 'kilocode' command is not available"
exit 1
fi
log_info "Kilo Code installation verified successfully"
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_warn "Setting up environment variables..."
inject_env_vars_northflank \
"KILO_PROVIDER_TYPE=openrouter" \
"KILO_OPEN_ROUTER_API_KEY=${OPENROUTER_API_KEY}" \
"OPENROUTER_API_KEY=${OPENROUTER_API_KEY}"
echo ""
log_info "Northflank service setup completed successfully!"
echo ""
log_warn "Starting Kilo Code..."
sleep 1
clear
interactive_session "source ~/.bashrc && kilocode"