Getting started
Install the tooling and get your first squiggle.
Check templates from the terminal
Clone and install
git clone https://github.com/eduwass/edge-language-tools
cd edge-language-tools
npm installgit clone https://github.com/eduwass/edge-language-tools
cd edge-language-tools
pnpm installgit clone https://github.com/eduwass/edge-language-tools
cd edge-language-tools
yarn installgit clone https://github.com/eduwass/edge-language-tools
cd edge-language-tools
bun installLink the CLIs into your project
Register the packages from the clone:
cd packages/check && npm link
cd ../codegen && npm linkcd packages/check && pnpm link --global
cd ../codegen && pnpm link --globalcd packages/check && yarn link
cd ../codegen && yarn linkcd packages/check && bun link
cd ../codegen && bun linkThen, in your own project:
npm link @edge-language-tools/check
npm link @edge-language-tools/codegenpnpm link --global @edge-language-tools/check
pnpm link --global @edge-language-tools/codegenyarn link @edge-language-tools/check
yarn link @edge-language-tools/codegenbun link @edge-language-tools/check
bun link @edge-language-tools/codegenNo project of your own yet? Skip linking — you can run the checker directly from the clone with node packages/check/src/cli.ts /path/to/templates (or the same with bun).
Declare a template's types
{{--
@types {
user: { displayName: string, bio: string }
}
--}}
<h2>{{ user.displayName }}</h2>Run the check
npx edge-check templates/pnpm exec edge-check templates/yarn edge-check templates/bunx edge-check templates/templates/profile.edge:9:56 - error TS2551: Property 'displayNaem' does not
exist on type '{ displayName: string; bio: string; }'. Did you mean 'displayName'?
1 error across 4 checked templates (1 unchecked, 5 total)Exit code is 1 when errors exist — wire it into CI. --format json emits machine-readable diagnostics.
Typed render calls
Generate a registry of every template’s declared props:
npx edge-codegen templates/ --out edge-templates.d.tspnpm exec edge-codegen templates/ --out edge-templates.d.tsyarn edge-codegen templates/ --out edge-templates.d.tsbunx edge-codegen templates/ --out edge-templates.d.tsThen cast once at setup:
import { Edge } from 'edge.js'
import type { TypedEdge } from './edge-templates.d.ts'
const edge = Edge.create() as unknown as TypedEdge
await edge.render('profile', { user }) // wrong props = compile error
Run with --watch to regenerate as templates change. Templates without a @types block stay callable with any props.
Editors
See Editor setup for VS Code, Cursor, and Zed.