zipsrc 1.0.0

dotnet tool install --global zipsrc --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local zipsrc --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=zipsrc&version=1.0.0
                    
nuke :add-package zipsrc --version 1.0.0
                    

"dnx zipsrc" command

NuGet Package unit tests Discord

Overview

"dnx zipsrc" is a .NET global tool that creates a zip archive from source files in your project, using .gitignore patterns to exclude artifacts, dependencies, and other non-source files.

System Requirements

.NET SDK Version 10.0 or later is required.

Usage

dnx zipsrc [options]
Option Description
-d, --directory <directory> Specifies the target directory path to create a zip archive. Default is the current directory.
-n, --name <file> Specifies the output zip file path. If not specified, the default name is determined automatically. For more details, see the following document.

What gets zipped

  • Recursively scans the specified directory (including subdirectories) and collects files to zip.
  • Focuses on source code and other development-relevant files. Typical non-source artifacts are excluded (e.g., bin/, obj/ for .NET projects, node_modules/ for Node.js, and other build outputs, caches, or downloaded dependencies).
  • .zip files are always excluded from the archive.

How ignore rules are applied

  • Ignore rules are based on .gitignore patterns.
    • If the target directory contains a .gitignore, its rules are honored.
    • If there is no .gitignore at the target directory, the tool falls back to the default rules equivalent to those from dotnet new gitignore.
    • .gitignore files in subdirectories are also read and respected. Negation patterns (e.g., !pattern) are correctly handled.

Output file naming

  • When -n|--name is specified:
    • If the provided name does not end with .zip, the .zip extension is automatically appended.
  • When -n|--name is not specified, the output file name is decided as follows:
    1. If a .sln or .slnx file exists in the target directory, the base name of that solution file plus .zip is used.
    2. Otherwise, the target directory name plus .zip is used.
  • If a file with the chosen name already exists, a numeric suffix like (2), (3), ... is appended to create a new non-conflicting name.

Examples

  • Zip the current directory using defaults:
    dnx zipsrc
    
  • Zip a specific directory:
    dnx zipsrc -d ./src/MyApp
    
  • Specify an explicit output name (extension auto-appended if missing):
    dnx zipsrc -d ./src/MyApp -n ./artifacts/MyAppSource
    # => produces ./artifacts/MyAppSource.zip
    

Release Notes

See the Releases

License

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.0 87 1/7/2026

v.1.0.0
- Initial release.

To see all the change logs, please visit the following URL.
- https://github.com/jsakamoto/dnx-zipsrc/blob/main/RELEASE-NOTES.txt