Paket


paket add

Adds a new package to your paket.dependencies file.

1: 
2: 
3: 
paket add [--help] nuget <package id> [version <version>] [project <name>] [group <name>] [--force]
          [--interactive] [--redirects] [--createnewbindingfiles] [--clean-redirects] [--no-install]
          [--keep-major] [--keep-minor] [--keep-patch] [--touch-affected-refs]

OPTIONS:

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
nuget <package id>    NuGet package id.
version <version>     Allows to specify version of the package.
project <name>        Allows to add the package to a single project only.
group <name>          Add the package to the given group. If omited the Main group is used.
--force, -f           Forces the download and reinstallation of all packages.
--interactive, -i     Asks the user for every project if he or she wants to add the package to
                      the projects's paket.references file.
--redirects           Creates binding redirects for the NuGet packages.
--createnewbindingfiles
                      Creates binding redirect files if needed.
--clean-redirects     Removes all binding redirects that are not specified by Paket.
--no-install          Skips paket install process (patching of csproj, fsproj, ... files) after
                      the generation of paket.lock file.
--keep-major          Allows only updates that are not changing the major version of the NuGet
                      packages.
--keep-minor          Allows only updates that are not changing the minor version of the NuGet
                      packages.
--keep-patch          Allows only updates that are not changing the patch version of the NuGet
                      packages.
--touch-affected-refs Touches project files referencing packages which are affected, to help
                      incremental build tools detecting the change.
--verbose, -v         Enable verbose console output for the paket process.
--log-file <path>     Specify a log file for the paket process.
--silent, -s          Suppress console output for the paket process.
--version             Display the version.
--from-bootstrapper   Call comming from the '--run' feature of the bootstrapper.
--help                display this list of options.

If you add the -v flag, then Paket will run in verbose mode and show detailed information.

With --log-file [FileName] you can trace the logged information into a file.

Adding to a project

By default a package is only added to the solution, but not on any of its projects. It's possible to add the package to a specified project at the same:

1: 
$ paket add nuget PACKAGENAME [version VERSION] [project PROJECT] [--force]

See also paket remove.

Sample

Consider the following paket.dependencies file:

1: 
2: 
3: 
source https://nuget.org/api/v2

nuget FAKE

Now we run paket add nuget xunit --interactive to install the package:

alt text

This will add the package to the selected paket.references files and also to the paket.dependencies file:

1: 
2: 
3: 
4: 
source https://nuget.org/api/v2

nuget FAKE
nuget xunit
val id : x:'T -> 'T

Full name: Microsoft.FSharp.Core.Operators.id
Multiple items
val single : value:'T -> single (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.single

--------------------
type single = System.Single

Full name: Microsoft.FSharp.Core.single
val not : value:bool -> bool

Full name: Microsoft.FSharp.Core.Operators.not
val lock : lockObject:'Lock -> action:(unit -> 'T) -> 'T (requires reference type)

Full name: Microsoft.FSharp.Core.Operators.lock
val log : value:'T -> 'T (requires member Log)

Full name: Microsoft.FSharp.Core.Operators.log
type 'T list = List<'T>

Full name: Microsoft.FSharp.Collections.list<_>
Fork me on GitHub