Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 204 additions & 0 deletions docs/cli/commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
---
title: Commands
---

<head>
<title>Stencil-Cli Commands Setup</title>
</head>
<p>

## Build Command

Compiles an application or workspace into an output folder.

```bash
$ stencil build <name> [options]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider showing command output for clarity.

It's a good practice to show the expected output of commands in documentation to help users understand what to expect.

+ # Example output:
+ $ Building project 'name'...

Committable suggestion was skipped due to low confidence.

Tools
Markdownlint

15-15: null
Dollar signs used before commands without showing output

(MD014, commands-show-output)

```

**Arguments**

| Argument | Description |
| -------- | --------------------------------- |
| `<name>` | The name of the project to build. |

**Options**

| Option | Description |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--path [path]` | Path to `tsconfig` file. <br/>Alias `-p` |
| `--config [path]` | Path to `nest-cli` configuration file. <br/>Alias `-c` |
| `--watch` | Run in watch mode (live-reload).<br /> If you're using `tsc` for compilation, you can type `rs` to restart the application (when `manualRestart` option is set to `true`). <br/>Alias `-w` |
| `--builder [name]` | Specify the builder to use for compilation (`tsc`, `swc`, or `webpack`). <br/>Alias `-b` |
| `--webpack` | Use webpack for compilation (deprecated: use `--builder webpack` instead). |
| `--webpackPath` | Path to webpack configuration. |
| `--tsc` | Force use `tsc` for compilation. |
## Start Command

Compiles and runs an application (or default project in a workspace).

```bash
$ stencil start <name> [options]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider showing command output for the Start Command.

Including example outputs in documentation can greatly enhance user comprehension and reduce confusion.

+ # Example output:
+ $ Starting project 'name'...
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$ stencil start <name> [options]
$ stencil start <name> [options]
# Example output:
$ Starting project 'name'...
Tools
Markdownlint

40-40: null
Dollar signs used before commands without showing output

(MD014, commands-show-output)

```

**Arguments**

| Argument | Description |
| -------- | ------------------------------- |
| `<name>` | The name of the project to run. |

**Options**

| Option | Description |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `--path [path]` | Path to `tsconfig` file. <br/>Alias `-p` |
| `--config [path]` | Path to `nest-cli` configuration file. <br/>Alias `-c` |
| `--watch` | Run in watch mode (live-reload) <br/>Alias `-w` |
| `--builder [name]` | Specify the builder to use for compilation (`tsc`, `swc`, or `webpack`). <br/>Alias `-b` |
| `--preserveWatchOutput` | Keep outdated console output in watch mode instead of clearing the screen. (`tsc` watch mode only) |
| `--watchAssets` | Run in watch mode (live-reload), watching non-TS files (assets). See [Assets](cli/monorepo#assets) for more details. |
| `--debug [hostport]` | Run in debug mode (with --inspect flag) <br/>Alias `-d` |
| `--webpack` | Use webpack for compilation. (deprecated: use `--builder webpack` instead) |
| `--webpackPath` | Path to webpack configuration. |
| `--tsc` | Force use `tsc` for compilation. |
| `--exec [binary]` | Binary to run (default: `node`). <br/>Alias `-e` |
| `-- [key=value]` | Command-line arguments that can be referenced with `process.argv`. |

## Add Command

Imports a library that has been packaged as a **nest library**, running its install schematic.

```bash
stencil add <name> [options]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an example output for the Add Command.

Providing output examples can help users verify that they have executed the command correctly.

+ # Example output:
+ $ Library 'name' added successfully.

Committable suggestion was skipped due to low confidence.

```

**Arguments**

| Argument | Description |
| -------- | ---------------------------------- |
| `<name>` | The name of the library to import. |

## Info Command

```
stencil info

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an example output for the Info Command.

Example outputs are particularly useful for simple commands to confirm their successful execution.

+ # Example output:
+ $ Stencil package version: 1.0.0
+ $ System info: Windows 10, 64-bit

Committable suggestion was skipped due to low confidence.

```

Displays information about installed stencil packages and other helpful system info.

## List Command

```
stencil list

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an example output for the List Command.

Showing users what to expect from the output can help them understand the command's utility.

+ # Example output:
+ $ Installed services: Service1, Service2
+ $ Package managers: npm, yarn
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
stencil list
stencil list
# Example output:
$ Installed services: Service1, Service2
$ Package managers: npm, yarn

