DocsQuick Start
Getting Started

Quick Start

Get running with Krnl in minutes. Krnl is an AI coding agent that reads your codebase, reasons through tasks, and writes code with full context of your project conventions.

What is Krnl?

Krnl is a coding agent that works in your terminal, VS Code, or as a desktop app. Unlike simple code completion tools, Krnl understands your entire codebase through a Code Knowledge Graph, remembers your conventions across sessions, and follows a minimalist coding philosophy called Razor Mode that avoids over-engineering.

Code Knowledge Graph

Parses your codebase into a graph of imports, calls, and inheritance — so the agent knows what connects to what without reading every file.

Razor Mode

YAGNI-first coding discipline. The agent writes minimal, surgical code — no boilerplate, no unnecessary abstractions, no wasted lines.

Safe by Default

All file edits require approval. Destructive operations are blocked. Full audit log of every action. Rollback anytime.

Prerequisites

An LLM API key — From OpenAI, Anthropic, Google, Groq, or any OpenAI-compatible provider
A project directory — Krnl works best in a git repository with existing code
Note: The CLI is a standalone binary — no Python or pip required. The VS Code extension also manages its own backend automatically.

Step 1: Install Krnl

Choose your preferred installation method and platform:

Select Platform

🪟

CLI for Windows

One-liner Installation
irm /install.ps1 | iex
Manual Download
Download
Installation Steps
  1. 1Open PowerShell as Administrator
  2. 2Run the one-liner command above
  3. 3Verify installation: krnl-code --help

Step 2: Authenticate

Krnl requires authentication to access the agent service. Run the login command:

krnl-code auth-login

This opens your browser for OAuth login. Credentials are saved to ~/.krnl/credentials.json and shared between CLI and VS Code extension.

Note: You need a Krnl account. If you don't have one, sign up at krnl.ai during the OAuth flow.

Step 3: Configure Your LLM Provider

Krnl works with 14+ LLM providers. You can configure them via environment variables or interactive slash commands.

Option A: Interactive Setup (Recommended)

Launch Krnl and use slash commands:

$ krnl-code
  ✦ Krnl Agent · Configuring...

  you ❯ /provider openai
  ✓ Provider set to: openai

  you ❯ /key
  Paste your API key: ****
  ✓ API key saved

  you ❯ /model gpt-4o
  ✓ Model set to: gpt-4o

  you ❯ /config
  provider : openai
  model    : gpt-4o
  api key  : set ✓

Option B: Environment Variables

Set environment variables before launching:

# OpenAI
export KRNL_PROVIDER=openai
export KRNL_API_KEY=sk-your-key-here
export KRNL_MODEL=gpt-4o

# Or Anthropic
export KRNL_PROVIDER=anthropic
export KRNL_API_KEY=sk-ant-your-key-here
export KRNL_MODEL=claude-sonnet-4-6

Supported Providers

OpenAI (gpt-4o, gpt-4o-mini)
Anthropic (Claude)
Google Gemini
Groq
OpenRouter
DeepSeek
Together AI
Mistral AI
xAI (Grok)
Cerebras
Ollama (local)
LM Studio (local)

Step 4: Run Your First Task

Navigate to your project directory and launch Krnl. Give it a coding task in natural language:

terminal
$ cd my-project
$ krnl-code
✦ Krnl Agent · openai · gpt-4o
● Graph DB: .krnl/graph.db · 312 nodes · 847 edges
Workspace: /home/dev/my-project
Type a task, or /help for commands.
you ❯ add input validation to the login handler
● Observe: Reading workspace...
● Observe: Found src/routes/login.py
● Graph resolved: login_handler()
● Plan: Add validation to login handler
⚙ edit_file src/routes/login.py
✓ Task completed in 2 steps

Core Concepts

Understanding these concepts will help you get the most out of Krnl:

AGENTS.md (Project Memory)

A markdown file in your project root that stores conventions, build commands, and coding standards. Loaded every session automatically.

Run /init to create one
Safe Mode vs Apply

By default, Krnl shows proposed changes as diffs and asks for approval before writing. Use --safe for dry-run or --apply to auto-execute.

Session Management

Each conversation is a session. Use --resume to continue the latest session or --session <id> for a specific one.

Multi-Model Routing

Krnl can use different models for different phases (planning vs execution). Run /multi-llm to see the routing table.

Essential Commands

Here are the most important commands to know as a new user:

Session Commands

/helpShow all available commands
/configShow current provider, model, and key status
/compactSummarize conversation to free up context window
/usageShow tokens, cost, and tool usage for this session
/doctorRun environment self-check

Code Work Commands

/reviewCode review of uncommitted git changes
/securityFull security audit with prioritized fixes
/test [file]Write and run tests for code
/initCreate AGENTS.md project memory file
/undoRevert file changes from the last task

Safety Commands

/yesToggle auto-approve for edits and commands
/auditView tamper-evident action audit log
/dangerousToggle YOLO mode (use with caution)

CLI Quick Reference

krnl-code                                    # Start interactive session
krnl-code --resume                           # Resume latest session
krnl-code --session <id>                     # Resume specific session
krnl-code run "add a /health route"         # One-shot task (non-interactive)
krnl-code run "fix bug" --yes                # Auto-approve all actions
krnl-code run "review PR" --json             # Output structured JSON
krnl-code providers                          # List configured providers
krnl-code models                             # List available models from provider
krnl-code doctor                             # Environment self-check
krnl-code auth-login                         # Authenticate via browser OAuth
krnl-code auth-status                        # Check auth status
krnl-code update                             # Update to latest version

Tips for New Users

1.Start with /doctor — Run this first to verify your environment is set up correctly.
2.Create AGENTS.md — Run /init to scaffold project memory. Add your build commands, lint rules, and coding conventions.
3.Use Plan Mode first — Run /plan before complex tasks. The agent will research and propose a plan before making changes.
4.Review diffs carefully — By default, Krnl shows proposed changes. Read the diffs before approving.
5.Use /compact liberally — When conversations get long, run /compact to summarize and free up context.
6.Check /usage — Monitor token usage and costs. Different models have different pricing.

What's Next?