chkit codegen
Shortcut for chkit plugin codegen codegen. Generates TypeScript row types, optional Zod schemas, and ingestion functions from your schema definitions.
Synopsis
Section titled “Synopsis”chkit codegen [flags]| Flag | Type | Default | Description |
|---|---|---|---|
--check | boolean | false | Validate generated artifacts are up-to-date without writing |
--out-file <path> | string | — | Override output file path |
--emit-zod | boolean | — | Enable Zod validator generation |
--no-emit-zod | boolean | — | Disable Zod validator generation |
--emit-ingest | boolean | — | Enable ingestion function generation |
--no-emit-ingest | boolean | — | Disable ingestion function generation |
--ingest-out-file <path> | string | — | Override ingestion output file path |
--bigint-mode <mode> | string | — | Large integer mapping: string or bigint |
--include-views | boolean | false | Include views in generated output |
Global flags documented on CLI Overview.
Behavior
Section titled “Behavior”This command delegates to the codegen plugin’s codegen command. The codegen plugin must be registered in your config’s plugins array with manifest.name equal to "codegen".
If the codegen plugin is not configured, the command fails with: “Codegen plugin is not configured. Add a plugin with manifest.name “codegen” to config.plugins.”
Check mode
Section titled “Check mode”With --check, the command validates that generated artifacts are current without writing files. This is useful in CI to detect stale types. Failure codes include:
codegen_missing_output— types file missingcodegen_stale_output— types content has driftedcodegen_missing_ingest_output— ingest file missing (whenemitIngestis enabled)codegen_stale_ingest_output— ingest content has drifted
Examples
Section titled “Examples”chkit codegenchkit codegen --checkchkit codegen --emit-zod --include-viewsExit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (including stale check) |
| 2 | Invalid plugin options |
Related
Section titled “Related”- Codegen plugin reference — full documentation for configuration, options, and CI integration
chkit generate— automatically runs codegen whenrunOnGenerateis enabledchkit plugin— list and run plugin commands directly