DEMA Consulting NuGet cache management tool for .NET developers.
NuGet Cache Tool is a .NET global tool that ensures NuGet packages are cached in the
global packages folder. It is designed for CI/CD pipelines and build environments where
packages need to be pre-populated to enable offline or air-gapped operations. The tool
accepts one or more package:version arguments, downloads each package to the global
NuGet cache if not already present, and optionally outputs the resolved cache path.
This tool provides:
- NuGet Package Caching: Cache NuGet packages to the global packages folder
- Multiple Packages: Specify multiple packages in a single command
- Package Path Output: Output the path to each cached package
- Self-Validation: Built-in validation tests with TRX/JUnit output
- Multi-Platform Support: Builds and runs on Windows, Linux, and macOS
- Multi-Runtime Support: Targets .NET 8, 9, and 10
Install the tool globally using the .NET CLI:
dotnet tool install -g DemaConsulting.NuGet.CacheTool# Cache a specific NuGet package
nuget-cache DemaConsulting.NuGet.Caching:0.1.0
# Cache multiple packages
nuget-cache Newtonsoft.Json:13.0.3 NuGet.Common:6.12.1
# Display version
nuget-cache --version
# Display help
nuget-cache --help
# Run self-validation
nuget-cache --validate
# Save validation results
nuget-cache --validate --results results.trx
# Silent mode with logging
nuget-cache --silent --log output.logpwsh ./build.ps1| Option | Description |
|---|---|
-v, --version |
Display version information |
-?, -h, --help |
Display help message |
--silent |
Suppress console output |
--validate |
Run self-validation |
--results <file> |
Write results to file (.trx=TRX, .xml=JUnit XML) |
--log <file> |
Write output to log file |
[package]:[version] |
Cache the specified NuGet package |
Generated documentation includes:
- Build Notes: Release information and changes
- User Guide: Comprehensive usage documentation
- Code Quality Report: CodeQL and SonarCloud analysis results
- Requirements: Functional and non-functional requirements
- Requirements Justifications: Detailed requirement rationale
- Trace Matrix: Requirements to test traceability
The NuGet Cache Tool User Guide is available on the NuGet Cache Tool releases page.
See CONTRIBUTING.md for contribution guidelines.
Copyright (c) DEMA Consulting. Licensed under the MIT License. See LICENSE for details.
By contributing to this project, you agree that your contributions will be licensed under the MIT License.