Skip to content

NuGet Package Registry


To work with NuGet packages, the official utility is required.

Windows

Installing NuGet via Chocolatey
  1. Run the following command in an administrative command prompt:
    choco install nuget.commandline  
    
  2. Wait for the installation to complete.
Verifying Installation
  1. In the command prompt, execute:
    nuget  
    
  2. If NuGet is installed correctly, you will see help information about NuGet commands.

macOS

Installing NuGet via Homebrew
  1. Run the following command in the terminal:

    brew install nuget  
    

  2. Verifying installation:

    nuget  
    

  3. If NuGet is installed correctly, you will see help information about NuGet commands.

Linux

Installing NuGet via .NET SDK
  1. Open the terminal and add the Microsoft key:
    wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb  
    sudo dpkg -i packages-microsoft-prod.deb  
    
  2. Update the package list and install the .NET SDK:

    sudo apt-get update  
    sudo apt-get install -y dotnet-sdk-6.0  
    

  3. Verifying installation:

    dotnet --version  
    

  4. If the .NET SDK is installed correctly, you will see the version number. NuGet should be available via the dotnet command:
    dotnet nuget  
    
Installing NuGet via Mono
  1. Run the following command in the terminal:
    sudo apt install mono-complete  
    
  2. Download the executable to the project directory:
    wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe  
    
  3. Verifying installation:
    mono nuget.exe  
    

Registering the GitFlic Registry

To add NuGet packages, you need to obtain a GitFlic transport token. For instructions on obtaining the token, refer to this page.

In the documentation below, you may encounter the attribute <gitflic_domain>. Replace it with the appropriate domain, depending on the version:

  • For SaaS version: registry.gitflic.ru

  • For self-hosted: localhost:8080

The domain and port for the self-hosted version may differ.

The value of the url attribute depends on the access level:

Level URL
Project http(s)://<gitflic_domain>/project/{ownerAlias}/{projectAlias}/package/-/nuget/index.json
Company http(s)://<gitflic_domain>/company/{companyAlias}/package/-/nuget/index.json
Instance http(s)://<gitflic_domain>/registry/package/-/nuget/index.json
URL Variable Description
ownerAlias Project owner's alias
projectAlias Project alias
companyAlias Company alias

To register the registry, run the following command:

nuget source Add -Name GitFlic -Source "{registry_url}" -UserName {username} -Password {transport_token}  

Example:

nuget source Add -Name GitFlic -Source "http://localhost:8080/project/adminuser/test/package/-/nuget/index.json" -UserName adminuser -Password 802b148c-aaaa-aaaa-aaaa-036712b0d269  

Downloading and Installing a Package

To install a package, run the following command:

nuget install package_name -Source GitFlic  

Publishing a Package

To publish a package, run the following command:

nuget push package_name.nupkg -Source GitFlic  

Automatic translation!

This page has been automatically translated. The text may contain inaccuracies.