Home

Awesome

GetNuTool

Embeddable Package Manager (+core in .bat); šŸ•Š Lightweight tool to Create or Distribute using basic shell scripts (does not require powershell or dotnet-cli); NuGet / Chocolatey client;

Copyright (c) 2015-2024  Denis Kuzmin <x-3F@outlook.com> github/3F

怌 ā¤ 怍 License Build status release

gnt Fnv1a128                                  # Get Fnv1a128 package
gnt /t:pack /p:ngin="bin\DllExport"           # Create new DllExport package
gnt "Conari;regXwild"                         # Get Conari & regXwild packages
msbuild gnt.core /p:ngpackages=LuNari/1.6.0   # Use msbuild to get LuNari 1.6.0 
gnt Huid/1.0.0:src.zip /t:grab                # Grab Huid 1.0 as zip without unpacking
gnt /p:ngconfig="dir\packages.config"         # Use specified packages.config
set ngpackages=Conari & gnt                   # shell scripts
gnt /p:ngpackages=putty.portable/0.69         # chocolatey
    /p:ngserver="https://chocolatey.org/api/v2/package/"

Download all editions: Core, Minified, Executable, C# version for .NET, ...

Official Direct Links:

Projects based entirely on GetNuTool

Why GetNuTool

> gnt                                      # via single shell script
> msbuild gnt.core                         # via MSBuild engine
[NuGet gnt.raw("/t:pack /p:ngin=7z.Libs")] # via SobaScript
new GetNuTool()                            # .NET(netfx 4.0+, .NET 5+, .NET Core, Mono) C#

Lightweight Portable and completely Embeddable (+core in .bat) package tool to create or distribute everything from anything.

Back in those days it was originally developed as an alternative to solution level limitations, i.e. github.com/NuGet/Home/issues/1521. In attempt to provide a tool to easily maintain projects, libraries, and other related build processes; For all projects at once at the solution level and of course for each separately if necessary.

For example, it was designed to be more friendly to such NuGet packages:

However! GetNuTool has more powerful ways even for standard NuGet packages providing a wider range of use cases.

Key Features

Note:

tModes and Commands

get

For receiving packages or zipped files from local or remote source, then installing / extracting.

The get is used by default but you can also specify /t:get

PropertyDescriptionDefault values
ngconfigDefine .config files.1.9+ packages.config;.tools\packages.config
ngserverDefine server.1.0+ https://www.nuget.org/api/v2/package/
ngpackagesList of packages. Disables ngconfig if specified.
ngpathCommon path for all packages.1.0+ packages
wpath1.4+ To change working directory.1.4+ (The absolute path of the directory where the GetNuTool is located)
proxycfg1.6.2+ To configure connection via proxy.
ssl31.9+ Do not drop legacy ssl3, tls1.0, tls1.1 if true.
break1.9+ Disable the break on first package error if no

Package List Format

AttributeDescriptionExample
idIdentifier of package.Conari
version(Optional) Package version.1.5.0 or 1.5-beta2 or 1.5-RC etc.
output(Optional) Where to store package data.../tests/case1
sha1(Optional) Expected sha1 for this package.eead8f5c1fdff2abd4da7d799fbbe694d392c792

Note:

ngpackages
id[/version][?sha1][:path];id2[/version][?sha1][:path];...

delimiters:

/p:ngpackages=Name1
/p:ngpackages="Name1;Name2"
packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Name1" version="1.5.0" />
  <package id="Name2" output="path" />
  <package id="Name3" version="2.2-RC" sha1="eead8f5c1fdff2abd4da7d799fbbe694d392c792" />
</packages>
/p:ngconfig=".nuget/packages.config"
/p:ngconfig="debug.config;release.config;..."

Proxy Format

[usr[:pwd]@]host[:port]
/p:proxycfg="example.com:4321"

grab

1.9+

Grabs data without unpacking. The available parameters are similar to the get above.

For example:

gnt Huid/1.0.0:src.nupkg /t:grab
gnt :../netfx4sdk.cmd /t:grab /p:ngserver=https://server/netfx4sdk.cmd
msbuild gnt.core /t:grab /p:ngpackages=Fnv1a128:src.nupkg
gnt Huid/1.0.0?24ecda9a4fb8920067df31788d3dea708996ab08:src.nupkg /t:grab

pack

Creates the new .nupkg packages using .nuspec specification. Can also be found in the package folder after using get.

PropertyDescriptionDefault values
nginPath to directory where .nuspec to create package from it.
ngoutOptional path to save the final .nupkg package in other place.
wpath1.4+ To change working directory.1.4+ (The absolute path of the directory where the GetNuTool is located)
gnt /t:pack /p:ngin=path\to\dir
gnt /t:pack /p:ngin="path to\dir";ngout=..\dst.nupkg

Global Properties

PropertyValue
debugtrue to add extra info in stream.
logono to hide logo when processing starts.

For example:

gnt /t:pack /p:ngin=packages\LX4Cnh /p:debug=true
set debug=true & gnt /p:ngpackages="Conari;LX4cn;Fnv1a128";break=no

Extra Editions

Compiled. SobaScript component

GetNuTool now is part of NuGetComponent

#[NuGet gnt.raw("/t:pack /p:ngin=D:\7z.Libs")]

C# GetNuTool.cs

GetNuTool.cs includes a fully compatible gnt.core inside.

Add GetNuTool.cs to your project (.NET Framework 4.0+, .NET 5+, Mono, .NET Core, .NET Standard), then command like:

var gnt = new net.r_eg.GetNuTool();
gnt.Run(ngpackages: "Conari;regXwild");
...
gnt.Run(ngpackages: "Fnv1a128");

Batch (.bat) version

~8 KB gnt.bat includes a fully compatible gnt.core inside.

gnt.bat extra arguments

First key to gnt.batDescriptionExample
...1.9+ alias to ngpackages=...gnt Conari, gnt "regXwild;Fnv1a128"
-unpack1.6+ To generate minified gnt.core from gnt.bat.gnt -unpack
-msbuild path1.6 - 1.8 To use specific msbuild. Removed in 1.9. Override engine insteadgnt -msbuild "D:\MSBuild\bin\amd64\msbuild" /p:ngpackages=Conari

Override engine

Since the -msbuild key was removed in 1.9 as obsolete, you have following ways to override engine search:

Either create msb.gnt.cmd in the directory from which the call gnt.bat is planned; with the following content, for example:

@echo msbuild.exe

Or place a full version of hMSBuild.bat (~19 KB) tool instead of msb.gnt.cmd stub.

Or -unpack command:

gnt -unpack & msbuild.exe gnt.core {args}

Or msb.gnt.cmd environment variable:

set msb.gnt.cmd=msbuild.exe & gnt {args}

Examples

gnt vsSolutionBuildEvent/1.16.1:../SDK & SDK\GUI
gnt Conari
gnt /p:ngpackages=Conari
msbuild gnt.core /p:ngpackages=Conari
gnt "Conari;regXwild;MvsSln"
gnt /p:ngpackages="Conari;regXwild;MvsSln"
gnt Fnv1a128
gnt /t:pack /p:ngin=packages/Fnv1a128
msbuild gnt.core /p:ngconfig=".nuget/packages.config";ngpath="../packages"
gnt Conari /p:proxycfg="guest:1234@10.0.2.15:7428"
set ngpackages=Conari & call gnt || echo Failed
gnt "7z.Libs;vsSolutionBuildEvent/1.16.1:../packages/SDK"

Direct link to a remote package via https:

gnt :DllExport /p:ngserver=https://server/DllExport.1.7.4.nupkg

Direct link to a local package that will be stored at the top level next to the gnt

gnt : /p:ngserver=D:/local_dir/vsSolutionBuildEvent.SDK10.nupkg /p:ngpath=SDK10
gnt "Conari;Fnv1a12;LX4Cnh" /p:break=no /p:debug=true

Conari use D:\prg\projects\GetNuTool\GetNuTool\bin\Release\packages\Conari
Fnv1a12 ... The remote server returned an error: (404) Not Found.
LX4Cnh ... D:\prg\projects\GetNuTool\GetNuTool\bin\Release\packages\LX4Cnh
- /.version
- /build-info.txt
- /lib/net40/LX4Cnh.dll
- /lib/net40/LX4Cnh.xml
- /lib/net5.0/LX4Cnh.dll
- /lib/net5.0/LX4Cnh.xml
- /License.txt
- /LX4Cnh.nuspec
- /Readme.md
- /tools/gnt.bat
- /tools/hMSBuild.bat
...
gnt Huid/1.0.0:src.zip /t:grab

See also examples from tests/

Build and Use from source

git clone https://github.com/3F/GetNuTool.git src
cd src & build & bin\Release\gnt Conari

.sha1 official distribution

GetNuTool releases are now accompanied by a .sha1 file in the official distribution; At the same time, commits from which releases are published are signed with the committer's verified signature (GPG).

Make sure you are using official, unmodified, safe versions.

Note: .sha1 file is a text list of published files with checksums in the format:

40-hexadecimal-digits <space> file

eead8f5c1fdff2abd4da7d799fbbe694d392c792 path\file
...

Contributing

GetNuTool is waiting for your awesome contributions!