Skip to main content

Commands

Stencil New

Creates a new (standard mode) Stencil project.

$ stencil new `<name>` [option]
# or
$ stencil n `<name>` [option]

Description Creates and initializes a new Stencil project. Prompts for package manager.

  • Creates a folder with the given <name>.
  • Populates the folder with configuration files
  • Creates sub-folders for source code (/src) and end-to-end tests (/test)
  • Populates the sub-folders with default files for app components and tests

Arguments

ArgumentDescription
<name>The name of the project to build.

Stencil info

The info command provides detailed information about your current stencil project, including dependencies, versions, and configuration settings.

Usage:

$ stencil info

Stencil generate

The generate command helps you generate various stencil components such as modules, controllers, services, and more.

Usage:

Stencil generate <schematic> <name> [path]
# or
Stencil g <schematic> <name> [path]

Arguments

ArgumentDescription
<schematic>The schematic or collection:schematic to generate.
<name>The name of the generated component.

Stencl Build

Compiles an application or workspace into an output folder.

Note: Also, the build command is responsible for mapping paths.

$ stencil build <name>
ArgumentDescription
<name>The name of the project to build.

Stencil add

The add command is used to add new dependencies and integrations to your stencil project. This is typically used for adding third-party libraries.

Usage:

$ Stencil add <library>

Stencil start

The start command starts the stencil application. It runs the server and makes your application available.

Usage:

$ stencil start

Stencil list

The list command lists all the available schematics and commands that you can use with the stencil CLI.

Usage:

$ stencil list

Stencil docker

The docker command integrates Docker support into your stencil project, allowing you to containerize your application easily.

Usage:

$ stencil docker

New command

The Stencil new command is used to create and initialise a new Stencil project.

$ stencil new <name> [option]
# or
$ stencil n <name> [option]

Available Options:

1.prisma : This is a required option with yes/no as acceptable options.

2.user-service : This is a required option with yes/no as acceptable options.

3.monitoring : This is a required option with yes/no as acceptable options.

4.temporal : This is a required option with yes/no as acceptable options.

5.logging : This is a required option with yes/no as acceptable options.

6.file-upload : This is a required option with yes/no as acceptable options.

7.package-manager : This is a required option with npm/yarn/pnpm/bun as acceptable options.

Flags: You can even choose the services that you want your application to have using the options or you can attach Flags to your Stencil new command.

$ stencil new <name> --flagname
# or
$ stencil new <name> -flagalias

For Example:

$ stencil new my-app --monitoring 
# or
$ stencil new my-app -mf

Note: The default value of a service when attached as a flag is considered to be as yes.

List of Services

NameAliasDescription
appGenerate a new application within a monorepo (converting to monorepo if it's a standard structure).
librarylibGenerate a new library within a monorepo (converting to monorepo if it's a standard structure).
classclGenerate a new class.
controllercoGenerate a controller declaration.
decoratordGenerate a custom decorator.
filterfGenerate a filter declaration.
gatewaygaGenerate a gateway declaration.
guardguGenerate a guard declaration.
interfaceitfGenerate an interface.
interceptoritcGenerate an interceptor declaration.
middlewaremiGenerate a middleware declaration.
modulemoGenerate a module declaration.
pipepiGenerate a pipe declaration.
providerprGenerate a provider declaration.
resolverrGenerate a resolver declaration.
resourceresGenerate a new CRUD resource. See the CRUD (resource) generator for more details. (TS only)
servicesGenerate a service declaration.
sub-appappGenerate a new application within a monorepo
service-prismaspGenerate the Prisma service file
service-usersuAdd the User Service module from the package.
fixturesfsGenerate Custom Fixtures Files.
huskyhsGenerate Custom husky Files.
githubghGenerate Custom github Files.
prismapsAdd custom prisma models to the schema.prisma file.
devcontainerdcGenerate files in a .devcontainer file
monitoringmfGenerate monitor folder.
service-temporalteIf you want to have temporal setup in the project.
service-file-uploadfuIf you want to have fileUpload setup in the project.