Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 5 additions & 29 deletions docs/pages/usage/setup_and_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,36 +134,12 @@ aaz-dev run --cli-path {path to azure-cli} --cli-extension-path {path to azure-c

![start with swagger module path](../../assets/images/setup_and_run/swagger_module_start.png)

## Generate `aaz` model and commands in scripts

### 1. Generate `aaz` model

The following cmd can be used to generate `aaz` command model directly in cmd shell.

```bash
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}
```

for example, generating `aaz` command model for liftrpinecone under tag `package-2024-10-22-preview`:

```bash
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
```

And developers can check `aaz` folder to see the newly generated command models for `liftrpinecone`.

### 2. Generate `aaz` commands

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.

## Generate Azure CLI module in seconds!
E.g.,
```bash
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}
aaz-dev cli generate --spec chaos --module chaos
```

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:

```bash
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
```
It will convert the specification from https://github.com/Azure/azure-rest-api-specs/tree/main/specification/chaos into an Azure CLI module named `chaos`.

And developers can check `azure-cli-extensions` folder to see the newly generated commands for swagger module liftrpinecone under cli extension module `myliftrpinecone`.
> Generate code effortlessly. If the result isn't what you expected, use the UI to fine-tune it.