Typed-key codegen (CLI)
PreviewGenerate typed control-key accessors for your language of choice.
This SDK's source lives in this repository. A public registry install may not resolve yet. Use REST today, or use a local path / project reference from a checked-out source tree (requires repository access) — see SDK & package availability.
The @ctrlapp/cli package (source at packages/ctrl-cli/) reads your control keys and emits typed accessors for TypeScript, Dart, Kotlin, Swift, or C#.
How it authenticates
The CLI calls GET /codegen with a Personal Access Token from the dashboard — not a publishable key. Tokens are user-scoped and check role on the target app.
Usage sketch
Registry publication is pending, so npx @ctrlapp/cli is not guaranteed to resolve yet. Run the checked-out CLI directly, or hit the endpoint with curl:
# From a checkout of this repository (requires repository access):
CTRLAPP_TOKEN=<PAT> node packages/ctrl-cli/bin/ctrlapp.mjs codegen \
--app <APP_ID> --lang ts --out src/ctrlapp-keys.ts
# Equivalent raw request:
curl -H "Authorization: Bearer <PAT>" \
"https://ctrlapp.krdcode.com/api/public/sdk/v1/codegen?app=<APP_ID>&lang=ts"npm i @ctrlapp/cli is not guaranteed to resolve yet — see SDK & package availability.