Skip to content

Conversation

JasonYeMSFT
Copy link
Contributor

@JasonYeMSFT JasonYeMSFT commented Sep 16, 2025

What does this PR do?

Add a new cligenerate command that can generate Azure Cli commands using a LLM powered services. This service can produce higher quality commands than what the LLM can generate on its own and guarantees the returned commands are valid through validation.

GitHub issue number?

#203

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Updated command list in /docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

@joshfree joshfree moved this from Untriaged to In Progress in Azure MCP Server Sep 16, 2025
@JasonYeMSFT JasonYeMSFT force-pushed the chuye/cligenerate-command branch from 376474e to 191a74e Compare September 16, 2025 21:35
var accessToken = await cliGenerateService.GetAzCliGenerateTokenAsync();

// GHCP4A Prod app
const string url = "https://aiservice.ghcpaz-prod.azure.com/api/azurecli/generate";
Copy link
Contributor Author

@JasonYeMSFT JasonYeMSFT Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API hasn't been deployed to Prod yet. The implementation has been merged and will be deployed soon.

@JasonYeMSFT JasonYeMSFT force-pushed the chuye/cligenerate-command branch from 8873f2b to 5ddc234 Compare September 17, 2025 16:37
@JasonYeMSFT JasonYeMSFT marked this pull request as ready for review September 17, 2025 16:38
@JasonYeMSFT JasonYeMSFT requested review from wbreza, jongio and a team as code owners September 17, 2025 16:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new cligenerate command to the Azure MCP Server that generates Azure CLI commands using an LLM-powered service. The command takes user intent as input and produces validated Azure CLI commands through an external API service.

Key changes:

  • Implements a new CLI generation service that communicates with an external Azure API endpoint
  • Adds comprehensive command structure with options validation and error handling
  • Provides unit tests to ensure the command functionality works correctly

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
CliGenerateCommand.cs Main command implementation with validation and Azure CLI generation logic
ICliGenerateService.cs Service interface for CLI generation operations
CliGenerateService.cs Service implementation that handles HTTP requests to external API
ExtensionOptionDefinitions.cs Command option definitions for intent and CLI type parameters
CliGenerateOptions.cs Options model for binding command line arguments
CliGenerateResult.cs Result model for returning generated CLI commands
CliGenerateRequest.cs Request models for API communication
ExtensionSetup.cs Service registration and command setup
Constants.cs Azure CLI type constant definition
ExtensionJsonContext.cs JSON serialization context updates
Azure.Mcp.Tools.Extension.csproj Project file cleanup
README.md Documentation updates
CHANGELOG.md Feature addition notes
e2eTestPrompts.md Test prompts for the new functionality
azmcp-commands.md Command documentation
CliGenerateCommandTests.cs Unit tests for the CLI generate command

@JasonYeMSFT JasonYeMSFT changed the title Add cligenerate command Add extension cli generate command Sep 17, 2025
@JasonYeMSFT JasonYeMSFT force-pushed the chuye/cligenerate-command branch from ca2f40d to 666d803 Compare September 18, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants