Skip to content

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 test

With Bun as the package manager:

bun create vibelang@latest my-app
cd my-app
bun run start
bun run test

The starter prints:

Hello, VibeLang!
Recovered from EmptyName

What just ran?

Open the scaffolded files to see the three pieces of a VibeLang app:

FileRole
src/greeting.vibeDeclares error EmptyName and effect function greeting(name) that throws it on empty input.
src/main.vibeDeclares 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.vibeTests 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 EmptyName

Watch the compiler work for you. The compiler infers greeting as string!EmptyName (Effect<string, EmptyName, never>).

  • If a caller runs try greeting(s) with no return annotation, EmptyName automatically 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: catch EmptyName or 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.vsix

For 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.

GoalStart here
Learn the core model step by stepThe Effect Type
Handle typed failures, retries, timeoutsTwo Types of Errors ยท Expected Errors
Run work concurrently & safely cancelBasic Concurrency
Wire dependencies with services & layersManaging Services
Guarantee resource cleanupResource Management
Validate external JSON & inputsSchema Introduction
Logs, metrics, and tracingLogging
Process pull-based streamsStreams Introduction
Every VibeLang form vs. Effect TypeScriptCheat 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