Skip to content

Optimize Developer CLI with quiet mode, test filtering, MCP server, and git configuration commands#796

Merged
tjementum merged 19 commits intomainfrom
developer-cli-optimizations
Nov 26, 2025
Merged

Optimize Developer CLI with quiet mode, test filtering, MCP server, and git configuration commands#796
tjementum merged 19 commits intomainfrom
developer-cli-optimizations

Conversation

@tjementum
Copy link
Copy Markdown
Member

@tjementum tjementum commented Nov 26, 2025

Summary & Motivation

This introduces several improvements to the Developer CLI to enhance its usability, particularly when used as an AI tool backend:

  • Add --quiet option to build, check, format, inspect, and test commands to minimize output for AI context windows
  • Add --filter and --exclude-category options to the test command to run specific test subsets and exclude test categories (e.g., "Noisy" tests)
  • Create new mcp command that exposes CLI functionality as an MCP (Model Context Protocol) server for AI tools
  • Add new git-config command for configuring author identity and recommended Git settings
  • Add --cli option to build, check, format, and inspect commands to target only the developer-cli project
  • Add --no-build option to check command and remove --skip-format/--skip-inspect options for a more consistent interface
  • Add --force option to install command to allow reinstallation
  • Rename configure-continuous-deployments command to deploy for brevity
  • Rename sync-windsurf-ai-rules command to sync-ai-rules for generality
  • Delete unused coauthor command
  • Add .mcp.json configuration file for MCP server integration like Claude Code
  • Add TestCategoryAttribute for categorizing tests that can be excluded during CLI runs
  • Suppress verbose logging output during tests in EndpointBaseTest
  • Upgrade translate command to use GPT5-mini (better and ~10x cheaper) and IChatClient from Microsoft.Extensions.AI
  • Fix coverage command to cover all systems without including tests in NuGet packages
  • Fix pull-platformplatform-changes command failing when local main is behind origin
  • Fix bug in Developer CLI when no .zshrc profile exists on macOS
  • Add global --trace option to show external processes being executed (replaces per-command --verbose-logging)
  • Rename --solution-name option to --self-contained-system for consistency across CLI commands

Downstream projects

  1. Update your-self-contained-system/Tests/EndpointBaseTest.cs to suppress logging during tests:

     using Mapster;
     using Microsoft.ApplicationInsights;
     using Microsoft.ApplicationInsights.Channel;
     using Microsoft.ApplicationInsights.Extensibility;
    +using Microsoft.AspNetCore.Hosting;
     using Microsoft.AspNetCore.Mvc.Testing;

    And add inside the WithWebHostBuilder configuration:

             _webApplicationFactory = new WebApplicationFactory<Program>().WithWebHostBuilder(builder =>
                 {
    +                builder.ConfigureLogging(logging =>
    +                    {
    +                        logging.AddFilter(_ => false); // Suppress all logs during tests
    +                    }
    +                );
    +
                     builder.ConfigureTestServices(services =>
  2. If any tests produce noisy output (e.g., verbose exception logging), add the [TestCategory("Noisy")] attribute to exclude them from normal CLI test runs. Example:

    [Fact]
    [TestCategory("Noisy")]
    public async Task MyNoisyTest()
    {
        // Test implementation
    }
  3. Update .github/workflows/your-self-contained-system.yml to use --self-contained-system instead of --solution-name:

          - name: Run Code Inspections
            working-directory: developer-cli
            run: |
    -          dotnet run inspect --backend --solution-name YourSelfContainedSystem.slnf | tee inspection-output.log
    +          dotnet run inspect --backend --self-contained-system your-self-contained-system | tee inspection-output.log
    
              if ! grep -q "No backend issues found!" inspection-output.log; then
                echo "Code inspection issues found."
                exit 1
              fi
    
          - name: Check for Code Formatting Issues
            working-directory: developer-cli
            run: |
    -          dotnet run format --backend --solution-name YourSelfContainedSystem.slnf
    +          dotnet run format --backend --self-contained-system your-self-contained-system
    
              # Check for any changes made by the code formatter
              git diff --exit-code || {
    -            echo "Formatting issues detected. Please run 'dotnet run format --backend --solution-name YourSelfContainedSystem.slnf' from /developer-cli folder locally and commit the formatted code."
    +            echo "Formatting issues detected. Please run 'dotnet run format --backend --self-contained-system your-self-contained-system' from /developer-cli folder locally and commit the formatted code."
                exit 1
              }

Checklist

  • I have added tests, or done manual regression tests
  • I have updated the documentation, if necessary

@tjementum tjementum self-assigned this Nov 26, 2025
@tjementum tjementum requested a review from a team as a code owner November 26, 2025 13:40
@tjementum tjementum added the Enhancement New feature or request label Nov 26, 2025
@tjementum tjementum force-pushed the developer-cli-optimizations branch from 948e24e to 8bbeccc Compare November 26, 2025 14:30
@tjementum tjementum moved this to 🏗 In Progress in Kanban board Nov 26, 2025
@sonarqubecloud
Copy link
Copy Markdown

@tjementum tjementum merged commit f8ec4c2 into main Nov 26, 2025
27 checks passed
@tjementum tjementum deleted the developer-cli-optimizations branch November 26, 2025 14:36
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in Kanban board Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant