DocsIDE & Integrations
Setup

Integrations

Krnl connects with your editor, LLM providers, cloud platforms, monitoring services, and CI/CD pipelines. All integrations are opt-in and configured through environment variables or YAML.

VS Code Extension

The Krnl Code extension runs the agent in a webview panel inside VS Code. It auto-manages the Python backend — detecting Python 3.9+, creating a private venv, installing the krnl-code package, and spawning the server. API keys are stored in VS Code's encrypted SecretStorage.

Installation

Install from the VS Code Marketplace, or use Open VSX for Cursor, VSCodium, and Windsurf.

Commands

All commands are prefixed with Krnl: in the Command Palette (Ctrl+Shift+P):

Open Chat
Open the chat webview panel
Select Provider
Choose an LLM provider (openai, anthropic, ollama, etc.)
Set API Key
Configure the API key for the active provider
Set Model
Override the model ID for the active provider
Stop Current Task
Cancel the running task immediately
Undo Last Changes
Revert file changes from the last task
Toggle Auto-Approve
Skip approval prompts for mutations
Toggle Plan Mode
Research-first mode with explicit plan approval
Review Changes
Code review of uncommitted git diff
Fix Diagnostics
Auto-fix compiler/linter errors
Create Project Memory
Scaffold AGENTS.md for the current project
Login / Logout
OAuth authentication with Krnl web service
Restart Backend
Restart the Python backend process

Settings

krnlAgent.model
stringDefault: ""
Override model ID for the active provider
krnlAgent.pythonPath
stringDefault: ""
Python 3.9+ executable path (auto-detected if empty)
krnlAgent.backendVersion
stringDefault: ""
Pin backend PyPI version (latest if empty)
krnlAgent.persistHistory
booleanDefault: true
Remember conversation across reloads
krnlAgent.autoDiagnostics
booleanDefault: true
Auto-fix compiler/linter diagnostics
krnlAgent.effort
enumDefault: ""
Reasoning effort: low / medium / high

How It Works

  1. Extension detects Python 3.9+ on your system
  2. Creates a private Python environment in VS Code's global storage
  3. Installs the krnl-code package
  4. Starts the agent backend process on a local port
  5. Opens a streaming connection for provider + key configuration
  6. Sends the user's task to the backend
  7. Events stream back: tokens, tool_start, diff, approval_request, done

Supported Editors

The same extension works across editors compatible with VS Code extensions:

VS Code

Full support via VS Code Marketplace. All features: webview, commands, settings, SecretStorage keys.

Cursor

Compatible via Open VSX installation. Same extension, same features. Also supports git worktree isolation (shadow workspace).

VSCodium / Windsurf

Install from Open VSX registry. The extension is published to both Marketplaces.

CLI (Terminal)

The full agent runs in any terminal — no editor needed. Install with a single command: irm https://github.com/saurabhgk7tech/Krnl-Coding-Agent-Releases/releases/latest/download/install.ps1 | iex (Windows) or curl -fsSL https://github.com/saurabhgk7tech/Krnl-Coding-Agent-Releases/releases/latest/download/install.sh | sh (macOS/Linux). The CLI shares credentials with the VS Code extension via ~/.krnl/credentials.json.

# Interactive session
krnl-code

# One-shot task
krnl-code run "add a /health endpoint" -y

# Environment check
krnl-code doctor

LLM Providers

Krnl works with any OpenAI-compatible API plus native Anthropic support. Configure via /provider, /key, and /model slash commands, or set environment variables.

Krnlopenai
Env:KRL_API_KEY
Default: gpt-4.1-mini
OpenAIopenai
Env:OPENAI_API_KEY
Default: gpt-4o-mini
OpenRouteropenai
Env:OPENROUTER_API_KEY
Default: nex-agi/nex-n2-pro:free
Anthropic (Claude)anthropic
Env:ANTHROPIC_API_KEY
Default: claude-sonnet-4-6
Google Geminiopenai
Env:GEMINI_API_KEY
Default: gemini-3.5-flash
Groqopenai
Env:GROQ_API_KEY
Default: llama-3.3-70b-versatile
Cerebrasopenai
Env:CEREBRAS_API_KEY
Default: llama-3.3-70b
DeepSeekopenai
Env:DEEPSEEK_API_KEY
Default: deepseek-chat
Together AIopenai
Env:TOGETHER_API_KEY
Default: Kimi-K2-Instruct
Mistral AIopenai
Env:MISTRAL_API_KEY
Default: mistral-large-latest
xAI (Grok)openai
Env:XAI_API_KEY
Default: grok-2-latest
Vercel AI Gatewayopenai
Env:AI_GATEWAY_API_KEY
Default: anthropic/claude-sonnet-4.5
Ollama (local)openai
Env:(none)
Default: qwen3.5-coder:7b
LM Studio (local)openai
Env:(none)
Default: local-model
All OpenAI-compatible endpoints work: Set /baseurl to any OpenAI-compatible API and Krnl will use it. This includes vLLM, llama.cpp, text-generation-webui, and custom proxies.

Deployment Platforms

Krnl can deploy to 16 targets. Each requires a CLI tool and a credential environment variable. Run krnl-code deploy --check to see which are ready.

cloudrunFree
CLI: gcloudcloud
Env: GOOGLE_APPLICATION_CREDENTIALS
cloudflareFree
CLI: wrangleredge
Env: CLOUDFLARE_API_TOKEN
vercelFree
CLI: vercelpaas
Env: VERCEL_TOKEN
netlifyFree
CLI: netlifystatic
Env: NETLIFY_AUTH_TOKEN
renderFree
CLI: renderpaas
Env: RENDER_API_KEY
flyBillable
CLI: flycontainer
Env: FLY_API_TOKEN
railwayBillable
CLI: railwaypaas
Env: RAILWAY_TOKEN
dockerFree
CLI: dockercontainer
Env: DOCKER_TOKEN
helm / kubernetesBillable
CLI: helm/kubectlcontainer
Env: KUBECONFIG
aws-samBillable
CLI: samcloud
Env: AWS_ACCESS_KEY_ID
azure-acaFree
CLI: azcloud
Env: AZURE_CLIENT_ID
neon (DB)Free
CLI: neonctldb
Env: NEON_API_KEY
supabase (DB)Free
CLI: supabasedb
Env: SUPABASE_ACCESS_TOKEN
Free-tier by default. Billable targets require free_tier_only: false in config.yaml and explicit approval.

Monitoring & Observability

Krnl integrates with five monitoring platforms. Set the environment variable and the agent wires instrumentation automatically.

ProviderRequired Env Vars
SentrySENTRY_DSN, SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT
OpenTelemetryOTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS
DatadogDD_API_KEY
UptimeRobotUPTIMEROBOT_API_KEY
BetterStackBETTERSTACK_TOKEN
Sentry
SENTRY_DSN, SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT
OpenTelemetry
OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS
Datadog
DD_API_KEY
UptimeRobot
UPTIMEROBOT_API_KEY
BetterStack
BETTERSTACK_TOKEN

The krnl-code monitor command detects which providers are configured and pulls live status. The self-heal loop (krnl-code heal) health-checks the deployed URL, auto-rollbacks on failure, and files a PR for production errors.

Notifications & Ticketing

Receive agent completion or error notifications via your team's messaging platform:

Slack
SLACK_WEBHOOK
Discord
DISCORD_WEBHOOK
Telegram
TELEGRAM_TOKEN, TELEGRAM_CHAT_ID
Google Chat
GOOGLE_CHAT_WEBHOOK
WhatsApp (Twilio)
TWILIO_SID, TWILIO_TOKEN, WHATSAPP_FROM, WHATSAPP_TO
Linear (ticketing)
LINEAR_API_KEY, LINEAR_TEAM_ID
notifications:
  on: [done]                # Events: done, error
  slack_webhook: null
  discord_webhook: null
  telegram_token: null
  telegram_chat_id: null
  linear_api_key: null
  linear_team_id: null

GitHub Actions CI

Run headless agent tasks in CI/CD — automated PR review, security scanning, and test generation. Use krnl-code init-ci to scaffold a workflow file, or write one manually:

name: Krnl Code Review
on: [pull_request]
jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: curl -fsSL https://github.com/saurabhgk7tech/Krnl-Coding-Agent-Releases/releases/latest/download/install.sh | sh
      - run: ~/.krnl/bin/krnl-code run "review this PR" --json --yes
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

The --json flag outputs structured results for CI processing. --yes auto-approves all actions (required for non-interactive mode). The generated workflow also runs secret_scan and dependency_audit on every PR.

Git Integration

Krnl has full Git support for working with repositories:

git_status / git_diff

View repository state and pending changes before making edits.

git_commit

Stage all changes and commit with a message. Gated behind approval.

git_branch / git_push

Create branches and push to remote. Requires approval.

open_pr

Create pull requests via gh pr create. Requires GitHub CLI.

worktree isolation

Create isolated git worktrees in .krnl/worktrees/ for safe parallel changes.

/review

Code review of the current git diff — powered by the same agent loop.

MCP Servers (Model Context Protocol)

Krnl supports the Model Context Protocol for connecting external tools. MCP servers expose their capabilities as mcp__server__tool function calls that the agent can invoke just like native tools.

# MCP servers are configured in config.yaml
# No additional install needed — MCP is built into the CLI

# Config (config.yaml)
mcp:
  servers:
    filesystem:
      command: npx
      args: ["-y", "@modelcontextprotocol/server-filesystem", "/path"]
    my_api:
      url: https://example.com/mcp   # SSE endpoint

Both stdio (local processes) and SSE (remote HTTP) transports are supported. MCP servers can also be bundled in plugins.

Plugin System

Install plugin bundles containing skills, custom commands, and MCP server configs from a directory or remote .zip URL:

# CLI
krnl-code plugin add ./my-plugin
krnl-code plugin add https://example.com/plugin.zip
krnl-code plugin list

# Plugin directory structure:
~/.krnl-code/plugins/<name>/
  skills/<name>/SKILL.md
  commands/*.md
  krnl-plugin.yaml  (manifest + MCP servers)

Lifecycle Hooks

Run shell commands at key agent lifecycle events. Hooks can block tool execution (non-zero exit on PreToolUse prevents the tool from running).

# Config (config.yaml)
hooks:
  PreToolUse:
    - matcher: "write_file|edit_file"
      command: "ruff check ."         # Blocks tool if lint fails
  PostToolUse:
    - matcher: "*"
      command: "echo done > /dev/null"
  Stop:
    - command: "notify-send 'agent finished'"
  UserPromptSubmit:
    - command: "echo prompt received"

Four events supported: PreToolUse (blocking), PostToolUse, Stop, UserPromptSubmit. Hooks default to a 30-second timeout.

Firebase (Usage Tracking)

Krnl can record usage metrics to Firebase Realtime Database when configured with a service account:

# Environment variables
FIREBASE_SERVICE_ACCOUNT=<JSON or base64-encoded key>
FIREBASE_DATABASE_URL=https://<project>.firebasedatabase.app/

# Recorded data:
# /usage/{uid}/history/{push_id}  — timestamped per-turn records
# /usage/{uid}/totals/            — accumulated provider and model totals

Environment Variables Reference

Agent Configuration

VariablePurpose
KRNL_PROVIDERActive provider name
KRNL_API_KEYActive provider API key
KRNL_MODELModel ID override
KRNL_BASE_URLCustom API base URL
KRNL_AGENT_CONFIGPath to config.yaml
KRNL_PROVIDER
Active provider name
KRNL_API_KEY
Active provider API key
KRNL_MODEL
Model ID override
KRNL_BASE_URL
Custom API base URL
KRNL_AGENT_CONFIG
Path to config.yaml

LLM Provider API Keys

VariableProvider
KRL_API_KEYKrnl
OPENAI_API_KEYOpenAI
OPENROUTER_API_KEYOpenRouter
ANTHROPIC_API_KEYAnthropic (Claude)
GEMINI_API_KEYGoogle Gemini
GROQ_API_KEYGroq
CEREBRAS_API_KEYCerebras
DEEPSEEK_API_KEYDeepSeek
TOGETHER_API_KEYTogether AI
MISTRAL_API_KEYMistral AI
XAI_API_KEYxAI (Grok)
AI_GATEWAY_API_KEYVercel AI Gateway
Krnl
KRL_API_KEY
OpenAI
OPENAI_API_KEY
OpenRouter
OPENROUTER_API_KEY
Anthropic (Claude)
ANTHROPIC_API_KEY
Google Gemini
GEMINI_API_KEY
Groq
GROQ_API_KEY
Cerebras
CEREBRAS_API_KEY
DeepSeek
DEEPSEEK_API_KEY
Together AI
TOGETHER_API_KEY
Mistral AI
MISTRAL_API_KEY
xAI (Grok)
XAI_API_KEY
Vercel AI Gateway
AI_GATEWAY_API_KEY

Deployment & Operations

VariablePurpose
TAVILY_API_KEYWeb search (Tavily)
BRAVE_API_KEYWeb search (Brave)
SERPAPI_API_KEYWeb search (SerpAPI)
VERCEL_TOKENVercel deploy
NETLIFY_AUTH_TOKENNetlify deploy
CLOUDFLARE_API_TOKENCloudflare deploy
FLY_API_TOKENFly.io deploy
RENDER_API_KEYRender deploy
RAILWAY_TOKENRailway deploy
NEON_API_KEYNeon database
SUPABASE_ACCESS_TOKENSupabase database
DOCKER_TOKENDocker registry
KUBECONFIGKubernetes/Helm
GOOGLE_APPLICATION_CREDENTIALSGCP Cloud Run
AWS_ACCESS_KEY_IDAWS deploy
AZURE_CLIENT_IDAzure deploy
SENTRY_DSNSentry error tracking
OTEL_EXPORTER_OTLP_ENDPOINTOpenTelemetry
DD_API_KEYDatadog
UPTIMEROBOT_API_KEYUptimeRobot
BETTERSTACK_TOKENBetterStack
FIREBASE_SERVICE_ACCOUNTFirebase Admin (JSON or base64)
FIREBASE_DATABASE_URLFirebase RTDB URL
VERCEL_BLOB_TOKENVercel Blob storage
VSCE_PATVS Code Marketplace publish
OVSX_PATOpen VSX publish
TAVILY_API_KEY
Web search (Tavily)
BRAVE_API_KEY
Web search (Brave)
SERPAPI_API_KEY
Web search (SerpAPI)
VERCEL_TOKEN
Vercel deploy
NETLIFY_AUTH_TOKEN
Netlify deploy
CLOUDFLARE_API_TOKEN
Cloudflare deploy
FLY_API_TOKEN
Fly.io deploy
RENDER_API_KEY
Render deploy
RAILWAY_TOKEN
Railway deploy
NEON_API_KEY
Neon database
SUPABASE_ACCESS_TOKEN
Supabase database
DOCKER_TOKEN
Docker registry
KUBECONFIG
Kubernetes/Helm
GOOGLE_APPLICATION_CREDENTIALS
GCP Cloud Run
AWS_ACCESS_KEY_ID
AWS deploy
AZURE_CLIENT_ID
Azure deploy
SENTRY_DSN
Sentry error tracking
OTEL_EXPORTER_OTLP_ENDPOINT
OpenTelemetry
DD_API_KEY
Datadog
UPTIMEROBOT_API_KEY
UptimeRobot
BETTERSTACK_TOKEN
BetterStack
FIREBASE_SERVICE_ACCOUNT
Firebase Admin (JSON or base64)
FIREBASE_DATABASE_URL
Firebase RTDB URL
VERCEL_BLOB_TOKEN
Vercel Blob storage
VSCE_PAT
VS Code Marketplace publish
OVSX_PAT
Open VSX publish