The init command scaffolds a new gRPC service project from a template, downloading and extracting the template from the wundergraph/cosmo-templates repository.

Usage

wgc grpc-service init [options]

Options

OptionDescriptionDefault
-t, --template <template>Template to usetypescript-connect-rpc-fastify
-d, --directory <directory>Output directory for the new project.

Description

  • Downloads and extracts the specified template from the wundergraph/cosmo-templates GitHub repository under grpc-service/<template>.
  • Validates the template name and checks if it exists.
  • Ensures the output directory is empty or creates it if it does not exist.
  • Copies the template files into the output directory.
  • Prints instructions to check the README.md in the generated project.
If the specified template does not exist, the command will list available templates and provide usage guidance.

List available templates

To list available templates, you can use the list-templates command.

Examples

Scaffold a new gRPC service with the default template

wgc grpc-service init

Scaffold a new gRPC service with a specific template

wgc grpc-service init --template typescript-connect-rpc-fastify --directory ./my-grpc-service

Output

The command creates a new directory (if it does not exist) and copies the template files into it. Check the generated README.md for instructions on how to use your new gRPC service project. See also: gRPC Services · GraphQL Support for gRPC Integration