Skip to content

Commit 0287ca1

Browse files
authored
add auto-gen cmds documentation (Azure#478)
* add auto gen cmd doc
1 parent 5044d67 commit 0287ca1

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/pages/usage/setup_and_run.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,37 @@ aaz-dev run --cli-path {path to azure-cli} --cli-extension-path {path to azure-c
133133
```
134134

135135
![start with swagger module path](../../assets/images/setup_and_run/swagger_module_start.png)
136+
137+
## Generate `aaz` model and commands in scripts
138+
139+
### 1. Generate `aaz` model
140+
141+
The following cmd can be used to generate `aaz` command model directly in cmd shell.
142+
143+
```bash
144+
aaz-dev command-model generate-from-swagger -a {path to aaz} --sm {path to swagger module} -m {swagger module name} --rp {resource provider name} --swagger-tag {swagger tag with input files specified}
145+
```
146+
147+
for example, generating `aaz` command model for liftrpinecone under tag `package-2024-10-22-preview`:
148+
149+
```bash
150+
aaz-dev command-model generate-from-swagger -a ./aaz --sm ./azure-rest-api-specs/specification/liftrpinecone -m liftrpinecone --rp Pinecone.VectorDb --swagger-tag package-2024-10-22-preview
151+
```
152+
153+
And developers can check `aaz` folder to see the newly generated command models for `liftrpinecone`.
154+
155+
### 2. Generate `aaz` commands
156+
157+
Based on the `aaz` model generated in last step, the following cmd can be used to generate `aaz` commands into cli extension directly in cmd shell.
158+
159+
```bash
160+
aaz-dev cli generate-by-swagger-tag -a {path to aaz} -e {path to azure-cli-extensions} --name {target extension module name} --sm {path to swagger module} --rp {resource provider name} --tag {swagger tag with input files specified} --profile {chosen cmd profile}
161+
```
162+
163+
For example, generate `aaz` command under cli extension module `myliftrpinecone` for swagger module liftrpinecone under tag `package-2024-10-22-preview` and the `latest` profile:
164+
165+
```bash
166+
aaz-dev cli generate-by-swagger-tag -a ./aaz -e ./azure-cli-extensions --name myliftrpinecone --sm ./azure-rest-api-specs/specification/liftrpinecone --rp Pinecone.VectorDb --tag package-2024-10-22-preview --profile latest
167+
```
168+
169+
And developers can check `azure-cli-extensions` folder to see the newly generated commands for swagger module liftrpinecone under cli extension module `myliftrpinecone`.

0 commit comments

Comments
 (0)