From 58645d76c99f3470969d38c01c74392ed1b23ce4 Mon Sep 17 00:00:00 2001 From: AllyW Date: Mon, 14 Apr 2025 11:33:26 +0800 Subject: [PATCH 1/2] add auto gen cmd doc --- docs/pages/usage/setup_and_run.md | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/pages/usage/setup_and_run.md b/docs/pages/usage/setup_and_run.md index 5645c295..d3c70c89 100644 --- a/docs/pages/usage/setup_and_run.md +++ b/docs/pages/usage/setup_and_run.md @@ -133,3 +133,37 @@ 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 code using cmds + +### 1. Generate `aaz` command 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. + +```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} +``` + +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 +``` + +And developers can check `azure-cli-extensions` folder to see the newly generated commands for swagger module liftrpinecone under cli extension module `myliftrpinecone`. From 31b191d12e974e86f8b80fdc5fc129d20ca28d8d Mon Sep 17 00:00:00 2001 From: AllyW Date: Mon, 14 Apr 2025 11:35:32 +0800 Subject: [PATCH 2/2] adjust doc --- docs/pages/usage/setup_and_run.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pages/usage/setup_and_run.md b/docs/pages/usage/setup_and_run.md index d3c70c89..457dc365 100644 --- a/docs/pages/usage/setup_and_run.md +++ b/docs/pages/usage/setup_and_run.md @@ -134,9 +134,9 @@ 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 code using cmds +## Generate `aaz` model and commands in scripts -### 1. Generate `aaz` command model +### 1. Generate `aaz` model The following cmd can be used to generate `aaz` command model directly in cmd shell.