Installation

From zero to compiled code in 30 seconds.

1. Install the CLI

Install the KERN CLI globally via npm:

npm install -g @kernlang/cli

Verify the installation:

kern --version

2. Write your first .kern file

Create app.kern:

page name=Hello
  metadata title="Hello World"

  col {ai:center,p:80,gap:16}
    text value="Hello World" tag=h1
      {fs:48,fw:800,c:#fff}
    text value="Built with KERN" tag=p
      {fs:18,c:#a1a1aa}
    button text="Get Started" to=start
      {bg:#f97316,c:#fff,br:8,p:16}

7 lines. Defines a full page with metadata, layout, typography, and a navigation button.

3. Compile

Run the compiler with your target:

kern dev app.kern --target=nextjs --outdir=app/

KERN watches for changes and recompiles automatically. The output lands in your Next.js app/ directory as page.tsx.

4. See what KERN generates

Your .kern compiles to a typed Next.js component:

import type { Metadata } from 'next';
import Link from 'next/link';

export const metadata: Metadata = {
  title: 'Hello World',
};

export default function Hello() {
  return (
    <div className="items-center p-[80px] gap-4 flex flex-col">
      <h1 className="text-[48px] font-extrabold text-white">
        Hello World
      </h1>
      <p className="text-lg text-zinc-400">
        Built with KERN
      </p>
      <Link href="/start"
        className="bg-orange-500 text-white rounded-lg p-4">
        Get Started
      </Link>
    </div>
  );
}

7 lines of KERN → ~25 lines of TypeScript. 70% fewer tokens.

5. Choose your target

Change the --target flag to compile to any of 11 targets:

--target=nextjs

Next.js App Router

--target=react

React components

--target=tailwind

React + Tailwind

--target=native

React Native

--target=express

Express.js API

--target=fastapi

FastAPI (Python)

--target=cli

Commander.js CLI

--target=terminal

Terminal UI

--target=ink

Ink (React TUI)

--target=vue

Vue 3 SFC

--target=nuxt

Nuxt 3

Next steps