Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Commit e0d8019

Browse files
committed
docs: sync latest usage
1 parent aece7a0 commit e0d8019

6 files changed

Lines changed: 62 additions & 26 deletions

File tree

docs/getting-started.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ Clerc only supports ESM!
1414

1515
:::info
1616

17-
The `clerc` package re-exports `@clerc/core` and all plugins, which may increase your bundle size, though it won't have much impact if your bundler supports tree-shaking. To reduce size, please install `@clerc/core` and plugins as needed.
17+
The `clerc` package re-exports an extended `Clerc` class with built-in `@clerc/plugin-help` and `@clerc/plugin-version` plugins. If you only need the core functionality, you can install the `@clerc/core` package or use the exported `BaseClerc` class.
18+
19+
Note that the `clerc` package may be larger in size since it re-exports all official plugins. However, if your bundler supports tree-shaking, this shouldn't be an issue. To reduce bundle size, consider installing only `@clerc/core` and the plugins you need.
1820

1921
:::
2022

docs/official-plugins/plugin-help.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ title: Help Plugin
66

77
A plugin that adds help information to your CLI.
88

9-
## 📦 Installation
9+
:::tip
10+
11+
This plugin is built into the `Clerc` class exported by the `clerc` package, so you don't need to install it separately to use it.
12+
13+
:::
14+
15+
## Standalone Usage
16+
17+
### 📦 Installation
1018

1119
:::code-group
1220

@@ -24,17 +32,17 @@ $ pnpm add @clerc/plugin-help
2432

2533
:::
2634

27-
## 🚀 Usage
35+
### 🚀 Usage
2836

29-
### Import
37+
#### Import
3038

3139
```ts
3240
import { helpPlugin } from "@clerc/plugin-help";
3341
// or import directly from clerc
3442
import { helpPlugin } from "clerc";
3543
```
3644

37-
### Basic Usage
45+
#### Basic Usage
3846

3947
```ts
4048
const cli = Clerc.create()
@@ -49,7 +57,7 @@ const cli = Clerc.create()
4957
.parse();
5058
```
5159

52-
### Running Effect
60+
## Running Effect
5361

5462
```bash
5563
# Show main help, displays root command help when there is a root command, otherwise shows CLI's own help
@@ -75,9 +83,9 @@ The plugin automatically generates beautiful help information for your CLI, incl
7583
- Global options
7684
- Custom notes and examples
7785

78-
### Advanced Usage
86+
## Advanced Usage
7987

80-
#### Custom Command Help
88+
### Custom Command Help
8189

8290
You can set the `help` option to customize the help information for each command:
8391

@@ -106,7 +114,7 @@ const cli = Clerc.create()
106114
.parse();
107115
```
108116

109-
#### Plugin Options
117+
### Plugin Options
110118

111119
You can customize the behavior of the help plugin by passing options:
112120

docs/official-plugins/plugin-version.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ title: Version Plugin
66

77
A plugin that adds a version command to your CLI.
88

9-
## 📦 Installation
9+
:::tip
10+
11+
This plugin is built into the `Clerc` class exported by the `clerc` package, so you don't need to install it separately to use it.
12+
13+
:::
14+
15+
## Standalone Usage
16+
17+
### 📦 Installation
1018

1119
:::code-group
1220

@@ -24,9 +32,9 @@ $ pnpm add @clerc/plugin-version
2432

2533
:::
2634

27-
## 🚀 Usage
35+
### 🚀 Usage
2836

29-
### Import
37+
#### Import
3038

3139
```ts
3240
import { versionPlugin } from "@clerc/plugin-version";
@@ -45,7 +53,7 @@ const cli = Clerc.create()
4553
.parse();
4654
```
4755

48-
### Running Effect
56+
## Running Effect
4957

5058
```bash
5159
# Display version information

docs/zh/getting-started.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ Clerc 仅支持 ESM!
1414

1515
:::info
1616

17-
`clerc` 包重新导出了 `@clerc/core` 和所有插件,因此可能会增加您的捆绑包大小,不过如果你的打包器支持摇树优化(tree-shaking),则不会有太大影响。如需减小大小,请按需安装 `@clerc/core` 和插件。
17+
`clerc` 包重新导出了一个经过拓展的 `Clerc` 类,它内置了 `@clerc/plugin-help``@clerc/plugin-version` 插件。如果您只需要核心功能,可以安装 `@clerc/core` 包,或者使用导出的 `BaseClerc` 类。
18+
19+
同时,`clerc` 包的体积可能会较大,因为它重新导出了所有官方插件。但如果您的打包工具支持 tree-shaking,则影响不大。若想减小体积,请按需安装 `@clerc/core` 和所需插件。
1820

1921
:::
2022

docs/zh/official-plugins/plugin-help.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ title: 帮助信息插件
66

77
为您的 CLI 添加帮助信息的插件。
88

9-
## 📦 安装
9+
:::tip
10+
11+
该插件已内置于 `clerc` 包中导出的 `Clerc` 类中,您无需单独安装即可使用。
12+
13+
:::
14+
15+
## 独立使用
16+
17+
### 📦 安装
1018

1119
:::code-group
1220

@@ -24,17 +32,17 @@ $ pnpm add @clerc/plugin-help
2432

2533
:::
2634

27-
## 🚀 使用方法
35+
### 🚀 使用方法
2836

29-
### 导入
37+
#### 导入
3038

3139
```ts
3240
import { helpPlugin } from "@clerc/plugin-help";
3341
// 或者直接从 clerc 导入
3442
import { helpPlugin } from "clerc";
3543
```
3644

37-
### 基本用法
45+
#### 基本用法
3846

3947
```ts
4048
const cli = Clerc.create()
@@ -49,7 +57,7 @@ const cli = Clerc.create()
4957
.parse();
5058
```
5159

52-
### 运行效果
60+
## 运行效果
5361

5462
```bash
5563
# 显示主帮助,在有根命令的时候显示根命令的帮助信息,没有的时候显示 CLI 自己的帮助信息
@@ -75,9 +83,9 @@ $ node my-cli help hello
7583
- 全局选项
7684
- 自定义的提示信息和示例
7785

78-
### 高级用法
86+
## 高级用法
7987

80-
#### 自定义命令帮助信息
88+
### 自定义命令帮助信息
8189

8290
你可以设置 `help` 选项来自定义每个命令的帮助信息:
8391

@@ -103,7 +111,7 @@ const cli = Clerc.create()
103111
.parse();
104112
```
105113

106-
#### 插件选项
114+
### 插件选项
107115

108116
你可以通过传递选项来定制帮助插件的行为:
109117

docs/zh/official-plugins/plugin-version.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ title: 版本信息插件
66

77
为您的 CLI 添加版本命令的插件。
88

9-
## 📦 安装
9+
:::tip
10+
11+
该插件已内置于 `clerc` 包中导出的 `Clerc` 类中,您无需单独安装即可使用。
12+
13+
:::
14+
15+
## 独立使用
16+
17+
### 📦 安装
1018

1119
:::code-group
1220

@@ -24,9 +32,9 @@ $ pnpm add @clerc/plugin-version
2432

2533
:::
2634

27-
## 🚀 使用方法
35+
### 🚀 使用方法
2836

29-
### 导入
37+
#### 导入
3038

3139
```ts
3240
import { versionPlugin } from "@clerc/plugin-version";
@@ -45,7 +53,7 @@ const cli = Clerc.create()
4553
.parse();
4654
```
4755

48-
### 运行效果
56+
## 运行效果
4957

5058
```bash
5159
# 显示版本信息

0 commit comments

Comments
 (0)