Skip to content

Emitter usage

  1. Via the command line
Terminal window
tsp compile . --emit=@azure-tools/typespec-client-generator-core
  1. Via the config
emit:
- "@azure-tools/typespec-client-generator-core"

The config can be extended with options as follows:

emit:
- "@azure-tools/typespec-client-generator-core"
options:
"@azure-tools/typespec-client-generator-core":
option: value

Type: absolutePath

Defines the emitter output directory. Defaults to {output-dir}/@azure-tools/typespec-client-generator-core See Configuring output directory for more info

Type: string

Set emitter-name to output TCGC code models for specific language’s emitter.

Type: boolean

When set to true, the emitter will generate low-level protocol methods for each service operation if @protocolAPI is not set for an operation. Default value is true.

Type: boolean

When set to true, the emitter will generate convenience methods for each service operation if @convenientAPI is not set for an operation. Default value is true.

Type: string

Use this flag if you would like to generate the sdk only for a specific version. Default value is the latest version. Also accepts values latest and all.

Type: object

License information for the generated client code.

Type: string

Specifies the directory where the emitter will look for example files. If the flag isn’t set, the emitter defaults to using an examples directory located at the project root.

Type: string

Specifies the namespace you want to override for namespaces set in the spec. With this config, all namespace for the spec types will default to it.