Krnl Code - VS Code Extension
A lightweight agentic coding assistant that brings the power of autonomous AI coding directly to your editor. Plan, edit, and run code with approvals using your preferred AI provider.

Features
- Universal Model Support: Works with Krnl/Krnl, OpenAI, OpenRouter, Anthropic, Ollama, or any OpenAI-compatible/self-hosted model
- Autonomous Coding: The agent plans, reads, edits, runs commands, and verifies results iteratively until your task is complete
- Approval Workflow: Human approval required for potentially dangerous operations - you stay in control
- Plan Mode: Research and propose changes before execution - perfect for complex refactors
- Multi-Model Routing: Assign different models to different phases (plan/execute/subagent/verify) for optimal cost-performance
- Security First: Built-in security auditing, dependency scanning, and approval workflows
- Session Persistence: Remember conversations per workspace across reloads
- Project Memory: Create
AGENTS.md files to provide project-specific context to the agent
- CLI Integration: Full command-line interface for headless operation and CI/CD pipelines
Installation
VS Code Marketplace
Install "Krnl Code" directly from the VS Code Marketplace
Open VSX (for Cursor, VSCodium, Windsurf)
Install from Open VSX
Manual Installation
Download the extension directly: krnl-code.vsix
Then install from the command line:
code --install-extension krnl-code.vsix
Or build from source:
# Install using vsce
npm install -g @vscode/vsce
cd extension
vsce package
code --install-extension krnl-code-*.vsix
Quick Start
- Install the Extension - Search for "Krnl Code" in the VS Code Extensions panel and install
- Open the Chat Panel - Click the robot icon in the activity bar or run
Krnl Code: Open Chat
- Configure Your Provider - Click the key icon to set your API key and select your provider
- Start Coding - Type your task in the chat and watch the agent work!
Configuration
Setting API Key
- Open the Krnl Code chat panel
- Click the key icon (Set API Key / Provider) or run
Krnl Code: Set API Key / Provider
- Select your provider (openai, anthropic, gemini, groq, ollama, etc.)
- Paste your API key when prompted
- Your key is stored securely in
~/.krnl-code

