This is a custom CLI tool that generates and executes stencil commands based on user prompt, creates YAML configuration files, and runs the generated stencil spec.
Table of Contents
- Installation
- Linking the @samagra-x/stencil-cli Package
- Running the CLI
- Examples
-
Clone this repository to your local machine.
git clone <repository-url> cd <repository-folder>
-
Install the required dependencies using your package manager (e.g., npm or pnpm).
npm install
Usage
The CLI generates project initialization commands for the stencil
framework based on user prompts, then writes the configuration into a spec.yaml
file, and finally runs the stencil spec
command.
The tool supports the following options:
- prisma
- user-service
- monitoring
- temporal
- fileUpload
- npm
- pnpm
- yarn
- bun
- Tooling Setup
- logging
- monitoring
- temporal
- Adhoc Setup
- postgres
- hasura
- fusionauth
- minio
Before using the CLI, you need to link the @samagra-x/stencil-cli
package to your global node_modules to ensure the tool can call the stencil command.
-
Navigate to the @samagra-x/stencil-cli package folder. SamagraX-Stencil/stencil-cli#31
cd path/to/@samagra-x/stencil-cli
-
Run the following command to link the package globally.
npm link
This will allow the stencil
command to be used globally in your terminal.
-
Navigate back to the root of this project.
cd path/to/this-project
To run the CLI, first build the project:
npm run build
Then, execute the CLI with a user prompt:
specgpt ""
specgpt "Set up a project named AllInOneService with Prisma, user service, monitoring, temporal and file upload setup along with logging, monitoring, postgres,hasura, fusionauth and minio as docker service with npm as the package installer"
stencil: 0.0.1
info:
properties:
project-name: "AllInOneService"
package-manager: "npm"
tooling: [prisma,user-service,temporal,fileUpload,monitoring]
docker: [monitoring,postgres,hasura,logging,fusionauth,minio]
endpoints:
This will:
Generate a corresponding stencil spec file with the relevant project configuration.
Run the stencil spec command using the generated spec.yaml.