Add CopilotSkipCliDownload option to .NET SDK#494
Conversation
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>
52fe739 to
4b37894
Compare
Cross-SDK Consistency ReviewI've reviewed this PR for cross-SDK consistency. This PR adds the 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 SDKEach SDK takes a different approach to bundling/providing the CLI binary, reflecting platform-specific packaging conventions:
Why This Is Consistent
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 (
|
There was a problem hiding this comment.
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
CopilotSkipCliDownloadMSBuild property that when set totrueskips CLI download and bundling - Updated conditions on
_DownloadCopilotCli,_CopyCopilotCliToOutput, and_RegisterCopilotCliForCopytargets to respect the new property
| @@ -55,8 +55,8 @@ | |||
| <CopilotCliDownloadTimeout Condition="'$(CopilotCliDownloadTimeout)' == ''">600</CopilotCliDownloadTimeout> | |||
| </PropertyGroup> | |||
|
|
|||
There was a problem hiding this comment.
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.
| <!-- 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> |
Summary
Add MSBuild property
CopilotSkipCliDownloadthat when set totrueskips automatic download and bundling of the Copilot CLI binary during build.