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):
| Command | Description |
|---|---|
| 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
| Setting | Type | Default | Description |
|---|---|---|---|
| krnlAgent.model | string | "" | Override model ID for the active provider |
| krnlAgent.pythonPath | string | "" | Python 3.9+ executable path (auto-detected if empty) |
| krnlAgent.backendVersion | string | "" | Pin backend PyPI version (latest if empty) |
| krnlAgent.persistHistory | boolean | true | Remember conversation across reloads |
| krnlAgent.autoDiagnostics | boolean | true | Auto-fix compiler/linter diagnostics |
| krnlAgent.effort | enum | "" | Reasoning effort: low / medium / high |
""""""truetrue""How It Works
- Extension detects Python 3.9+ on your system
- Creates a private Python environment in VS Code's global storage
- Installs the
krnl-codepackage - Starts the agent backend process on a local port
- Opens a streaming connection for provider + key configuration
- Sends the user's task to the backend
- Events stream back: tokens, tool_start, diff, approval_request, done
Supported Editors
The same extension works across editors compatible with VS Code extensions:
Full support via VS Code Marketplace. All features: webview, commands, settings, SecretStorage keys.
Compatible via Open VSX installation. Same extension, same features. Also supports git worktree isolation (shadow workspace).
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.
| Provider | Type | Env Variable | Default Model |
|---|---|---|---|
| Krnl | openai | KRL_API_KEY | gpt-4.1-mini |
| OpenAI | openai | OPENAI_API_KEY | gpt-4o-mini |
| OpenRouter | openai | OPENROUTER_API_KEY | nex-agi/nex-n2-pro:free |
| Anthropic (Claude) | anthropic | ANTHROPIC_API_KEY | claude-sonnet-4-6 |
| Google Gemini | openai | GEMINI_API_KEY | gemini-3.5-flash |
| Groq | openai | GROQ_API_KEY | llama-3.3-70b-versatile |
| Cerebras | openai | CEREBRAS_API_KEY | llama-3.3-70b |
| DeepSeek | openai | DEEPSEEK_API_KEY | deepseek-chat |
| Together AI | openai | TOGETHER_API_KEY | Kimi-K2-Instruct |
| Mistral AI | openai | MISTRAL_API_KEY | mistral-large-latest |
| xAI (Grok) | openai | XAI_API_KEY | grok-2-latest |
| Vercel AI Gateway | openai | AI_GATEWAY_API_KEY | anthropic/claude-sonnet-4.5 |
| Ollama (local) | openai | (none) | qwen3.5-coder:7b |
| LM Studio (local) | openai | (none) | local-model |
KRL_API_KEYOPENAI_API_KEYOPENROUTER_API_KEYANTHROPIC_API_KEYGEMINI_API_KEYGROQ_API_KEYCEREBRAS_API_KEYDEEPSEEK_API_KEYTOGETHER_API_KEYMISTRAL_API_KEYXAI_API_KEYAI_GATEWAY_API_KEY(none)(none)/baseurl to any OpenAI-compatible API and Krnl will use it. This includes vLLM, llama.cpp, text-generation-webui, and custom proxies.Web Search Providers
The agent can search the web during tasks. Four providers are supported, auto-detected from environment variables:
| Provider | Auth | Priority |
|---|---|---|
| DuckDuckGo | None (keyless) | Default |
| Tavily | TAVILY_API_KEY | If key set |
| Brave | BRAVE_API_KEY | If key set |
| SerpAPI | SERPAPI_API_KEY | If key set |
None (keyless)TAVILY_API_KEYBRAVE_API_KEYSERPAPI_API_KEYThe agent also has a web_fetch tool that retrieves and extracts readable text from any URL — no API key needed.
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.
| Target | Kind | CLI | Credential Env | Free Tier |
|---|---|---|---|---|
| cloudrun | cloud | gcloud | GOOGLE_APPLICATION_CREDENTIALS | Yes |
| cloudflare | edge | wrangler | CLOUDFLARE_API_TOKEN | Yes |
| vercel | paas | vercel | VERCEL_TOKEN | Yes |
| netlify | static | netlify | NETLIFY_AUTH_TOKEN | Yes |
| render | paas | render | RENDER_API_KEY | Yes (idles) |
| fly | container | fly | FLY_API_TOKEN | Billable |
| railway | paas | railway | RAILWAY_TOKEN | Trial |
| docker | container | docker | DOCKER_TOKEN | Yes |
| helm / kubernetes | container | helm/kubectl | KUBECONFIG | Cluster cost |
| aws-sam | cloud | sam | AWS_ACCESS_KEY_ID | Billable |
| azure-aca | cloud | az | AZURE_CLIENT_ID | Yes |
| neon (DB) | db | neonctl | NEON_API_KEY | Yes |
| supabase (DB) | db | supabase | SUPABASE_ACCESS_TOKEN | Yes |
gcloudcloudGOOGLE_APPLICATION_CREDENTIALSwrangleredgeCLOUDFLARE_API_TOKENvercelpaasVERCEL_TOKENnetlifystaticNETLIFY_AUTH_TOKENrenderpaasRENDER_API_KEYflycontainerFLY_API_TOKENrailwaypaasRAILWAY_TOKENdockercontainerDOCKER_TOKENhelm/kubectlcontainerKUBECONFIGsamcloudAWS_ACCESS_KEY_IDazcloudAZURE_CLIENT_IDneonctldbNEON_API_KEYsupabasedbSUPABASE_ACCESS_TOKENfree_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.
| Provider | Required Env Vars |
|---|---|
| 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:
| Channel | Config |
|---|---|
| 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:
View repository state and pending changes before making edits.
Stage all changes and commit with a message. Gated behind approval.
Create branches and push to remote. Requires approval.
Create pull requests via gh pr create. Requires GitHub CLI.
Create isolated git worktrees in .krnl/worktrees/ for safe parallel changes.
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 endpointBoth 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 totalsEnvironment Variables Reference
Agent Configuration
| Variable | Purpose |
|---|---|
| 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
| Variable | Provider |
|---|---|
| KRL_API_KEY | Krnl |
| OPENAI_API_KEY | OpenAI |
| OPENROUTER_API_KEY | OpenRouter |
| ANTHROPIC_API_KEY | Anthropic (Claude) |
| GEMINI_API_KEY | Google Gemini |
| GROQ_API_KEY | Groq |
| CEREBRAS_API_KEY | Cerebras |
| DEEPSEEK_API_KEY | DeepSeek |
| TOGETHER_API_KEY | Together AI |
| MISTRAL_API_KEY | Mistral AI |
| XAI_API_KEY | xAI (Grok) |
| AI_GATEWAY_API_KEY | Vercel AI Gateway |
Deployment & Operations
| Variable | Purpose |
|---|---|
| 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 |
