Quick Start

You don't write KERN. You tell an AI what you want, it writes KERN, you compile it. That's the workflow.

The workflow

1

Describe what you want

In plain English to any LLM (Claude, GPT, Gemini, etc.)

2

LLM writes .kern

The AI generates KERN — a compact, structured format it naturally understands

3

You compile

kern dev app.kern --target=nextjs and you have production code

4

Review & ship

kern review catches bugs. You deploy.

1. Install KERN

npm install -g @kernlang/cli

2. Prompt your LLM

Open Claude, ChatGPT, or any LLM. Give it the KERN spec and tell it what to build:

You are an expert in KERN, a compiled UI language.
Write a .kern file for a SaaS landing page with:
- Dark theme, orange accents
- Hero section with headline and two CTA buttons
- 3-column feature grid
- Pricing section with Free and Pro tiers
- Footer with links

Use the KERN spec from https://kernlang.dev/llm/spec.kern

The LLM generates a complete .kern file. You don't need to know the syntax — the AI does.

3. Save and compile

Paste the LLM output into a file and compile:

# Save the LLM output
pbpaste > landing.kern

# Compile to Next.js (watches for changes)
kern dev landing.kern --target=nextjs --outdir=app/

# Or compile to Vue
kern dev landing.kern --target=vue --outdir=src/

# Or compile to Express API
kern dev api.kern --target=express --outdir=src/

4. Review the output

Before shipping, run kern review on the generated code to catch bugs the AI might have introduced:

kern review app/ --recursive

5. Iterate with the LLM

Want changes? Just tell the AI:

"Add a testimonials section between features and pricing.
Make the hero headline bigger. Add a dark/light mode toggle."

The AI updates the .kern file. You recompile. That's it.

Why not just ask the AI to write React directly?

  • 70% fewer tokens — KERN is ~3x more compact. Cheaper, faster, less hallucination.
  • 11 targets from 1 source — Same .kern compiles to Next.js, Vue, Express, Python, Native, etc.
  • Guaranteed valid output — The compiler catches structural errors. Raw LLM code often has subtle bugs.
  • Review built in — 68 rules catch security issues, dead logic, and framework mistakes automatically.

Try it now