CLI reference
TypeGen
Generate TypeScript type definition from a Studio schema and GROQ queries
Experimental feature
This article describes an experimental Sanity feature. The APIs described are subject to change and the documentation may not be completely accurate.
usage: sanity typegen [--default] [-v|--version] [-d|--debug] [-h|--help] <command> [<args>] Commands: generate Generates TypeScript types from schema types and GROQ queries See 'sanity help typegen <command>' for specific information on a subcommand.
Generate
usage: sanity typegen generate [--watch] [--config-path <value>]
Options:
--watch
Run the typegen in watch mode
Default: false
--config-path <path>
Specifies the path to the typegen configuration file. This file should be a JSON file that contains settings for the type generation process.
Default: "sanity-typegen.json"