Bun

Primary Chimpbase host for the Bun runtime.

Bun is the primary runtime for Chimpbase. The package ships TypeScript source directly — no build step needed.

Install

bun add @chimpbase/bun

Create a runtime

import { createChimpbase } from "@chimpbase/bun";

const chimpbase = await createChimpbase({
  storage: { engine: "postgres", url: process.env.DATABASE_URL! },
});

Server

Chimpbase uses Bun.serve() under the hood for HTTP handling:

import { defineChimpbaseApp } from "@chimpbase/bun";
import { Hono } from "hono";

const app = new Hono();
app.get("/health", (c) => c.json({ ok: true }));

export default defineChimpbaseApp({
  project: { name: "my-app" },
  httpHandler: app.fetch,
  registrations: [/* ... */],
});

CLI

Run actions from the command line:

bun run chimpbase.app.ts action -- seedDemoWorkspace '[]'

Schema management:

bun run chimpbase.app.ts schema generate
bun run chimpbase.app.ts schema check

SQLite for local development

const chimpbase = await createChimpbase({
  storage: { engine: "sqlite", path: "./dev.db" },
});

Exports

import {
  createChimpbase,
  defineChimpbaseApp,
  loadChimpbaseApp,
  loadChimpbaseProject,
  runChimpbaseAction,
  startChimpbaseApp,
  syncChimpbaseSchema,
  syncChimpbaseWorkflowContracts,
} from "@chimpbase/bun";