Skip to content
Foldcase

Quickstart

From nothing to a green run:

bash
mkdir hello && cd hello && bun init -y
bun add -d foldcase@alpha effect@4.0.0-beta.102 @effect/platform-bun@4.0.0-beta.102

Under Node 22.18+ swap the tooling: npm install -D foldcase@alpha effect@4.0.0-beta.102 @effect/platform-node@4.0.0-beta.102, then npx foldcase wherever this page says bunx foldcase-bun. Pin the platform package to the same Effect beta your app pins — latest is still the v3 major and will not load; see Peer dependencies.

hello.showcase.ts — self-contained, so the pipeline shows without Foldkit:

ts
import assert from "node:assert/strict"

import type { Showcase } from "foldcase"

type Model = { count: number }
const update = (model: Model, step: number): Model => ({ count: model.count + step })

export const showcases: ReadonlyArray<Showcase> = [
  {
    id: "counter/counts-two-clicks",
    play: () => {
      const model = update(update({ count: 0 }, 1), 1)
      assert.equal(model.count, 2)
    },
  },
]
bash
bunx foldcase-bun test
text
  ✓ counter/counts-two-clicks

1 total · 1 passed · 0 failed

Exit code 0. In a Foldkit app, play holds a Story and the record carries the real Message and Model Schemas — see Writing a Showcase.

Last updated Aug 4, 2026