Skip to content

Commit a0de7f0

Browse files
authored
Merge pull request #108 from amyXia1994/doc/kcl-openapi
update kcl-openapi installation approaches
2 parents 521b847 + ea9f6dc commit a0de7f0

File tree

4 files changed

+15
-82
lines changed

4 files changed

+15
-82
lines changed

docs/tools/cli/openapi/quick-start.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ go install kcl-lang.io/kcl-openapi@latest
2323
If you don't have go, you can install the CLI with this one-liner:
2424

2525
```shell
26-
curl https://kcl-lang.io/scripts/install-kcl-openapi.sh | sh
26+
curl -fsSL https://kcl-lang.io/script/install-kcl-openapi.sh | /bin/bash
2727
```
2828

2929
## 1.3 Dowload from release
@@ -38,27 +38,10 @@ export PATH="<Your directory to store KCLOpenapi binary>:$PATH"
3838

3939
## 1.4 Verify your installation
4040

41-
- To verify the installation, you can run the command: `kcl-openapi generate model -h` and the following information indicates your successful installation:
4241

4342
```shell
44-
kcl-openapi command helps you to generate KCL schema structure from K8s CRD YAML/JSON file.
45-
1. Translate Swagger Openapi Spec to KCL code
46-
2. Translate Kubernetes CRD to KCL code
47-
48-
Examples:
49-
50-
# convert a K8s CRD file into KCL files
51-
kcl-openapi generate model -f FILENAME --crd --skip-validation
52-
53-
Options:
54-
--crd=false: Set the spec file is a kube crd
55-
-f, --filename='': The filename to convert
56-
--skip-validation=false: Skips validation of spec prior to generation
57-
-t, --target='': The location to write output kcl files
58-
--version=false: Show the KCLOpenAPI version
59-
60-
Usage:
61-
kcl-openapi generate model -f FILENAME [options]
43+
➜ kcl-openapi -v
44+
kcl-openapi 0.5.0
6245
```
6346

6447
## 2. Generate KCL Files

i18n/zh-CN/docusaurus-plugin-content-docs/current/tools/cli/openapi/quick-start.md

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebar_position: 1
99
目前有多种安装方式可选:
1010

