Installation
From zero to compiled code in 30 seconds.
1. Install the CLI
Install the KERN CLI globally via npm:
npm install -g @kernlang/cliVerify the installation:
kern --version2. 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=nextjsNext.js App Router
--target=reactReact components
--target=tailwindReact + Tailwind
--target=nativeReact Native
--target=expressExpress.js API
--target=fastapiFastAPI (Python)
--target=cliCommander.js CLI
--target=terminalTerminal UI
--target=inkInk (React TUI)
--target=vueVue 3 SFC
--target=nuxtNuxt 3