Typing / CLI
Both the TypeScript and Python SDKs ship with a CLI that generates type definitions for your services. Types are derived from the schemas you defined in the Requence UI — input, configuration, and outputs — and kept in sync automatically.
Generating Types
Section titled “Generating Types”npx requence-service generate-typesThis creates a requence-env.d.ts file in your project root. TypeScript picks it up automatically — no import needed. Your ctx.input, ctx.configuration, and ctx.toOutput() calls will be fully typed.
requence-service generate-typesThis creates type stubs in a typings/requence/service/ directory. Point your editor or type checker at this directory to get type hints for ctx.input, ctx.configuration, and ctx.to_output().
Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
--access-token | — | Service access token (falls back to env / config file) |
--dev-token | — | Personal access token for branch-specific types |
--watch | false | Watch for schema changes and regenerate automatically |
--clear / --no-clear | true | Clear the terminal on watch updates |
| Option | Default | Description |
|---|---|---|
--outfile | requence-env.d.ts | Name of the generated type file |
--outdir | . | Directory to write the type file to |
| Option | Default | Description |
|---|---|---|
--outdir | typings | Directory to write the type stubs to |
Watch Mode
Section titled “Watch Mode”During development, use --watch to keep types in sync as you edit schemas in the Requence UI:
npx requence-service generate-types --watchrequence-service generate-types --watchThe CLI connects to Requence via server-sent events and regenerates types whenever a schema changes.
Branch Types
Section titled “Branch Types”When using a dev token, the CLI generates types for the active branch instead of the published version. A comment is added to the generated files to indicate which branch the types belong to.