1.0.0-alpha.13 • Published 12 months ago

@sanity-codegen/cli v1.0.0-alpha.13

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@sanity-codegen/cli

CLI for Sanity CodeGen

oclif Version Downloads/week License

Usage

$ npm install -g @sanity-codegen/cli
$ sanity-codegen COMMAND
running command...
$ sanity-codegen (-v|--version|version)
@sanity-codegen/cli/1.0.0-alpha.0 darwin-x64 node-v14.15.3
$ sanity-codegen --help [COMMAND]
USAGE
  $ sanity-codegen COMMAND
...

Commands

sanity-codegen help [COMMAND]

display help for sanity-codegen

USAGE
  $ sanity-codegen help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

sanity-codegen schema-codegen [SCHEMAPATH]

loads a sanity schema and generates TypeScript types from it

USAGE
  $ sanity-codegen schema-codegen [SCHEMAPATH]

ARGUMENTS
  SCHEMAPATH  Optionally provide the path to your sanity schema entry point. If not
              provided, the CLI will try to get this value from your sanity.json file.

OPTIONS
  -h, --help
      show CLI help

  --babelOptions=babelOptions
      Optionally provide babel options inline in a JSON blob. This will be
      passed into the babel options of the schema executor.

      `babelOptions` takes precedence over `babelrcPath`

  --babelrcPath=babelrcPath
      Optionally provide a path to a .babelrc file. This will be passed into
      the babel options of the schema executor.

      `babelOptions` takes precedence over `babelrcPath`

  --configPath=configPath
      Optionally provide an exact path for the CLI to look for a
      sanity-codegen configuration file. If not provided, the CLI will walk up
      the file system checking for `sanity-codegen.config.js` or
      `sanity-codegen.config.ts`.

      Any CLI flags passed with override the config options.

  --cwd=cwd
      Optionally provide a working directory. All of the sanity schema files
      must be inside the current working directory. If not, you may get errors
      like "Cannot use import statement outside a module".

  --outputPath=outputPath
      Optionally provide a destination path to the resulting sanity schema
      types. The default value is ./schema.d.ts.

See code: src/commands/schema-codegen.ts