Skip to content

Commit 69f23bc

Browse files
committed
docs: update kcl cli reference documents
Signed-off-by: peefy <[email protected]>
1 parent cded73a commit 69f23bc

File tree

24 files changed

+284
-67
lines changed

24 files changed

+284
-67
lines changed

docs/tools/cli/kcl/docgen.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Refer to [reST](https://docutils.sourceforge.io/rst.html) for more information.
9595
### kcl doc
9696

9797
```shell
98-
This command shows documentation for KCL package or symbol.
98+
This command shows documentation for KCL modules or symbols.
9999

100100
Usage:
101101
kcl doc [command]
@@ -107,7 +107,6 @@ Examples:
107107
# Generate document for current package
108108
kcl doc generate
109109

110-
111110
Available Commands:
112111
generate Generates documents from code and examples
113112

@@ -120,6 +119,8 @@ Use "kcl doc [command] --help" for more information about a command.
120119
### kcl doc generate
121120

122121
```shell
122+
This command generates documents for KCL modules.
123+
123124
Usage:
124125
kcl doc generate [flags]
125126

@@ -139,7 +140,6 @@ Examples:
139140
# Generate Markdown document for specific package to a <target directory>
140141
kcl doc generate --file-path <package path> --target <target directory>
141142

142-
143143
Flags:
144144
--escape-html Whether to escape html symbols when the output format is markdown. Always scape when the output format is html. Default to false.
145145
--file-path string Relative or absolute path to the KCL package root when running kcl-doc command from

docs/tools/cli/kcl/lint.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,15 @@ Examples:
5151

5252
# Lint multiple files
5353
kcl lint path/to/kcl1.k path/to/kcl2.k
54-
54+
5555
# Lint OCI packages
56-
kcl lint oci://ghcr.io/kcl-lang/hello-world
57-
56+
kcl lint oci://ghcr.io/kcl-lang/helloworld
57+
5858
# Lint the current package
5959
kcl lint
6060

61-
6261
Flags:
63-
-D, --argument strings Specify the top-level argument
62+
-D, --argument stringArray Specify the top-level argument
6463
-d, --debug Run in debug mode
6564
-n, --disable_none Disable dumping None values
6665
-E, --external strings Specify the mapping of package name and path where the package is located
@@ -72,6 +71,7 @@ Flags:
7271
-S, --path_selector strings Specify the path selectors
7372
-q, --quiet Set the quiet mode (no output)
7473
-Y, --setting strings Specify the command line setting files
74+
-H, --show_hidden Display hidden attributes
7575
-k, --sort_keys Sort output result keys
7676
-r, --strict_range_check Do perform strict numeric range checks
7777
-t, --tag string Specify the tag for the OCI or Git artifact

docs/tools/cli/kcl/overview.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ KCL toolchain is a toolset of KCL language, which aims to improve the efficiency
2727
## Args
2828

2929
```shell
30+
The KCL Command Line Interface (CLI).
31+
32+
KCL is an open-source, constraint-based record and functional language that
33+
enhances the writing of complex configurations, including those for cloud-native
34+
scenarios. The KCL website: https://kcl-lang.io
35+
3036
Usage:
3137
kcl [command]
3238

@@ -35,8 +41,9 @@ Available Commands:
3541
completion Generate the autocompletion script for the specified shell
3642
doc KCL document tool
3743
fmt KCL format tool
44+
help Help about any command
3845
import KCL import tool
39-
lint Run KCL codes.
46+
lint Lint KCL codes.
4047
mod KCL module management
4148
play Open the kcl playground in the browser.
4249
registry KCL registry management
@@ -50,8 +57,5 @@ Flags:
5057
-h, --help help for kcl
5158
-v, --version version for kcl
5259

53-
Additional help topics:
54-
kcl
55-
5660
Use "kcl [command] --help" for more information about a command.
5761
```

docs/tools/cli/kcl/run.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ This command runs the kcl code and displays the output. 'kcl run' takes multiple
99
## Args
1010

1111
```shell
12+
This command runs the kcl code and displays the output. 'kcl run' takes multiple input for arguments.
13+
14+
For example, 'kcl run path/to/kcl.k' will run the file named path/to/kcl.k
15+
1216
Usage:
1317
kcl run [flags]
1418

@@ -24,16 +28,18 @@ Examples:
2428

2529
# Run multiple files
2630
kcl run path/to/kcl1.k path/to/kcl2.k
27-
31+
2832
# Run OCI packages
29-
kcl run oci://ghcr.io/kcl-lang/hello-world
33+
kcl run oci://ghcr.io/kcl-lang/helloworld
34+
35+
# Run remote Git repo
36+
kcl run https://github.com/kcl-lang/flask-demo-kcl-manifests
3037

3138
# Run the current package
3239
kcl run
3340

34-
3541
Flags:
36-
-D, --argument strings Specify the top-level argument
42+
-D, --argument stringArray Specify the top-level argument
3743
-d, --debug Run in debug mode
3844
-n, --disable_none Disable dumping None values
3945
-E, --external strings Specify the mapping of package name and path where the package is located
@@ -45,6 +51,7 @@ Flags:
4551
-S, --path_selector strings Specify the path selectors
4652
-q, --quiet Set the quiet mode (no output)
4753
-Y, --setting strings Specify the command line setting files
54+
-H, --show_hidden Display hidden attributes
4855
-k, --sort_keys Sort output result keys
4956
-r, --strict_range_check Do perform strict numeric range checks
5057
-t, --tag string Specify the tag for the OCI or Git artifact
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# kcl mod graph
2+
3+
Print the module dependency graph. Each module is identified as a string of the form path@version.
4+
5+
## Usage
6+
7+
```shell
8+
kcl mod graph [flags]
9+
```
10+
11+
## Description
12+
13+
`kcl mod graph` will print the module dependency graph. Each module is identified as a string of the form path@version.
14+
15+
## Options
16+
17+
### --help, -h
18+
19+
Show help for `kcl mod graph` command.
20+
21+
## Examples
22+
23+
### Print the current module dependency graph.
24+
25+
```shell
26+
kcl mod graph
27+
```

docs/user_docs/support/faq-kcl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2551,7 +2551,7 @@ final_list:
25512551

25522552
The first `"v1"` over here denotes that the type of the variable `version` is of string literal type. The second `"v1"` denotes that the default value of the variable `version` is `"v1"`.
25532553

2554-
## 62. How do i define a schema to verify the contents of a given JSON file?
2554+
## 62. How to define a schema to verify the contents of a given JSON file?
25552555

25562556
We can use the kcl `vet` tool to validate the JSON data in a given JSOn file. For example, in the below data.json file we use the KCL file(schema.k) below to validate the `age` parameter.
25572557

i18n/zh-CN/docusaurus-plugin-content-docs/current/tools/cli/kcl/docgen.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ kcl doc generate --file-path <package path> --target <target directory>
9595
### kcl doc
9696

9797
```shell
98-
This command shows documentation for KCL package or symbol.
98+
This command shows documentation for KCL modules or symbols.
9999

100100
Usage:
101101
kcl doc [command]
@@ -107,7 +107,6 @@ Examples:
107107
# Generate document for current package
108108
kcl doc generate
109109

110-
111110
Available Commands:
112111
generate Generates documents from code and examples
113112

@@ -120,6 +119,8 @@ Use "kcl doc [command] --help" for more information about a command.
120119
### kcl doc generate
121120

122121
```shell
122+
This command generates documents for KCL modules.
123+
123124
Usage:
124125
kcl doc generate [flags]
125126

@@ -139,7 +140,6 @@ Examples:
139140
# Generate Markdown document for specific package to a <target directory>
140141
kcl doc generate --file-path <package path> --target <target directory>
141142

142-
143143
Flags:
144144
--escape-html Whether to escape html symbols when the output format is markdown. Always scape when the output format is html. Default to false.
145145
--file-path string Relative or absolute path to the KCL package root when running kcl-doc command from

i18n/zh-CN/docusaurus-plugin-content-docs/current/tools/cli/kcl/lint.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,15 @@ Examples:
5151

5252
# Lint multiple files
5353
kcl lint path/to/kcl1.k path/to/kcl2.k
54-
54+
5555
# Lint OCI packages
56-
kcl lint oci://ghcr.io/kcl-lang/hello-world
57-
56+
kcl lint oci://ghcr.io/kcl-lang/helloworld
57+
5858
# Lint the current package
5959
kcl lint
6060

61-
6261
Flags:
63-
-D, --argument strings Specify the top-level argument
62+
-D, --argument stringArray Specify the top-level argument
6463
-d, --debug Run in debug mode
6564
-n, --disable_none Disable dumping None values
6665
-E, --external strings Specify the mapping of package name and path where the package is located
@@ -72,6 +71,7 @@ Flags:
7271
-S, --path_selector strings Specify the path selectors
7372
-q, --quiet Set the quiet mode (no output)
7473
-Y, --setting strings Specify the command line setting files
74+
-H, --show_hidden Display hidden attributes
7575
-k, --sort_keys Sort output result keys
7676
-r, --strict_range_check Do perform strict numeric range checks
7777
-t, --tag string Specify the tag for the OCI or Git artifact

i18n/zh-CN/docusaurus-plugin-content-docs/current/tools/cli/kcl/overview.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ KCL 工具链是 KCL 语言的工具集合,旨在提升 KCL 的批量迁移、
2727
## 参数说明
2828

2929
```shell
30+
The KCL Command Line Interface (CLI).
31+
32+
KCL is an open-source, constraint-based record and functional language that
33+
enhances the writing of complex configurations, including those for cloud-native
34+
scenarios. The KCL website: https://kcl-lang.io
35+
3036
Usage:
3137
kcl [command]
3238

@@ -35,8 +41,9 @@ Available Commands:
3541
completion Generate the autocompletion script for the specified shell
3642
doc KCL document tool
3743
fmt KCL format tool
44+
help Help about any command
3845
import KCL import tool
39-
lint Run KCL codes.
46+
lint Lint KCL codes.
4047
mod KCL module management
4148
play Open the kcl playground in the browser.
4249
registry KCL registry management
@@ -50,8 +57,5 @@ Flags:
5057
-h, --help help for kcl
5158
-v, --version version for kcl
5259

53-
Additional help topics:
54-
kcl
55-
5660
Use "kcl [command] --help" for more information about a command.
5761
```

i18n/zh-CN/docusaurus-plugin-content-docs/current/tools/cli/kcl/run.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ sidebar_position: 1
77
## 参数说明
88

99
```shell
10+
This command runs the kcl code and displays the output. 'kcl run' takes multiple input for arguments.
11+
12+
For example, 'kcl run path/to/kcl.k' will run the file named path/to/kcl.k
13+
1014
Usage:
1115
kcl run [flags]
1216

@@ -22,16 +26,18 @@ Examples:
2226

2327
# Run multiple files
2428
kcl run path/to/kcl1.k path/to/kcl2.k
25-
29+
2630
# Run OCI packages
27-
kcl run oci://ghcr.io/kcl-lang/hello-world
31+
kcl run oci://ghcr.io/kcl-lang/helloworld
32+
33+
# Run remote Git repo
34+
kcl run https://github.com/kcl-lang/flask-demo-kcl-manifests
2835

2936
# Run the current package
3037
kcl run
3138

32-
3339
Flags:
34-
-D, --argument strings Specify the top-level argument
40+
-D, --argument stringArray Specify the top-level argument
3541
-d, --debug Run in debug mode
3642
-n, --disable_none Disable dumping None values
3743
-E, --external strings Specify the mapping of package name and path where the package is located
@@ -43,7 +49,9 @@ Flags:
4349
-S, --path_selector strings Specify the path selectors
4450
-q, --quiet Set the quiet mode (no output)
4551
-Y, --setting strings Specify the command line setting files
52+
-H, --show_hidden Display hidden attributes
4653
-k, --sort_keys Sort output result keys
4754
-r, --strict_range_check Do perform strict numeric range checks
48-
-t, --tag string Specify the tag fo
55+
-t, --tag string Specify the tag for the OCI or Git artifact
56+
-V, --vendor Run in vendor mode
4957
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# kcl mod update
2+
3+
kcl mod update 将根据 kcl.mod 更新在 kcl.mod.lock 中列出的依赖项。也可以通过指定包的路径来更新一个包。
4+
5+
## 使用
6+
7+
```shell
8+
kcl mod update [options][module_name]
9+
```
10+
11+
## 示例
12+
13+
### 更新当前模块
14+
15+
```shell
16+
kcl mod update
17+
```
18+
19+
### 更新指定路径的模块
20+
21+
```shell
22+
kcl mod update path/to/package
23+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# kcl mod update
2+
3+
打印模块依赖关系图。每个模块都以 `path@version` 的形式标识进行输出
4+
5+
## 使用
6+
7+
```shell
8+
kcl mod graph [flags]
9+
```
10+
11+
## 示例
12+
13+
### 打印当前模块的依赖关系图
14+
15+
```shell
16+
kcl mod graph
17+
```

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.8/tools/cli/kcl/docgen.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ kcl doc generate --file-path <package path> --target <target directory>
9595
### kcl doc
9696

9797
```shell
98-
This command shows documentation for KCL package or symbol.
98+
This command shows documentation for KCL modules or symbols.
9999

100100
Usage:
101101
kcl doc [command]
@@ -107,7 +107,6 @@ Examples:
107107
# Generate document for current package
108108
kcl doc generate
109109

110-
111110
Available Commands:
112111
generate Generates documents from code and examples
113112

@@ -120,6 +119,8 @@ Use "kcl doc [command] --help" for more information about a command.
120119
### kcl doc generate
121120

122121
```shell
122+
This command generates documents for KCL modules.
123+
123124
Usage:
124125
kcl doc generate [flags]
125126

@@ -139,7 +140,6 @@ Examples:
139140
# Generate Markdown document for specific package to a <target directory>
140141
kcl doc generate --file-path <package path> --target <target directory>
141142

142-
143143
Flags:
144144
--escape-html Whether to escape html symbols when the output format is markdown. Always scape when the output format is html. Default to false.
145145
--file-path string Relative or absolute path to the KCL package root when running kcl-doc command from

0 commit comments

Comments
 (0)