Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Added Command guide under Cli #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
182 changes: 182 additions & 0 deletions docs/cli/Commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
---
Title: CLI command reference
sidebar_label: CLI command reference
---

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

### 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**

| Argument | Description |
|----------|------------------------------|
| `<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:**

```sh
$ stencil info
```
Comment on lines +32 to +40
Copy link

Choose a reason for hiding this comment

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

Improve documentation formatting for 'Stencil info'.

The description of the info command is clear, but the usage example should be surrounded by blank lines for better readability.

38a39,40
> 
>
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 `info`
The `info` command provides detailed information about your current stencil project, including dependencies, versions, and configuration settings.
**Usage:**
```sh
$ stencil info
```
### Stencil `info`
The `info` command provides detailed information about your current stencil project, including dependencies, versions, and configuration settings.
**Usage:**
```sh
$ stencil info
```
Tools
Markdownlint

32-32: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


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

(MD014, commands-show-output)


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

(MD031, blanks-around-fences)

### Stencil `generate`

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

**Usage:**

```sh
Stencil generate <schematic> <name> [path]
# or
Stencil g <schematic> <name> [path]
```
**Arguments**

| Argument | Description |
|--------------|-------------------------------------------------------------------------------------------------|
| `<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.

```sh
$ stencil build <name>
```
Comment on lines +59 to +66
Copy link

Choose a reason for hiding this comment

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

Clarify the 'Stencil Build' command description.

The description and note on the build command are informative, but the command usage should be surrounded by blank lines to comply with Markdown standards.

64a65,66
> 
>
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
### Stencl Build
Compiles an application or workspace into an output folder.
**Note:** Also, the `build` command is responsible for mapping paths.
```sh
$ stencil build <name>
```
### Stencl Build
Compiles an application or workspace into an output folder.
**Note:** Also, the `build` command is responsible for mapping paths.
```sh
$ stencil build <name>
```
Tools
Markdownlint

60-60: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


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

(MD014, commands-show-output)


59-59: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


| Argument | Description |
|----------|------------------------------|
| `<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:**

```sh
$ Stencil add <library>
```

### Stencil `start`

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

**Usage:**

```sh
$ stencil start
```
### Stencil `list`

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

**Usage:**

```sh
$ stencil list
```
### Stencil `docker`

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

**Usage:**

```sh
$ 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.
```sh
$ stencil new <name> --flagname
# or
$ stencil new <name> -flagalias
```
**For Example:**
```sh
$ 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**

| 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. |
</p>
Copy link

Choose a reason for hiding this comment

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

Ensure file ends with a newline.

The Markdown file should end with a single newline character to comply with standards.

182a183
> 
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
</p>
</p>
Tools
Markdownlint

182-182: null
Files should end with a single newline character

(MD047, single-trailing-newline)

Comment on lines +110 to +182
Copy link

Choose a reason for hiding this comment

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

Extensive documentation for 'Stencil new' command options and flags.

The detailed options and flags for the Stencil new command are well documented. However, consider adding commas after each option in the list for better readability.

121a122
> ,
123a125
> ,
125a128
> ,
127a131
> ,
131a136
> ,
133a139
> ,
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
## 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.
```sh
$ stencil new <name> --flagname
# or
$ stencil new <name> -flagalias
```
**For Example:**
```sh
$ 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**
| 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. |
</p>
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.
Tools
LanguageTool

[grammar] ~110-~110: The verb form doesn’t seem to match ‘New’. If it is an imperative, consider using a comma.
Context: ...e:** sh $ stencil docker ## New command The Stencil new command is used to cr...

(NNP_VB_TO)


[uncategorized] ~111-~111: Do not mix variants of the same word (‘initialise’ and ‘initialize’) within a single text.
Context: ...cil new command is used to create and initialise a new Stencil project. ``` $ stencil n...

(EN_WORD_COHERENCY)


[uncategorized] ~121-~121: Possible missing comma found.
Context: ...s:** 1.prisma : This is a required option with yes/no as acceptable options. 2.*...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~123-~123: Possible missing comma found.
Context: ...2.user-service : This is a required option with yes/no as acceptable options. 3.*...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~125-~125: Possible missing comma found.
Context: ... 3.monitoring : This is a required option with yes/no as acceptable options. 4.*...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~127-~127: Possible missing comma found.
Context: ...s. 4.temporal : This is a required option with yes/no as acceptable options. 5.*...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~131-~131: Possible missing comma found.
Context: ... 6.file-upload : This is a required option with yes/no as acceptable options. 7.*...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~133-~133: Possible missing comma found.
Context: ...package-manager* : This is a required option with npm/yarn/pnpm/bun as acceptable op...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~136-~136: Use a comma before ‘or’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...ur application to have using the options or you can attach Flags to your Stencil ...

(COMMA_COMPOUND_SENTENCE)


[style] ~181-~181: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ... service-file-upload |fu | If you want to have fileUpload setup in the project. ...

(REP_WANT_TO_VB)

Markdownlint

135-135: Expected: 0 or 2; Actual: 1
Trailing spaces

(MD009, no-trailing-spaces)


157-157: Column: 27
Hard tabs

(MD010, no-hard-tabs)


170-170: Column: 24
Hard tabs

(MD010, no-hard-tabs)


110-110: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines

(MD022, blanks-around-headings)


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

(MD031, blanks-around-fences)


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

(MD031, blanks-around-fences)


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

(MD031, blanks-around-fences)


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

(MD031, blanks-around-fences)


150-150: null
Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


113-113: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


182-182: null
Files should end with a single newline character

(MD047, single-trailing-newline)

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