feat: add download command to CLI#3
Merged
Merged
Conversation
Add 'alcops download' command that performs the full pipeline: - Smart input routing: URL → bc-artifact, path → compiler-path, channel → nuget-devtools, version → API resolution - --detect-from flag to override smart routing - --tfm for explicit TFM (skips detection) - --version for specific ALCops package version - --verbose for debug logging (global, applies to all commands) - Temp .nupkg cleanup via try/finally New modules: - src/resolve-detect-source.ts: API-based version source resolution (NuGet first, marketplace fallback) - src/download/download-command.ts: download pipeline orchestration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove ambiguous positional [source] argument from the download command. Add --detect-source named flag for TFM detection input (URL, path, channel keyword, or version number). This makes --version unambiguously refer to the ALCops package version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
More self-documenting flag name: --detect-using clearly communicates that the value is the input used for TFM detection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
alcops downloadcommand that performs the full analyzer download pipeline:TFM detection via
--detect-usingflag, with smart input routing:--detect-fromoverride - forces a specific detector, always overrides smart routingDownload + extract - downloads the ALCops NuGet package and extracts analyzer DLLs for the detected TFM
Temp cleanup - intermediate .nupkg is downloaded to a temp directory and cleaned up after extraction
CLI Interface
All flags are named (no positional arguments), making
--versionunambiguously the ALCops package version.New Files
src/resolve-detect-source.ts- API-based version-source resolution modulesrc/download/download-command.ts- download pipeline orchestrationtests/resolve-detect-source.test.ts- 11 tests for source resolutiontests/download/download-command.test.ts- 6 tests for download pipelineChanges
src/cli.ts- added download command, --verbose flag (global)src/index.ts- new public API exportsREADME.md- documentation with examples