Skip to content

Commit de67286

Browse files
authored
Merge pull request #403 from Peefy/docs-update-090-cli-ref
docs: update cli 0.9 reference docs
2 parents 52784d8 + 36c3b55 commit de67286

File tree

26 files changed

+586
-4
lines changed

26 files changed

+586
-4
lines changed

docs/tools/cli/kcl/docgen.md

+3
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ Examples:
137137
# Generate Markdown document for current package
138138
kcl doc generate
139139

140+
# Generate Markdown document for current package and escape the HTML symbols | to \|, \n to <br>, etc.
141+
kcl doc generate --escape-html
142+
140143
# Generate Html document for current package
141144
kcl doc generate --format html
142145

docs/tools/cli/kcl/import.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This command converts other formats to KCL file.
1616
Supported conversion modes:
1717
- json: convert JSON data to KCL data
1818
- yaml: convert YAML data to KCL data
19+
- toml: convert TOML data to KCL data
1920
- gostruct: convert Go struct to KCL schema
2021
- jsonschema: convert JSON schema to KCL schema
2122
- terraformschema: convert Terraform schema to KCL schema
@@ -39,6 +40,9 @@ Examples:
3940
# Generate KCL models from YAML
4041
kcl import data.yaml
4142

43+
# Generate KCL models from TOML
44+
kcl import data.toml
45+
4246
# Generate KCL models from JSON Schema
4347
kcl import -m jsonschema schema.json
4448

@@ -48,7 +52,6 @@ Examples:
4852
# Generate KCL models from Go structs
4953
kcl import -m gostruct schema.go
5054

51-
5255
Flags:
5356
-f, --force Force overwrite output file
5457
-h, --help help for import

docs/tools/cli/kcl/run.md

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ Examples:
2626
# Run a single file and output JSON
2727
kcl run path/to/kcl.k --format json
2828

29+
# Run a single file and output TOML
30+
kcl run path/to/kcl.k --format toml
31+
2932
# Run multiple files
3033
kcl run path/to/kcl1.k path/to/kcl2.k
3134

docs/tools/cli/package-management/command-reference/1.init.md

+27
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,30 @@ kcl mod init
4343
# init a kcl package with a name 'my_package'
4444
kcl mod init my_package
4545
```
46+
47+
## Reference
48+
49+
```shell
50+
This command initializes new kcl module in current directory.
51+
52+
Usage:
53+
kcl mod init [flags]
54+
55+
Examples:
56+
kcl mod init <command> [arguments]...
57+
# Init one kcl module with the current folder name
58+
kcl mod init
59+
60+
# Init one kcl module with the name
61+
kcl mod init package-name
62+
63+
# Init one kcl module with the name and version
64+
kcl mod init package-name --version 0.1.0
65+
66+
Flags:
67+
-h, --help help for init
68+
--version string init module version
69+
70+
Global Flags:
71+
-q, --quiet Set the quiet mode (no output)
72+
```

docs/tools/cli/package-management/command-reference/11.update.md

+23
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,26 @@ kcl mod update
3333
```shell
3434
kcl mod update path/to/package
3535
```
36+
37+
## Reference
38+
39+
```shell
40+
This command updates dependencies listed in kcl.mod.lock based on kcl.mod.
41+
42+
Usage:
43+
kcl mod update [flags]
44+
45+
Examples:
46+
# Update the current module
47+
kcl mod update
48+
49+
# Update the module with the specified path
50+
kcl mod update path/to/package
51+
52+
Flags:
53+
-h, --help help for update
54+
--no_sum_check do not check the checksum of the package and update kcl.mod.lock
55+
56+
Global Flags:
57+
-q, --quiet Set the quiet mode (no output)
58+
```

docs/tools/cli/package-management/command-reference/12.graph.md

+20
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,23 @@ Show help for `kcl mod graph` command.
2525
```shell
2626
kcl mod graph
2727
```
28+
29+
## Reference
30+
31+
```shell
32+
This command prints the module dependency graph.
33+
Each module is identified as a string of the form path@version.
34+
35+
Usage:
36+
kcl mod graph [flags]
37+
38+
Examples:
39+
# Print the current module dependency graph.
40+
kcl mod graph
41+
42+
Flags:
43+
-h, --help help for graph
44+
45+
Global Flags:
46+
-q, --quiet Set the quiet mode (no output)
47+
```

docs/tools/cli/package-management/command-reference/2.add.md

+49-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,55 @@ kcl mod add k8s:1.29
4646

4747
### Add a dependency from git repository
4848

49-
Add kcl dependency named `konfig` with version `v0.1.0` from git repository.
49+
Add kcl dependency named `konfig` with version `v0.4.0` from git repository.
5050

5151
```shell
52-
kcl mod add --git https://github.com/awesome-kusion/konfig.git --tag v0.1.0
52+
kcl mod add --git https://github.com/kcl-lang/konfig.git --tag v0.4.0
53+
```
54+
55+
## Reference
56+
57+
```shell
58+
This command adds new dependency
59+
60+
Usage:
61+
kcl mod add [flags]
62+
63+
Examples:
64+
# Add the module dependency named "k8s"
65+
kcl mod add k8s
66+
67+
# Add the module dependency named "k8s" with the version "1.28"
68+
kcl mod add k8s:1.28
69+
70+
# Add the module dependency from the GitHub by git url
71+
kcl mod add git://github.com/kcl-lang/konfig --tag v0.4.0
72+
73+
# Add the module dependency from the OCI Registry by oci url
74+
kcl mod add oci://ghcr.io/kcl-lang/helloworld --tag 0.1.0
75+
76+
# Add the module dependency from the local file system by file url
77+
kcl mod add /path/to/another_module
78+
79+
# Add the module dependency from the GitHub by flag
80+
kcl mod add --git https://github.com/kcl-lang/konfig --tag v0.4.0
81+
82+
# Add the module dependency from the OCI Registry by flag
83+
kcl mod add --oci https://ghcr.io/kcl-lang/helloworld --tag 0.1.0
84+
85+
# Add a local dependency by flag
86+
kcl mod add --path /path/to/another_module
87+
88+
Flags:
89+
--branch string git repository branch
90+
--commit string git repository commit
91+
--git string git repository url
92+
-h, --help help for add
93+
--no_sum_check do not check the checksum of the package and update kcl.mod.lock
94+
--oci string oci repository url
95+
--rename string rename the dependency
96+
--tag string git or oci repository tag
97+
98+
Global Flags:
99+
-q, --quiet Set the quiet mode (no output)
53100
```

docs/tools/cli/package-management/command-reference/3.pkg.md

+27
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,30 @@ Show help for `kcl mod pkm` command.
3131
```shell
3232
kcl mod pkg --target /Users/my_package_tar
3333
```
34+
35+
## Reference
36+
37+
```shell
38+
This command converts a kcl module into tar
39+
40+
Usage:
41+
kcl mod pkg [flags]
42+
43+
Examples:
44+
# Package the current module
45+
kcl mod pkg
46+
47+
# Package the current module in the vendor mode
48+
kcl mod pkg --vendor
49+
50+
# Package the current module into the target directory
51+
kcl mod pkg --target /path/to/target_dir
52+
53+
Flags:
54+
-h, --help help for pkg
55+
--target string packaged target path
56+
--vendor package in vendor mode (default: false)
57+
58+
Global Flags:
59+
-q, --quiet Set the quiet mode (no output)
60+
```

docs/tools/cli/package-management/command-reference/4.metadata.md

+27
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,30 @@ Print the metadata of a kcl package and automatically download the missing depen
3939
```shell
4040
kcl mod metadata --update
4141
```
42+
43+
## Reference
44+
45+
```shell
46+
This command outputs the resolved dependencies of a package
47+
48+
Usage:
49+
kcl mod metadata [flags]
50+
51+
Examples:
52+
# Output the resolved dependencies the current module
53+
kcl mod metadata
54+
55+
# Output the resolved dependencies the current module in the vendor mode
56+
kcl mod metadata --vendor
57+
58+
# Output the resolved dependencies the current module with the update check
59+
kcl mod metadata --update
60+
61+
Flags:
62+
-h, --help help for metadata
63+
--update check the local package and update and download the local package. (default: false)
64+
--vendor run in vendor mode (default: false)
65+
66+
Global Flags:
67+
-q, --quiet Set the quiet mode (no output)
68+
```

docs/tools/cli/package-management/command-reference/6.login.md

+28
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,31 @@ Username: <account_name>
6666
Password:
6767
Login succeeded
6868
```
69+
70+
## Reference
71+
72+
```shell
73+
This command can be used to login to a registry.
74+
75+
Usage:
76+
kcl registry login [flags]
77+
78+
Examples:
79+
# Login the docker hub
80+
kcl registry login docker.io
81+
82+
# Login the GitHub container registry
83+
kcl registry login ghcr.io
84+
85+
# Login a localhost registry
86+
kcl registry login https://localhost:5001
87+
88+
89+
Flags:
90+
-h, --help help for login
91+
-p, --password string registry password or identity token
92+
-u, --username string registry username
93+
94+
Global Flags:
95+
-q, --quiet Set the quiet mode (no output)
96+
```

docs/tools/cli/package-management/command-reference/7.logout.md

+20
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,23 @@ Show help for `kcl registry logout` command.
2525
```shell
2626
kcl registry logout <registry>
2727
```
28+
29+
## Reference
30+
31+
```shell
32+
This command can be used to logout from the current registry.
33+
34+
Usage:
35+
kcl registry logout [flags]
36+
37+
Examples:
38+
# Logout the registry
39+
kcl registry logout docker.io
40+
41+
42+
Flags:
43+
-h, --help help for logout
44+
45+
Global Flags:
46+
-q, --quiet Set the quiet mode (no output)
47+
```

docs/tools/cli/package-management/command-reference/8.push.md

+24
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,27 @@ You can also use `kcl mod push` to upload a tar file to an OCI-based registry.
4444
```shell
4545
kcl mod push --tar_path <tar_path> <oci_url>
4646
```
47+
48+
## Reference
49+
50+
```shell
51+
This command pushes kcl modules to the registry.
52+
53+
Usage:
54+
kcl mod push [flags]
55+
56+
Examples:
57+
# Push the current module to the registry
58+
kcl mod push
59+
60+
# Push the current module to the registry in the vendor mode
61+
kcl mod push --vendor
62+
63+
Flags:
64+
-h, --help help for push
65+
--tar_path string packaged target path that will be pushed
66+
--vendor run in vendor mode (default: false)
67+
68+
Global Flags:
69+
-q, --quiet Set the quiet mode (no output)
70+
```

docs/tools/cli/package-management/command-reference/9.pull.md

+39
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,42 @@ You can download a kcl package from an OCI-based registry url.
4040
```shell
4141
kcl mod pull --tag <kcl_package_version> <oci_url>
4242
```
43+
44+
## Reference
45+
46+
```shell
47+
This command pulls kcl modules from the registry.
48+
49+
Usage:
50+
kcl mod pull [flags]
51+
52+
Examples:
53+
# Pull the the module named "k8s" to the local path from the registry
54+
kcl mod pull k8s
55+
56+
# Pull the module dependency named "k8s" with the version "1.28"
57+
kcl mod pull k8s:1.28
58+
59+
# Pull the module from the GitHub by git url
60+
kcl mod pull git://github.com/kcl-lang/konfig --tag v0.4.0
61+
62+
# Pull the module from the OCI Registry by oci url
63+
kcl mod pull oci://ghcr.io/kcl-lang/helloworld --tag 0.1.0
64+
65+
# Pull the module from the GitHub by flag
66+
kcl mod pull --git https://github.com/kcl-lang/konfig --tag v0.4.0
67+
68+
# Pull the module from the OCI Registry by flag
69+
kcl mod pull --oci https://ghcr.io/kcl-lang/helloworld --tag 0.1.0
70+
71+
Flags:
72+
--branch string git repository branch
73+
--commit string git repository commit
74+
--git string git repository url
75+
-h, --help help for pull
76+
--oci string oci repository url
77+
--tag string git or oci repository tag
78+
79+
Global Flags:
80+
-q, --quiet Set the quiet mode (no output)
81+
```

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

+3
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ Examples:
137137
# Generate Markdown document for current package
138138
kcl doc generate
139139

140+
# Generate Markdown document for current package and escape the HTML symbols | to \|, \n to <br>, etc.
141+
kcl doc generate --escape-html
142+
140143
# Generate Html document for current package
141144
kcl doc generate --format html
142145

0 commit comments

Comments
 (0)