Skip to content

chkit codegen

Shortcut for chkit plugin codegen codegen. Generates TypeScript row types, optional Zod schemas, and ingestion functions from your schema definitions.

chkit codegen [flags]
FlagTypeDefaultDescription
--checkbooleanfalseValidate generated artifacts are up-to-date without writing
--out-file <path>stringOverride output file path
--emit-zodbooleanEnable Zod validator generation
--no-emit-zodbooleanDisable Zod validator generation
--emit-ingestbooleanEnable ingestion function generation
--no-emit-ingestbooleanDisable ingestion function generation
--ingest-out-file <path>stringOverride ingestion output file path
--bigint-mode <mode>stringLarge integer mapping: string or bigint
--include-viewsbooleanfalseInclude views in generated output

Global flags documented on CLI Overview.

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.”

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 missing
  • codegen_stale_output — types content has drifted
  • codegen_missing_ingest_output — ingest file missing (when emitIngest is enabled)
  • codegen_stale_ingest_output — ingest content has drifted
Terminal window
chkit codegen
Terminal window
chkit codegen --check
Terminal window
chkit codegen --emit-zod --include-views
CodeMeaning
0Success
1Error (including stale check)
2Invalid plugin options