```

Consoles a registry/spec file which shows all the installed services along with installed package manager.

## Docker Command

```
stencil docker <services...>
stencil do <services...>
```
Comment on lines +99 to +101

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an example output for the Docker Command.

Providing example outputs can demystify what might otherwise be a complex command for users.

+ # Example output:
+ $ Docker service 'service1' created successfully.

Committable suggestion was skipped due to low confidence.

Tools
Markdownlint

101-101: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

**Description**

Creates a docker service/container for given prompt.
- Tooling specific setup
- Creates a folder with the given `<service>` inside docker directory

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix Indentation in Markdown Lists

There are inconsistencies in the indentation for unordered lists. This should be corrected to ensure uniformity and adherence to markdown best practices.

-    - Creates a folder with the given `<service>` inside docker directory
-    - Creates a docker compose or updates existing docker compose with desired `<service>`
+  - Creates a folder with the given `<service>` inside docker directory
+  - Creates a docker compose or updates existing docker compose with desired `<service>`

Also applies to: 108-108

Tools
Markdownlint

106-106: Expected: 2; Actual: 4
Unordered list indentation

(MD007, ul-indent)

- À la Carte setup
- Creates a docker compose or updates existing docker compose with desired `<service>`

**Arguments**

| Argument | Description |
|-----------|--------------|
| `<service>` | The name of the new project |

Note: Docker command supports multiple services at a time.

**Services**

- Tooling specific setup


| Name | Alias | Description |
|---|---|---|
| `logging` | `lg` | Generates a docker service for logging |
| `monitoringService` |`ms` | Generates a docker service for monitoring |
| `temporal` | `tp` | Generates a docker service for temporal |

- À la Carte setup


| Name | Alias | Description |
|---|---|---|
| `postgres` | `pg` | Generate a docker compose for postgres |
| `hasura` |`hs` | Generate a docker compose for hasura |


## Generate Command


```
stencil generate <schematic> <name> [options]

stencil g <schematic> <name> [options]
```
Comment on lines +142 to +145

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an example output for the Generate Command.

Example outputs can clarify the immediate results of the command, helping users to verify correct execution.

+ # Example output:
+ $ Generated 'newApp' from 'app' schematic successfully.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
stencil generate <schematic> <name> [options]
stencil g <schematic> <name> [options]
```
stencil generate <schematic> <name> [options]
stencil g <schematic> <name> [options]
# Example output:
$ Generated 'newApp' from 'app' schematic successfully.
Tools
Markdownlint

145-145: null
Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

**Description**

Generates and/or modifies files based on a schematic

**Arguments**

| Argument | Description |
|-----------|--------------|
| `<service>` | The schematic or collection:schematic to generate. See the table below for the available schematics. |
| `<name>` | The name of the new project |

**Schematics**

| Name | Alias | Description |
|---|---|---|
| `app` | | Generate a new application within a monorepo (converting to monorepo if it's a standard structure). |
| `library` |`lib` | Generate a new library within a monorepo (converting to monorepo if it's a standard structure). |
| `class` |`cl` | Generate a new class.|
| `controller` |`co` | Generate a controller declaration.|
| `decorator` |`d` | Generate a custom decorator. |
| `filter` |`f` | Generate a filter declaration. |
| `gateway` |`ga` | Generate a gateway declaration. |
| `guard` |`gu` | Generate a guard declaration. |
| `interface` |`itf` | Generate an interface. |
| `interceptor` |`itc` | Generate an interceptor declaration. |
| `middleware` |`mi` | Generate a middleware declaration. |
| `module` |`mo` | Generate a module declaration. |
| `pipe` |`pi` | Generate a pipe declaration. |
| `provider` |`pr` | Generate a provider declaration. |
| `resolver` |`r` | Generate a resolver declaration. |
| `resource` |`res` | Generate a new CRUD resource. See the CRUD (resource) generator for more details. (TS only) |
| `service` |`s` | Generate a service declaration.|
| `sub-app` |`app` | Generate a new application within a monorepo |
| `service-prisma` |`sp` | Generate the Prisma service file |
| `service-user` |`su` | Add the User Service module from the package. |
| `fixtures` |`fs` | Generate Custom Fixtures Files. |
| `husky` |`hs` | Generate Custom husky Files. |
| `github` |`gh` | Generate Custom github Files. |
| `prisma` |`ps` | Add custom prisma models to the schema.prisma file. |
| `devcontainer` |`dc` | Generate files in a .devcontainer file |
| `monitoring` |`mf` | Generate monitor folder. |
| `service-temporal` |`te` | If you want to have temporal setup in the project. |
| `service-file-upload` |`fu` | If you want to have fileUpload setup in the project. |


**Options**

| Option | Alias | Description |
| ------------------------------- | ----- | --------------------------------------------------------------------------------------------------------------- |
| `--dry-run` | `-d` | Reports changes that would be made, but does not change the filesystem. |
| `--project [project]` | `-p` | Project that element should be added to. |
| `--flat` | | Do not generate a folder for the element. |
| `--collection [collectionName]` | `-c` | Specify schematics collection. Use package name of installed npm package containing schematic. |
| `--spec` | | Enforce spec files generation (default) |
| `--no-spec` | | Disable spec files generation |



</p>
2 changes: 1 addition & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports = {
type: 'category',
label: 'CLI',
collapsed: false,
items: ['cli/introduction', 'cli/installation'],
items: ['cli/introduction', 'cli/installation','cli/commands'],
},
{
type: 'category',
Expand Down