Getting Started
Get a working VibeLang project running and tested in under two minutes, then see how every piece fits together. (Welcome explains the motivation; this page gets code running on your machine.)
1. Create and run the starter
You need Node 22.22.3 (22.x) or Node 24.11.1 or later. Bun is optional. If you use it, install Bun 1.4.2 or later. See how to run sources with Bun.
npm create vibelang@latest my-app
cd my-app
npm run start
npm run testWith Bun as the package manager:
bun create vibelang@latest my-app
cd my-app
bun run start
bun run testThe starter prints:
Hello, VibeLang!
Recovered from EmptyNameWhat just ran?
Open the scaffolded files to see the three pieces of a VibeLang app:
| File | Role |
|---|---|
src/greeting.vibe | Declares error EmptyName and effect function greeting(name) that throws it on empty input. |
src/main.vibe | Declares a Greeter service, wires it with Layer.succeed, reads it via try Greeter, recovers from EmptyName with catch effect, and calls NodeRuntime.runMain(main()) at module top level. |
src/greeting.test.vibe | Tests both success and failure paths with it.effect from @effect/vitest. Vitest compiles .test.vibe on the fly through vibelang-vite. |
Run npm run dev (or bun run dev) during development: it starts vibelang --watch, waits for the first build, and restarts Node whenever output changes. Press Ctrl+C to stop both.
A build writes JavaScript to dist/ and declaration pairs (greeting.d.vibe.ts, forwarding greeting.d.ts, and .vibelang-sidecar-*.owner receipts) into .vibe/declarations/. Both directories are gitignored so src/ stays clean.
2. Your first program in one file
Everything in the starter fits in 17 lines. Read it top to bottom โ notice there are no imports for Console, Effect, or try/catch:
import * as NodeRuntime from "@effect/platform-node/NodeRuntime"
error EmptyName
effect function greeting(name: string) {
if (name.length === 0) throw new EmptyName()
return `Hello, ${name}!`
}
effect function main() {
try Console.log(try greeting("VibeLang"))
const recovered = greeting("") catch (error) => `Recovered from ${error._tag}`
try Console.log(recovered)
}
NodeRuntime.runMain(main())
// Output: Hello, VibeLang!
// Output: Recovered from EmptyNameWatch the compiler work for you. The compiler infers
greetingasstring!EmptyName(Effect<string, EmptyName, never>).
- If a caller runs
try greeting(s)with no return annotation,EmptyNameautomatically flows into the caller's own error channel.- If a caller promises no failures (
effect function caller(): string!! { return try greeting("") }), leaving that failure unhandled is a compile error: catchEmptyNameor add it to the signature.
To understand the contract in depth, read The Effect Type, Creating Effects, and Running Effects.
3. Set up your editor
The VS Code / Cursor extension ships inside the vibelang package:
code --install-extension node_modules/vibelang/editor/vibelang.vsixFor Neovim, Zed, platform prerequisites, or adding VibeLang to an existing codebase, see Installation.
4. Debug with source maps and spans
Run emitted JavaScript with node --enable-source-maps so stack traces point back to .vibe lines. Source maps do not record async caller chains and VibeLang adds no hidden spans; attach a named span where it helps with try withSpan(effect { ... }, "load"). See Debug stack traces.
5. Pick your next guide
These guides target Effect 4.1.1. On effect.website, select version 4 โ Effect 3 APIs differ.
| Goal | Start here |
|---|---|
| Learn the core model step by step | The Effect Type |
| Handle typed failures, retries, timeouts | Two Types of Errors ยท Expected Errors |
| Run work concurrently & safely cancel | Basic Concurrency |
| Wire dependencies with services & layers | Managing Services |
| Guarantee resource cleanup | Resource Management |
| Validate external JSON & inputs | Schema Introduction |
| Logs, metrics, and tracing | Logging |
| Process pull-based streams | Streams Introduction |
| Every VibeLang form vs. Effect TypeScript | Cheat sheet |
Using coding agents
The vibelang package ships an agent skill at node_modules/vibelang/skills/vibelang/SKILL.md. Run npx vibelang agents init to install it along with language-server hooks (Coding agents). Point your agent at the relevant guide plus your error and service declarations, then verify with vibelang and tests.
The matching Effect page: effect.website/docs/v4/getting-started