okengine
v0.9.1
Published
One law. Eight elements. Ten exports. One package. One manifest. Every backend need is derived, never added.
Downloads
3,141
Readme
[!WARNING] Early development (
v0.x) — not production-ready.APIs, drivers, and tooling can change quickly, including breaking changes, until an initial stable release. Use for exploration and feedback — not production workloads yet.
Install
Requires Bun >=1.3.14.
bunx create-oke@latest my-app # scaffold (recommended)
bun add okengine # framework + `oke` CLI
bun install -g okengine # global `oke` on PATH
bunx jsr add @omqkhafi/okengine # JSR — library API onlyQuick start
bunx create-oke@latest my-app
cd my-app
oke dev
# or: oke mode docker && oke dev # compose infra · app on host Bun| Port | Surface |
| ------- | ------------------------------------------- |
| :6530 | App |
| :6533 | Console |
| :6535 | MCP (live Manifest) |
| :6536 | Docs MCP (handbook search/fetch, read-only) |
Mnemonic: O·K·E = 6·5·3.
The starter already exports a health Flow — change it and save; App and Console update from the same Manifest:
import { on, flow, http, gate } from "okengine";
import { z } from "zod";
export const health = on(
http.get("/health").gate(gate.public),
flow({
out: z.object({ ok: z.literal(true) }),
do: () => ({ ok: true as const }),
}),
);Call it with a typed client (contracts inferred — no separate codegen):
import { createClient } from "okengine/client";
import type { App } from "./app";
const api = createClient<App>("http://localhost:6530");
const { data, error } = await api.main.health({});Full walkthrough: Basic usage.
One law
Every backend behavior is a Flow: on(Trigger) → Effects. Endpoints, jobs, consumers, and webhooks are the same species — only the trigger changes.
import { on, flow, signal, store, clock, gate, vault, channel, ai, plugin } from "okengine";That is the entire public vocabulary. World access goes through fx — effects are inferred, so the Manifest can derive the typed client, Console, and MCP without a second source of truth.
| Element | Essence | | ----------- | ----------------------------- | | Flow | behavior | | Signal | data in motion | | Store | data at rest | | Clock | time | | Gate | permission to act | | Vault | protected knowledge | | Channel | reaching humans | | AI | reaching machine intelligence |
Theory: Introduction · Elements · Why OKE.
Next
| Want… | Go to |
| --------------------------- | ---------------------------------------------------------------------- |
| Scaffold details & modes | Installation |
| Declarative CRUD | store.resource |
| Auth, rate limits, sessions | Gate |
| Queues & live events | Signal |
| Email / SMS / push | Channel |
| oke commands | CLI |
Store apps sync schema with oke db push|generate|migrate (local oke dev auto-pushes). Prefer store.schema.table + field.*, or keep a hand-written Drizzle schema.ts.
Documentation
| Resource | Link |
| ------------ | -------------------------------------------------------------- |
| Docs site | oke.omqkhafi.dev |
| Get started | /docs/get-started |
| Handbook | /docs |
| Changelog | /changelog |
| Agents index | /llms.txt |
| Manifest | manifest.v1.schema.json |
| Budgets | BUDGETS.md |
| Contributing | CONTRIBUTING.md |
