Skip to content

CageA configuration compiler and validator for games

Reliably compile scattered, heterogeneous, human-authored configuration data into validated, deterministically built runtime configuration assets

中文 | English

Cage configuration compiler and validator architecture

Core flow ​

text
Authoring Sources → Source Adapters → Canonical Model
      → Validation Pipeline(L0 Parse ~ L7 Game Rules)
      → Normalize / IR → Target Generators → Manifest / Hash

Excel is only one kind of input source for Cage. Every input enters the unified Canonical Model, and once validation passes, deterministic assets are produced for the target platform — beyond the conversion itself, validation, references and normalization all happen on this same chain.

Interface previews ​

cage init — terminal question-and-answer wizard for new-project scaffolding (9 questions, one answer per line, back/defaults supported):

cage init interactive wizard

cage check — validation result view: error list with error code, source location and fix suggestion:

cage check validation result (error list)

cage check — environment view: field-level constraint comparison across the dev/test/staging/prod env_overrides sets:

cage check validation result (environment overrides)

cage check — structure tree view: schema and field hierarchy with types, constraints and profile visibility:

cage check validation result (structure tree)

Quick start ​

bash
cage init my-game                    # new project: interactive scaffold (terminal Q&A); check/build pass with zero edits
cd my-game                          # run inside the project root (where cage.toml lives)
cage check .                   # validate only, generate nothing
cage build . --profile client  # validate and generate the target artifacts
cage gen . --profile server    # code bindings and definition files only (cs/python/lua/ts/js/cpp/go/java/proto/flatbuffers/jsonschema/template)
cage diff build/a build/b            # compare two configuration versions
cage graph .                   # table reference dependency graph (text/dot/json, topo order and cycle list)
cage verify build/                   # audit the generated artifacts (re-hash every file against the ledger)
cage inspect . Item            # schema and configuration structure (project path required, table name optional)
cage assets . --write assets.json   # asset inventory baseline (--check reports missing / tampered / extra)
cage snapshot . --profile client    # build + pack a self-verifying snapshot (--verify before loading, --list lists packages)
cage registry publish . --registry reg/        # multi-version registry (publish / list / verify / GC / remove / export / import / push)
cage migrate .                 # preview the migration plan (dry-run; --write persists and re-verifies, --all runs the whole chain)
cage migrate-draft old.yaml new.yaml --from 1.0.0 --to 2.0.0   # draft a migration rule file from two schema versions
cage schema-draft . mysql:Items      # draft a schema by introspecting tables read-only (MySQL / PostgreSQL)
cage web ./                          # local Schema editor and project status page (binds 127.0.0.1 only)
cage lsp ./                          # stdio Language Server (IDE diagnostics, same pipeline as check)
cage mcp --stdio                     # AI assistant MCP server (validation / structure / build preview as read-only tools)

Documentation sections ​

  • Assets: three kinds of input assets — Schema / source data / build rules — plus asset management with artifact traceability (docs/design.md §50: the cage assets asset manifest and baseline re-check, four layers of backup defense, snapshot and registry versioning capabilities; examples/asset-workspace demonstrates the full lifecycle)

Released under the Apache-2.0 license