offlineprep - Offline Preparation
The offlineprep command prepares a development environment for offline work by running two phases in sequence:
- Git Update — delegates to
nmbl gitupdateto pull all repositories under the root path. Can be skipped with--skip-git. - Local NuGet Source — detects an existing local NuGet source or creates the target directory and prints the
dotnet nuget add sourcecommand needed to register it.
nmbl offlineprep [path] [options]
path- Root directory to scan for git repositories. Defaults to the current directory.
--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.
Prints a header rule, progress messages for each phase, and a final Summary section listing what was accomplished along with any warnings or errors.
0- All phases completed without errors.1- Any phase produced an error, or the root path does not exist.
nmbl offlineprep
Updates all git repositories found in the current directory tree and configures a local NuGet source.
nmbl offlineprep ~/workspace
nmbl offlineprep --skip-git
Useful when repositories are already up to date.
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.
nmbl offlineprep ~/projects --skip-git --local-nuget-directory-path /mnt/usb/nuget
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 sourcecommand 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
# The day before a long trip
nmbl offlineprep ~/workspace
# 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"
# Every Monday morning while online
nmbl offlineprep ~/workspace