npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vibe-lang/vibe

v0.2.11

Published

Vibe runtime

Readme


What is Vibe?

Vibe is a domain-specific language designed for AI agent orchestration. Write declarative prompts with type safety, compose multi-step workflows, and let the runtime handle the complexity of LLM interactions. Vibe runs on a TypeScript runtime, giving you seamless access to the entire npm ecosystem.

Installation

npm install -g @vibe-lang/vibe
# or
bun install -g @vibe-lang/vibe

Quick Start

Create a .env file with your API key:

ANTHROPIC_API_KEY=sk-ant-api03-xxxxxxxxxxxxx

Create hello.vibe:

model translator = {
  name: "claude-haiku-4.5",
  provider: "anthropic",
  apiKey: env("ANTHROPIC_API_KEY")
}

const languages: text[] = do "List the major human languages"

for language in languages {
  const translated = do "Translate 'Hello World' into {language}"
  print(translated)
}

Run it:

vibe hello.vibe

Features

  • Type-Safe AI Responses — Define expected return types (text, number, boolean, json, arrays) and get validated results
  • Context Awareness — Variables are automatically visible to AI prompts via string interpolation
  • Seamless TypeScript Interop — Import npm packages, call TypeScript functions, embed TS blocks directly in your code
  • Automagical Async Handling — Use async for parallel AI calls with automatic dependency resolution
  • Easy Custom Tool Creation — Define tools with a simple syntax that AI models can invoke
  • Private Variables — Mark variables as private to exclude them from AI context
  • Provider Agnostic — Works with OpenAI, Anthropic, Google, and any OpenAI-compatible API

Examples

AI-Native Syntax

Prompts are first-class language primitives.

// Traditional approach - verbose and clunky
const response = await openai.chat.completions.create({
  model: "gpt-5.2",
  messages: [{ role: "user", content: prompt }]
});
const answer = response.choices[0].message.content;

// Vibe - clean and expressive
const answer = do "Explain quantum computing"

Strong Typing

AI calls return typed values.

// Vibe automatically returns the right type
const count: number = do "How many planets?"
const isPrime: boolean = do "Is 17 prime?"
const tags: text[] = do "List 3 languages"

// Use them directly - no parsing needed
print(count + 1)        // 9
print(!isPrime)         // false
print(tags[0])          // "English"

Seamless TypeScript Interop

Drop into TypeScript whenever you need it.

// Embed TypeScript for complex operations
const result = ts(data) {
  const parsed = JSON.parse(data);
  return parsed.items
    .filter(item => item.score > 0.8)
    .map(item => item.name)
    .join(", ");
}

// Import from TypeScript files
import { processData } from "./utils.ts"

// Use npm packages directly
const html = ts(markdown) {
  return require('marked').parse(markdown);
}

Smart Context

Automatically manages AI context windows.

function analyze(url: text): text {
  const html = fetch(url)
  const content = do "Extract article text: {html}"
  return do "Summarize the content of the article"
}

const articles: text[] = ["https://example.com/1", "https://example.com/2"]
const summaries: text[] = []

for article in articles {
  const summary = analyze(article)
  summaries.push(summary)
} forget
// } compress
// } verbose

Custom Tools

Define tools that AI can invoke with full type safety.

import { createIncident } from "./pagerduty.ts"

tool alertOnCall(severity: text, title: text, details: text): json
  @description "Create an incident and page the on-call engineer"
{
  ts(severity, title, details) {
    return createIncident({ severity, title, details })
  }
}

tool getMetrics(service: text, hours: number): json
  @description "Get performance metrics for a service"
{
  ts(service, hours) {
    const res = await fetch(env("METRICS_API") + "/v1/query?service=" + service + "&hours=" + hours)
    return res.json()
  }
}

model monitor = {
  name: "claude-opus-4.5",
  provider: "anthropic",
  apiKey: env("ANTHROPIC_API_KEY"),
  tools: [getMetrics, alertOnCall]
}

vibe "Check api-gateway metrics. Alert if critical."

Multi-Provider Support

Switch between OpenAI, Anthropic, and Google AI.

model gpt = {
  name: "gpt-5.2",
  provider: "openai",
  apiKey: env("OPENAI_API_KEY")
}

model haiku = {
  name: "claude-haiku-4.5",
  provider: "anthropic",
  apiKey: env("ANTHROPIC_API_KEY")
}

model gemini = {
  name: "gemini-3-pro",
  provider: "google",
  apiKey: env("GOOGLE_API_KEY")
}

const answer = do "Explain recursion"

The 'vibe' Keyword

Core of agent orchestration.

import { writeFile } from "system/tools"

model poet = {
  name: "claude-haiku-4.5",
  provider: "anthropic",
  apiKey: env("ANTHROPIC_API_KEY"),
  tools: [writeFile]
}

const topics = ["sunset", "coffee", "mountains", "rain", "stars"]

vibe "Write a poem for each topic and save to separate file"

Parallel Execution

Run multiple AI calls concurrently with automatic dependency resolution.

async let summary = do "Summarize this document"
async let keywords: text[] = do "Extract 5 keywords"
async let sentiment: text = do "What is the sentiment?"

// All three run concurrently, await automatically when used
let report = do "Create a report using: {summary}, {keywords}, {sentiment}"

VS Code Extension

Get syntax highlighting and language support for .vibe files:

code --install-extension vibelang.vibe-language

Documentation

Visit vibelang.net/docs for the full language guide.

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

License

ISC