Provider Selection
- OpenAI: Supports GPT-4, GPT-3.5, and other OpenAI models
- Anthropic: Native Claude support with enhanced capabilities
- Google Gemini: Direct integration with Google's models
- OpenRouter: Access to 200+ models through a single API
- Groq: Ultra-fast inference with Llama and Mixtral models
- Ollama: Run local models like Llama 3, Mistral, etc.
- Custom: Any OpenAI-compatible endpoint
Extension Settings
Configure these in VS Code Settings (Ctrl+,) under Krnl Code:
- Model: Override the model ID for the active provider (empty = provider default)
- Python Path: Python 3.9+ executable for the managed backend (empty = auto-detect)
- Backend Version: Pin the krnl-code backend version (empty = latest)
- Server URL: Connect to a self-hosted backend (advanced)
- Token: Bearer token for remote/self-hosted backend
- Persist History: Remember conversation per workspace across reloads (default: true)
- Effort: Reasoning effort for thinking-capable models (low/medium/high)
- Auto Diagnostics: Offer to fix new error diagnostics after tasks (default: true)
Commands
Chat & Task Management
| Command |
Description |
Krnl Code: Open Chat |
Open the main chat interface |
Krnl Code: Stop Current Task |
Stop the currently running task |
Krnl Code: Undo Last Task's Changes |
Revert file changes from the last task |
Configuration
| Command |
Description |
Krnl Code: Set API Key / Provider |
Configure your API key and provider |
Krnl Code: Select Provider |
Switch between AI providers |
Krnl Code: Set Model |
Change the model for the active provider |
Krnl Code: Select Workspace Folder |
Choose the working directory |
Modes & Controls
| Command |
Description |
Krnl Code: Toggle Auto-Approve |
Enable/disable automatic approval for edits |
Krnl Code: Toggle Plan Mode |
Switch between plan and execute modes |
Krnl Code: Toggle Dangerous Mode |
Disable all approvals (use with caution!) |
Project & Memory
| Command |
Description |
Krnl Code: Create Project Memory |
Create AGENTS.md for project-specific context |
Krnl Code: Onboard Project |
Scaffold .krnl/ wrapper with memory and skills |
Code Quality & Security
| Command |
Description |
Krnl Code: Fix Diagnostics |
Automatically fix error diagnostics in changed files |
Krnl Code: Review Changes |
Review uncommitted git changes for bugs and improvements |
Backend Management
| Command |
Description |
Krnl Code: Restart Backend |
Restart the Python backend server |
Krnl Code: Attach Image |
Attach an image to the current conversation |
Account
| Command |
Description |
Krnl Code: Login |
Authenticate with your Krnl Code account |
Krnl Code: Check Authentication Status |
View your current authentication status |
Krnl Code: Logout |
Sign out of your account |
In-Chat Slash Commands
While in the chat interface, you can use these commands:
Setup & Configuration
/provider <name> - Switch the active provider
/key - Set the API key for the active provider
/model <id> - Set the model ID
/baseurl <url> - Set custom base URL
/config - Show current configuration
/providers - List all provider profiles
/models - Show multi-model routing table
/effort <low|medium|high> - Set reasoning effort
Modes
/plan - Enable plan mode (research first, then execute)
/execute - Enable execute mode (default)
Code Work
/review - Review uncommitted git changes
/security - Full security audit of the codebase
/scan - Fast secret + dependency vulnerability scan
/secfix - Autonomous security remediation
/test [target] - Write and run tests
/testall - Build comprehensive test suite
/ship [what] - End-to-end: plan → build → test → deploy
/deploy [target] - Deploy to a live URL
/monitor - Show monitoring status
/heal [url] - Self-heal deployment
Project & Memory
/init - Create AGENTS.md project memory
/onboard - Scaffold .krnl/ wrapper
/skills - List available skills
/search <text> - Search past sessions
Safety & Diagnostics
/audit - Show tamper-evident action log
/doctor - Run environment self-check
/yes - Toggle auto-approve
/dangerous - Toggle dangerous mode
Session Control
/usage - Show token usage and costs
/compact - Summarize conversation to free context
/undo - Revert last task's changes
/reset - Clear conversation context
/help - Show help
/exit - Quit session
CLI Installation
For headless operation or CI/CD integration, install the CLI using the one-liner:
Windows (PowerShell):
irm https://krnl.ai/install.ps1 | iex
macOS / Linux:
curl -fsSL https://krnl.ai/install.sh | sh
Or download the standalone binary:
Download the pre-built executable for your platform from Vercel Blob storage:
Note: macOS Intel (x64) is not currently supported. Please use an Apple Silicon (ARM64) Mac or build from source.
# Linux / macOS
chmod +x krnl-code-*
./krnl-code-* --help
# Start interactive session
./krnl-code-*
# Run single task
./krnl-code-* run "Fix the login bug"
# Auto-approve mode
./krnl-code-* run "Add tests" --yes
# Windows (double-click or run in terminal)
krnl-code-windows-x64.exe --help
# Start interactive session
krnl-code-windows-x64.exe
# Run single task
krnl-code-windows-x64.exe run "Fix the login bug"
# Auto-approve mode
krnl-code-windows-x64.exe run "Add tests" --yes
CLI Commands
| Command |
Description |
krnl-code |
Start interactive session |
krnl-code run "<task>" |
Run single task and exit |
krnl-code serve |
Run HTTP/WebSocket server |
krnl-code providers |
List configured providers |
krnl-code models |
Show multi-model routing table |
krnl-code init |
Scaffold config.yaml and .env |
krnl-code update |
Update to latest version |
krnl-code onboard |
Scaffold .krnl/ wrapper |
krnl-code security |
Run security audit |
krnl-code scan |
Fast risk scan |
krnl-code secfix |
Security remediation loop |
krnl-code test |
Write and run tests |
krnl-code ship "<what>" |
End-to-end deployment |
krnl-code deploy |
Deploy to live URL |
krnl-code monitor |
Show monitoring status |
krnl-code heal |
Self-heal deployment |
krnl-code doctor |
Environment self-check |
krnl-code audit |
Show action log |
krnl-code init-ci |
Create GitHub Actions workflow |
krnl-code plugin |
Manage plugins/skills |
krnl-code sessions |
List saved sessions |
krnl-code team |
List multi-agent teams |
krnl-code schedule |
Cron-driven scheduled agents |
How It Works
- Task Input: You describe what you want to accomplish in natural language
- Planning: The agent analyzes your request and creates a step-by-step plan
- Execution: The agent uses tools to read files, edit code, run commands, and verify results
- Approval: For potentially dangerous operations, the agent asks for your approval
- Iteration: The agent continues until the task is complete or you stop it
- Learning: The agent remembers context and improves with each interaction
Security & Privacy
- Local Execution: All file operations happen on your machine
- Approval Required: Dangerous operations require explicit approval
- Audit Trail: All actions are logged in
.krnl/audit/
- Secure Storage: API keys stored securely in
~/.krnl-code
- Sandbox: Tools run with appropriate permissions and restrictions
- No Code Sending: Your code is only sent to the AI provider you choose
Requirements
- VS Code: Version 1.85.0 or higher
- Python: 3.9 or higher (auto-managed by extension)
- API Key: For your chosen AI provider
Troubleshooting
Backend won't start
- Ensure Python 3.9+ is installed
- Check
krnlAgent.pythonPath setting if using custom Python
- Run
Krnl Code: Restart Backend
API key issues
- Verify your key is correct for the selected provider
- Check provider status pages for outages
- Try
/config to view current configuration
Context issues
- Use
/compact to summarize long conversations
- Enable project memory with
/init or /onboard
- Adjust model for larger context windows
Support
- For issues and questions, please contact us at
https://krnl-code.vercel.app/support