init command scaffolds a new gRPC service project from a template,
downloading and extracting the template from the wundergraph/cosmo-templates repository.
Usage
Options
| Option | Description | Default |
|---|---|---|
-t, --template <template> | Template to use | typescript-connect-rpc-fastify |
-d, --directory <directory> | Output directory for the new project | . |
Description
- Downloads and extracts the specified template from the
wundergraph/cosmo-templatesGitHub repository undergrpc-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.mdin the generated project.
List available templates
To list available templates, you can use the list-templates command.Examples
Scaffold a new gRPC service with the default template
Scaffold a new gRPC service with a specific template
Output
The command creates a new directory (if it does not exist) and copies the template files into it. Check the generatedREADME.md for instructions on how to use your new gRPC service project.
See also: gRPC Services · GraphQL Support for gRPC Integration