nmbl Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage
Edit page

offlineprep - Offline Preparation

Overview

The offlineprep command prepares a development environment for offline work by running two phases in sequence:

  1. Git Update — delegates to nmbl gitupdate to pull all repositories under the root path. Can be skipped with --skip-git.
  2. Local NuGet Source — detects an existing local NuGet source or creates the target directory and prints the dotnet nuget add source command needed to register it.

Syntax

nmbl offlineprep [path] [options]

Arguments

  • path - Root directory to scan for git repositories. Defaults to the current directory.

Options

  • --skip-git - Skip the git repository update phase and go directly to the NuGet source setup.
  • --local-nuget-directory-path <path> - Override the default local NuGet directory location.

Output

Prints a header rule, progress messages for each phase, and a final Summary section listing what was accomplished along with any warnings or errors.

Exit Codes

  • 0 - All phases completed without errors.
  • 1 - Any phase produced an error, or the root path does not exist.

Examples

Prepare everything from the current directory

nmbl offlineprep

Updates all git repositories found in the current directory tree and configures a local NuGet source.

Prepare a specific workspace

nmbl offlineprep ~/workspace

Skip git updates (NuGet setup only)

nmbl offlineprep --skip-git

Useful when repositories are already up to date.

Specify a custom local NuGet directory

nmbl offlineprep --local-nuget-directory-path /external-drive/nuget-packages

Directs the local NuGet source to a custom path, for example on an external drive.

Combined: custom path and skip git

nmbl offlineprep ~/projects --skip-git --local-nuget-directory-path /mnt/usb/nuget

How local NuGet source setup works

The command checks for an existing local NuGet source in your NuGet configuration:

  • If a local source is found — reports its name and path; no further action is taken.
  • If no local source is found — creates the target directory (if it does not exist) and prints the dotnet nuget add source command you need to run to register it.

After running that command, configure your projects to use the local source when offline:

dotnet nuget add source "/path/to/local/nuget" --name "nmbl-offline"

You can then enable or disable the source as needed:

dotnet nuget enable source nmbl-offline
dotnet nuget disable source nuget.org

Use Cases

Before travel

# The day before a long trip
nmbl offlineprep ~/workspace

Secure or air-gapped environments

# On an internet-connected machine
nmbl offlineprep ~/projects --local-nuget-directory-path /usb/nuget-cache

# Transfer the USB to the air-gapped machine and register the source there
dotnet nuget add source "/usb/nuget-cache" --name "offline"

Weekly maintenance

# Every Monday morning while online
nmbl offlineprep ~/workspace