Codegen
Emit idiomatic per-language code from a single metadata model — Drizzle/Zod + Fastify for TS, JOOQ/Spring for Java, Pydantic/FastAPI for Python. Hand-edit-preserving regeneration via three-way merge.
MetaObjects
Cross-language metadata standard · Apache 2.0
Define typed entities once. Generate idiomatic code across TypeScript, Java, C#.NET, and Python. Use the same metadata at runtime. Catch drift in the type checker. The metamodel is the durable spine; generated code is the disposable artifact.
Emit idiomatic per-language code from a single metadata model — Drizzle/Zod + Fastify for TS, JOOQ/Spring for Java, Pydantic/FastAPI for Python. Hand-edit-preserving regeneration via three-way merge.
Load metadata at runtime and drive behavior dynamically — CRUD, validation, relationships, dynamic admin UIs, LLM tool registration. Less code in the repo; less surface area for AI to drift on.
Catch divergence between code and metadata before it ships. Compile-time breakage in the type checker when schemas change underneath the logic that depends on them.
| Language | Status | Details |
|---|---|---|
| TypeScript | v0.3 reference | Codegen + runtime + drift detection. 1,784+ tests passing. Bun-first dev workflow. |
| Java | In progress | H3a (loader restructure) shipped 2026-05-19. H3b (conformance harness) active. |
| C#.NET | Loader shipped | Loader, canonical serializer, and a dotnet test conformance runner that runs the full shared corpus. Codegen + runtime out of scope. |
| Python | Planned | Targeted for post-H3. Pydantic/FastAPI integration. |
Conformance fixtures live at fixtures/conformance/ -- 48 shared test cases that every implementation runs against the same expectations.
A typed entity in metadata, a project config that picks the generators, and the three CLI commands you actually run. Drift detection is architectural — regenerated code breaks dependent logic at compile time, and meta migrate diffs metadata against the live database.
# metaobjects/subscriber.meta.yaml — the entity definition
metadata.root:
package: acme
children:
- object.entity:
name: Subscriber
children:
- field.long: { name: id }
- field.string: { name: email }
- field.string: { name: createdAt, "@autoSet": onCreate }
- identity.primary: { "@fields": id }
// metaobjects.config.ts — picks generators + DB target
import { defineConfig } from "@metaobjects/cli";
import { entityFile, queriesFile, routesFile, barrel }
from "@metaobjects/codegen-ts/generators";
export default defineConfig({
outDir: "./src/db",
dialect: "sqlite",
generators: [entityFile(), queriesFile(), routesFile(), barrel()],
});
# Scaffold metaobjects/ + .metaobjects/ + metaobjects.config.ts
$ meta init
# Generate code (entities, queries, routes, barrel) per config
$ meta gen
# Diff metadata vs live DB and emit migration SQL files
$ meta migrate --db file:./dev.db --slug add-subscriber
# Flatten loaded metadata to one canonical JSON artifact
$ meta export --out ./snapshot.json
Conformance fixtures (JSON form): fixtures/conformance/. YAML and JSON are equivalent — pick whichever your stack prefers.
Using Claude, Cursor, Copilot, or Windsurf? Point them at this site's llms.txt for an index of the spec, quickstarts, and reference material — or to llms-full.txt for the full Markdown corpus.
/llms.txt — short index following the Answer.AI llms.txt convention/llms-full.txt — full Markdown dump of spec + quickstart materialMetaObjects MCP server — coming. A Model Context Protocol server exposing the spec, conformance fixtures, and codegen tools as agent-callable functions. Track progress in the roadmap.
Universal across backends -- a Java server serving React uses the same TypeScript packages.