Skip to content

ct types

Generate TypeScript definitions for editor IntelliSense.

Terminal window
ct types .
ct types [dir] [flags]
ArgumentRequiredDescription
dirnoProject directory (default: current directory).
FlagTypeDefaultDescription
--outputstring~/.ct/types/<project-hash>Output directory for generated files
--operatorboolfalseInclude operator globals (getStatus, setStatus, fetch, log, Env)
--devboolfalseGenerate dev.d.ts for dev.ct IDE support
FileContents
values.d.tsCtValues interface inferred from values.json / values.yaml
globals.d.tsdeclare const Values: CtValues + runtime globals
dev.d.ts (with --dev)Dev globals: config(), dev(), env(), prompt() + CtResource + CtEnvKey unions

The command also resolves and caches URL imports so IDE resolution works offline.

Output directory defaults to ~/.ct/types/<project-hash>. The path is printed to stdout so tools (e.g. the CT VS Code extension) can consume it.

Generate types for current project:

Terminal window
ct types .

Generate to a custom output directory:

Terminal window
ct types . --output ./.ct/types

Include operator globals:

Terminal window
ct types . --operator

Generate dev.ct typings:

Terminal window
ct types . --dev

All flags combined:

Terminal window
ct types . --operator --dev --output ./types
Terminal window
ct types . --operator

Adds declarations for operator runtime globals:

GlobalDescription
getStatusRead the custom resource status
setStatusWrite the custom resource status
fetchHTTP fetch inside the operator runtime
logStructured logging
EnvOperator environment variables
Terminal window
ct types . --dev

Generates dev.d.ts with:

  • CtResource — union type of all workload names from main.ct (autocomplete for dev() first argument).
  • CtEnvKey — union type of all keys from .env file (autocomplete for env()).
  • Full type definitions for config(), dev(), prompt(), env().
  • CT VS Code — extension that runs ct types automatically
  • CT Dev — dev mode documentation