1111
- [通过 go install 安装](#11-通过-go-install-安装)
12-
- [通过 curl|sh 安装(仅限 MacOS & Linux)](#12-通过-curlsh-安装(仅限-MacOS-Linux))
12+
- [通过 curl|sh 安装(仅限 MacOS & Linux)](#12-通过-curlsh-安装(仅限-MacOS--Linux))
1313
- [下载发布包](#13-下载发布包)
1414

1515
## 1.1 通过 go install 安装
@@ -21,7 +21,7 @@ go install kcl-lang.io/kcl-openapi@latest
2121
## 1.2 通过 curl|sh 安装(仅限 MacOS & Linux)
2222

2323
```shell
24-
curl https://kcl-lang.io/scripts/install-kcl-openapi.sh | sh
24+
curl -fsSL https://kcl-lang.io/script/install-kcl-openapi.sh | /bin/bash
2525
```
2626

2727
## 1.3 下载发布包
@@ -36,29 +36,13 @@ export PATH="<Your directory to store KCLOpenapi binary>:$PATH"
3636

3737
## 1.4 验证安装结果
3838

39-
安装完成后,您可执行 `kcl-openapi generate model -h`,如果看到如下信息则说明安装成功:
4039

4140
```shell
42-
kcl-openapi command helps you to generate KCL schema structure from K8s CRD YAML/JSON file.
43-
1. Translate Swagger Openapi Spec to KCL code
44-
2. Translate Kubernetes CRD to KCL code
45-
46-
Examples:
47-
48-
# convert a K8s CRD file into KCL files
49-
kcl-openapi generate model -f FILENAME --crd --skip-validation
50-
51-
Options:
52-
--crd=false: Set the spec file is a kube crd
53-
-f, --filename='': The filename to convert
54-
--skip-validation=false: Skips validation of spec prior to generation
55-
-t, --target='': The location to write output kcl files
56-
--version=false: Show the KCLOpenAPI version
57-
58-
Usage:
59-
kcl-openapi generate model -f FILENAME [options]
41+
➜ kcl-openapi -v
42+
kcl-openapi 0.5.0
6043
```
6144

45+
6246
## 2. 生成 KCL 文件
6347

6448
- [将 OpenAPI 描述文件转换为 KCL](../openapi/openapi-to-kcl.md)

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.5.0/tools/cli/openapi/quick-start.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebar_position: 1
99
目前有多种安装方式可选:
1010

1111
- [通过 go install 安装](#11-通过-go-install-安装)
12-
- [通过 curl|sh 安装(仅限 MacOS & Linux)](#12-通过-curlsh-安装(仅限-MacOS-Linux))
12+
- [通过 curl|sh 安装(仅限 MacOS & Linux)](#12-通过-curlsh-安装(仅限-MacOS--Linux))
1313
- [下载发布包](#13-下载发布包)
1414

1515
## 1.1 通过 go install 安装
@@ -21,7 +21,7 @@ go install kcl-lang.io/kcl-openapi@latest
2121
## 1.2 通过 curl|sh 安装(仅限 MacOS & Linux)
2222

2323
```shell
24-
curl https://kcl-lang.io/scripts/install-kcl-openapi.sh | sh
24+
curl -fsSL https://kcl-lang.io/script/install-kcl-openapi.sh | /bin/bash
2525
```
2626

2727
## 1.3 下载发布包
@@ -36,27 +36,10 @@ export PATH="<Your directory to store KCLOpenapi binary>:$PATH"
3636

3737
## 1.4 验证安装结果
3838

39-
安装完成后,您可执行 `kcl-openapi generate model -h`,如果看到如下信息则说明安装成功:
4039

4140
```shell
42-
kcl-openapi command helps you to generate KCL schema structure from K8s CRD YAML/JSON file.
43-
1. Translate Swagger Openapi Spec to KCL code
44-
2. Translate Kubernetes CRD to KCL code
45-
46-
Examples:
47-
48-
# convert a K8s CRD file into KCL files
49-
kcl-openapi generate model -f FILENAME --crd --skip-validation
50-
51-
Options:
52-
--crd=false: Set the spec file is a kube crd
53-
-f, --filename='': The filename to convert
54-
--skip-validation=false: Skips validation of spec prior to generation
55-
-t, --target='': The location to write output kcl files
56-
--version=false: Show the KCLOpenAPI version
57-
58-
Usage:
59-
kcl-openapi generate model -f FILENAME [options]
41+
➜ kcl-openapi -v
42+
kcl-openapi 0.5.0
6043
```
6144

6245
## 2. 生成 KCL 文件

versioned_docs/version-0.5.0/tools/cli/openapi/quick-start.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ go install kcl-lang.io/kcl-openapi@latest
2323
If you don't have go, you can install the CLI with this one-liner:
2424

2525
```shell
26-
curl https://kcl-lang.io/scripts/install-kcl-openapi.sh | sh
26+
curl -fsSL https://kcl-lang.io/script/install-kcl-openapi.sh | /bin/bash
2727
```
2828

2929
## 1.3 Dowload from release
@@ -38,27 +38,10 @@ export PATH="<Your directory to store KCLOpenapi binary>:$PATH"
3838

3939
## 1.4 Verify your installation
4040

41-
- To verify the installation, you can run the command: `kcl-openapi generate model -h` and the following information indicates your successful installation:
4241

4342
```shell
44-
kcl-openapi command helps you to generate KCL schema structure from K8s CRD YAML/JSON file.
45-
1. Translate Swagger Openapi Spec to KCL code
46-
2. Translate Kubernetes CRD to KCL code
47-
48-
Examples:
49-
50-
# convert a K8s CRD file into KCL files
51-
kcl-openapi generate model -f FILENAME --crd --skip-validation
52-
53-
Options:
54-
--crd=false: Set the spec file is a kube crd
55-
-f, --filename='': The filename to convert
56-
--skip-validation=false: Skips validation of spec prior to generation
57-
-t, --target='': The location to write output kcl files
58-
--version=false: Show the KCLOpenAPI version
59-
60-
Usage:
61-
kcl-openapi generate model -f FILENAME [options]
43+
➜ kcl-openapi -v
44+
kcl-openapi 0.5.0
6245
```
6346

6447
## 2. Generate KCL Files

0 commit comments

Comments
 (0)