This document provides comprehensive guidelines for creating CLI commands in the Azure.Sdk.Tools.Cli project. All CLI commands must follow these established patterns and conventions to ensure consistency, maintainability, and proper integration with both CLI and MCP (Model Context Protocol) server functionality.
All CLI commands must follow a predefined top-level command hierarchy. Commands are organized into the following categories:
Namespace: Azure.Sdk.Tools.Cli.Tools.Package
Command Group: SharedCommandGroups.Package
Verb: package
For operations at the SDK package level. The package group has further sub-grouping for better organization:
- Build/compile SDK code
- Generate source code
- Release packages
- Update version information
- Validate packages
For generating and updating README files:
- Generate README file
- Update README content
For generating and updating SDK samples:
- Create samples
- Update existing samples
For creating, updating, and running tests for SDK packages:
- Create tests
- Update existing tests
- Run tests for specific packages
Examples:
package build --package-path ./sdk/storagepackage generate --typespec-project ./specification/storagepackage readme generate --package-path ./sdk/computepackage readme update --package-path ./sdk/keyvault --section getting-startedpackage release --package-name azure-corepackage sample generate --package-path ./sdk/computepackage sample update --package-path ./sdk/storage --sample-name basic-usagepackage test generate --package-path ./sdk/storage --test-type <type>package test run --package-path ./sdk/keyvault --test-suite integrationpackage validate --package-path ./sdk/keyvault
Namespace: Azure.Sdk.Tools.Cli.Tools.ReleasePlan
Command Group: Custom (no predefined group)
Verb: release-plan
For release planning and SDK coordination:
- Create release plans
- Link SDK pull requests to release plans
- Get release plan details
Examples:
release-plan generate-sdk --typespec-project ./spec/storage --api-version 2023-01-01release-plan get --workitem-id 456release-plan link-sdk-pr --release-plan-id 123 --pr 789
Namespace: Azure.Sdk.Tools.Cli.Tools.TypeSpec
Command Group: SharedCommandGroups.TypeSpec
Verb: tsp
For TypeSpec-related operations:
- Create TypeSpec projects
- Convert Swagger to TypeSpec
- Validate TypeSpec projects
- Common TypeSpec workflows
Examples:
tsp convert --swagger-file ./swagger.jsontsp init --name MyServicetsp client generate --output-dir ./generatedtsp client update --config-path ./tspconfig.yamltsp validate --project-path ./typespec
Tools/
├── Package/ # Package-level operations
├── ReleasePlan/ # Release planning operations
├── TypeSpec/ # TypeSpec operations