Skip to content

Add CopilotSkipCliDownload option to .NET SDK#494

Merged
SteveSandersonMS merged 1 commit intomainfrom
stevesa/dotnet-cli-optout
Feb 17, 2026
Merged

Add CopilotSkipCliDownload option to .NET SDK#494
SteveSandersonMS merged 1 commit intomainfrom
stevesa/dotnet-cli-optout

Conversation

@SteveSandersonMS
Copy link
Contributor

@SteveSandersonMS SteveSandersonMS commented Feb 17, 2026

Summary

Add MSBuild property CopilotSkipCliDownload that when set to true skips automatic download and bundling of the Copilot CLI binary during build.

Copilot AI review requested due to automatic review settings February 17, 2026 15:11
@SteveSandersonMS SteveSandersonMS requested a review from a team as a code owner February 17, 2026 15:11
Add MSBuild property CopilotSkipCliDownload that when set to true skips
automatic download and bundling of the Copilot CLI binary. This is useful
for users who install the CLI separately (e.g., via npm or a package manager)
and want to avoid the build-time download.

When skipped, users must ensure COPILOT_CLI_PATH or the CliPath option
points to a valid CLI installation at runtime.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@SteveSandersonMS SteveSandersonMS force-pushed the stevesa/dotnet-cli-optout branch from 52fe739 to 4b37894 Compare February 17, 2026 15:12
@github-actions
Copy link

Cross-SDK Consistency Review

I've reviewed this PR for cross-SDK consistency. This PR adds the CopilotSkipCliDownload MSBuild property to the .NET SDK, allowing users to skip automatic CLI download and bundling during build.

Summary

This change maintains appropriate cross-SDK consistency. Each SDK handles CLI distribution differently based on platform norms, and this .NET-specific feature aligns with those patterns.

CLI Distribution Approach by SDK

Each SDK takes a different approach to bundling/providing the CLI binary, reflecting platform-specific packaging conventions:

SDK CLI Distribution Strategy Opt-Out Mechanism
Node.js No bundling—depends on @github/copilot package (peer dependency) N/A (not bundled)
Python Platform-specific wheels with embedded CLI binary cli_path option or COPILOT_CLI_PATH env var
Go Optional embedding via bundler tool Skip bundler step, or use CLIPath/COPILOT_CLI_PATH
.NET Auto-download during build from npm registry ✅ NEW: CopilotSkipCliDownload MSBuild property

Why This Is Consistent

  1. .NET's auto-download approach is unique to MSBuild packaging norms where build-time downloads are common. Python uses pre-built wheels, Go uses optional embedding, and Node.js relies on npm's dependency tree.

  2. All SDKs support runtime opt-out via cli_path/CLIPath options or COPILOT_CLI_PATH environment variable—this .NET feature adds build-time opt-out, which makes sense for .NET's build-time download model.

  3. All SDKs support cliUrl/cli_url/CLIUrl to connect to external CLI servers, bypassing local CLI entirely—this is the cross-platform runtime alternative.

Recommendation

No changes needed in other SDKs. This .NET-specific build configuration is appropriate for the platform and doesn't create API inconsistency. The feature addresses a legitimate .NET packaging scenario (corporate environments, CI pipelines with pre-installed CLI, air-gapped builds) without diverging from the shared runtime configuration model.


Note: All SDKs maintain consistent runtime configuration options (cliPath, cliUrl, environment variables). Build-time configuration naturally differs across ecosystems (.NET MSBuild properties, Python wheel selection, Go build tags, npm package resolution).

AI generated by SDK Consistency Review Agent

@SteveSandersonMS SteveSandersonMS merged commit df23ff4 into main Feb 17, 2026
26 checks passed
@SteveSandersonMS SteveSandersonMS deleted the stevesa/dotnet-cli-optout branch February 17, 2026 15:18
Copy link
Contributor

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 MSBuild property CopilotSkipCliDownload to the .NET SDK that allows users to skip the automatic download and bundling of the Copilot CLI binary during build. This is useful for scenarios where the CLI is installed separately (e.g., via npm or a package manager), where faster builds are desired, or where npm registry access is restricted.

Changes:

  • Added CopilotSkipCliDownload MSBuild property that when set to true skips CLI download and bundling
  • Updated conditions on _DownloadCopilotCli, _CopyCopilotCliToOutput, and _RegisterCopilotCliForCopy targets to respect the new property

@@ -55,8 +55,8 @@
<CopilotCliDownloadTimeout Condition="'$(CopilotCliDownloadTimeout)' == ''">600</CopilotCliDownloadTimeout>
</PropertyGroup>

Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The CopilotSkipCliDownload property documentation is inconsistent with the pattern used for other MSBuild properties in this file (CopilotNpmRegistryUrl and CopilotCliDownloadTimeout). Those properties have multi-line XML comments in a PropertyGroup element that explain the purpose, usage example with PropertyGroup syntax, and default value. This property should follow the same documentation pattern for consistency and better user guidance.

Suggested change
<!-- Control whether the SDK automatically downloads the Copilot CLI binary.
Set CopilotSkipCliDownload in your .csproj or Directory.Build.props if you install
the CLI separately and do not want the SDK to manage the download:
<PropertyGroup>
<CopilotSkipCliDownload>true</CopilotSkipCliDownload>
</PropertyGroup>
When not set (or set to any value other than 'true'), the SDK will download the
Copilot CLI during build for the detected platform. -->
<PropertyGroup>
<CopilotSkipCliDownload Condition="'$(CopilotSkipCliDownload)' == ''">false</CopilotSkipCliDownload>
</PropertyGroup>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant