Skip to content

Generating Client Code

Using the CLI, stately schema generate will run your schema TypeScript files and then create code in one of our supported SDK languages that contains typed objects corresponding to the types in your schema. For this to run, you need to have NodeJS installed, and have installed the dependencies for your schema package with npm install.

The first positional argument is the path to your schema’s index file (you can have schema in as many TypeScript files as you want as long as there’s a single file that exports everything). The second positional argument is the output directory where the language-specific code will go.

1
stately schema generate --language go ./schema/schema.ts lib

Each language produces has different kinds of code that’s tailored to the conventions and capabilities of that language. See Client SDKs in the sidebar for more info.