Skip to content

demaconsulting/NuGetCacheTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

NuGet Cache Tool

GitHub forks GitHub stars GitHub contributors License Build Quality Gate Security NuGet

DEMA Consulting NuGet cache management tool for .NET developers.

Overview

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.

Features

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

Installation

Install the tool globally using the .NET CLI:

dotnet tool install -g DemaConsulting.NuGet.CacheTool

Usage

# 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.log

Building

pwsh ./build.ps1

Command-Line Options

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

Documentation

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

User Guide

The NuGet Cache Tool User Guide is available on the NuGet Cache Tool releases page.

Contributing

See CONTRIBUTING.md for contribution guidelines.

License

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.

Support

About

DotNet tool to cache NuGet packages.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors