AI Workbench Command Line Interface (CLI) Reference#
Overview#
- Run
nvwb <command> --helpfor the full syntax and flags of any command. The built-in help is the authoritative reference for command syntax, required arguments and available options. This page covers what
--helpcannot: how commands are organized, behavioral notes, output formats and internal commands.- The CLI provides the same capabilities as the Desktop App.
You can manage locations, projects, environments, applications and git operations from a terminal. See Using the CLI for how-to guides on interactive use, scripting and agent integration.
- The
nvwbcommand is a shell wrapper around thenvwb-clibinary. The binary lives at
~/.nvwb/bin/nvwb-cli. The wrapper is a bash function defined in~/.local/share/nvwb/nvwb-wrapper.shand sourced into your shell through.bashrc. It handles four session-state commands (activate,deactivate,open,close) byeval-ing the binary’s output to set environment variables in your live shell. All other commands pass straight through to the binary.
Scripts and agents should call the binary directly.
The shell wrapper is only available in interactive shells that have sourced .bashrc.
Call ~/.nvwb/bin/nvwb-cli directly in scripts and agent tools.
See Using the CLI Binary for Scripts and Agents for the full calling convention.
Command Index#
- Use
nvwb <command> --helpfor full syntax and options. The tables below organize every command by category.
Context Management#
Command |
Description |
|---|---|
Activate a context (location) for the current shell session. Starts the AI Workbench service if not running. |
|
Deactivate the current context. Optionally shut down the service with |
Project Workflow#
Command |
Description |
|---|---|
Open a project in the current shell session. Accepts a project name, absolute path, or |
|
Close the currently open project. Use |
|
Show project state: build state, run state, applications, git info and warnings. |
|
Build the project container. Use |
|
Start an application (and the container if not running). Use |
|
Stop an application. Use |
|
Open an interactive shell in the running project container. Use |
Git Operations#
Command |
Description |
|---|---|
Clone a git repository and manage it as an AI Workbench project. |
|
Publish a project to a remote git server for the first time. |
|
Pull latest commits from the remote. Use |
|
Push local commits to the remote repository. |
|
Fetch changes from the remote without merging. |
|
Stage all changes and create a commit. Use |
|
List commit history. Use |
|
Discard uncommitted and untracked changes. Optionally specify individual files. |
|
Merge commits from a branch into the current branch. Supports |
|
Switch to a different git branch. |
|
Create and switch to a new branch. Use |
|
Delete a local branch. Use |
|
List all git branches in the project repository. |
Compose (Docker / Podman)#
Compose commands require Docker.
The compose commands are only supported if you are using Docker, not Podman, as your container runtime.
Command |
Description |
|---|---|
Start compose services. Use |
|
Stop compose services. |
|
Show status of compose services. |
|
Show combined log output from compose services. |
Listing Resources#
Command |
Description |
|---|---|
List all projects in the current or specified context. |
|
List configured contexts and their running status. |
|
List available base environments from NGC. Use |
|
List configured third-party integrations. |
|
List mounts defined for the current project. |
|
List host resources (GPUs, shared memory) requested by the project. |
|
List environment variables for the current project. |
|
List applications defined in the current project. |
|
List all supported built-in application types. |
|
List packages per package manager. Use |
|
List secret variables for the current project. |
|
List all git branches in the project repository. |
|
List all Brev compute instances. |
|
List all Brev organizations. |
Creating Resources#
Command |
Description |
|---|---|
Create a new project. Requires |
|
Create a new context (location). Use |
|
Add a third-party integration. Interactive only via CLI. |
|
Define a new mount. Types: |
|
Create an environment variable. Pass |
|
Create a secret variable. Use |
|
Add an application to the project. Use a built-in type or |
|
Create a shareable URL for a running web app. Valid for 48 hours. |
|
Create and switch to a new branch. |
Updating Resources#
Command |
Description |
|---|---|
Update an existing integration. Interactive only via CLI. |
|
Update GPU and shared memory allocations for the project. |
|
Update settings for an existing context. Context must not be running. |
|
Update the project’s base environment to the latest available tag. |
|
Update the value of an existing environment variable. Pass |
|
Open a build script in an editor (deprecated; use |
Deleting Resources#
Command |
Description |
|---|---|
Delete a project locally. Does not remove the remote git repository. |
|
Delete a context configuration. |
|
Remove a configured integration. |
|
Remove a mount definition. Volume data is deleted with the mount. |
|
Delete an environment variable. |
|
Delete a secret variable. |
|
Delete an application from the project. |
|
Delete a local git branch. |
Configuring Resources#
Command |
Description |
|---|---|
Map host directories to mount targets for the current context. |
|
Set values for existing secret variables. |
|
Set the active Brev organization. |
Package Management#
Command |
Description |
|---|---|
Add packages to the project. Installs immediately if the container is running. |
|
Remove packages from the project. |
Editing Files#
Command |
Description |
|---|---|
Open a build script ( |
|
Open a project file for editing. Use |
Validation#
Command |
Description |
|---|---|
Validate the project spec file ( |
Integrations#
Command |
Description |
|---|---|
Authorize AI Workbench to call an integration on your behalf. Supports OAuth2, token, or stdin. |
|
Revoke authorization for an integration. |
Installation#
Support and Diagnostics#
Command |
Description |
|---|---|
Print CLI and service version information. |
|
Create a zip archive of logs, configs and version info for debugging. |
Shell Completion#
Command |
Description |
|---|---|
Generate shell autocompletion scripts for bash, zsh, fish or powershell. |
Global Options#
These options are available on every command.
Option |
Description |
Type |
Default |
|---|---|---|---|
|
Override the active context for this command. The context must already be running (this flag does not start the service). Required for scripting when you have not run |
String |
— |
|
Override the open project for this command. Must be an absolute path. Always use the path, not the project name, for scripting (see Use the Project Path, Not the Name). |
String |
— |
|
Output format. |
String |
|
|
Enable debug logging. |
— |
— |
|
Path to the AI Workbench internal data directory. |
String |
|
Output Formats#
- The CLI does not change its output format when piped.
TTY and non-TTY output are identical — same table format and styling regardless. Use
-o jsonfor any command whose output you want to parse.
JSON responses follow one of four shapes.
{"result": [...]}— List and query commands. Access items with.result[]injq.
{"result": {...}}— Singular commands likestatus. Access fields with.result.FieldName.
{"messages": [...]}—create projectandclone projecton success. The project path is embedded in the message string, not a dedicated field.
{"error": "...", "detail": "..."}— All failures, all commands. Exit code 1.
- Exit codes are meaningful.
Exit code 0 means success. Exit code 1 means error.
-o jsonl is not streaming.
-o jsonl outputs a single minified line containing all records.
It is not one-record-per-line streaming.
Behavioral Notes#
This section covers behaviors that --help does not explain.
Use the Project Path, Not the Name#
- The registered project name comes from
spec.yamlinside the repository, not from the directory name. Cloning a project into
--projectPath .../my-dirmay register it under a completely different name. Always use absolute paths with-pfor scripting. The name is for display; the path is stable and unambiguous.
Project State Machine#
- Many commands fail if the project is in the wrong state.
Check
status -o jsonbefore running commands that have preconditions.
Build states (result.Environment.BuildState):
NO_BUILD— Build has never run or was reset.
BUILDING— Build is in progress.
BUILD_COMPLETE— Built and the project container is available.
BUILD_ERROR— Last build failed.
Run states (result.Environment.RunState):
CONTAINER_NOT_CREATED— The project container does not exist.
RUNNING— The project container is running.
STOPPED— The project container exists but is stopped.
Preconditions by operation:
Operation |
Required State |
|---|---|
|
Any build state (re-runs if already built) |
|
Build state must be |
|
Run state must be |
|
Run state must be |
|
Run state must be |
Useful Status Fields#
The status -o json command returns detailed project information.
result.Path Absolute path (use with -p) result.Name Registered name (from spec.yaml) result.Environment.BuildState See build states above result.Environment.RunState See run states above result.ContainerName Container runtime name result.Applications[].name Application name for start/stop result.Applications[].info.runState NOT_RUNNING or RUNNING result.Applications[].info.url null when stopped, URL when running result.RepoState.CommitsAhead Integer result.RepoState.CommitsBehind Integer result.CurrentGitBranch.Name Current branch name result.Resources.GPUsRequested Integer
Session State Commands#
- The
activate,deactivate,openandclosecommands manage shell session state. They use
evalto set environment variables in your live shell session. After youactivatea context,(nvwb:<context>)appears in your prompt and all subsequent commands target that context. After youopena project, commands likebuildandstarttarget that project.- These commands are only meaningful in an interactive terminal.
In scripts and agent tools, each command runs in its own process with no shared session. Use
-cand-pinstead. See Using the CLI Binary for Scripts and Agents for the scripting calling convention.
Stdin Value Ingestion#
Some commands accept - as a value to read from stdin.
create environment-variable <name> -— reads the value from stdin
update environment-variable <name> -— reads the value from stdin
connect integration <name> -— reads the token from stdin# Set a secret from a vault or environment variable echo "$SECRET_VALUE" | nvwb create environment-variable API_KEY - --is-sensitive
Compose Notes#
- Compose commands require Docker as the container runtime.
They are not supported with Podman.
- Compose file search order (relative to project root):
compose.yaml,compose.yml,docker-compose.yml,docker-compose.yaml,deploy/compose.yaml,deploy/compose.yml,deploy/docker-compose.yml,deploy/docker-compose.yaml
Shell Completion#
- Generate autocompletion scripts with
nvwb completion <shell>. Supported shells:
bash,zsh,fish,powershell. All variants support--no-descriptionsto omit completion descriptions.# Bash — load for current session source <(nvwb completion bash) # Bash — load permanently (Linux) nvwb completion bash > /etc/bash_completion.d/nvwb # Zsh — load for current session source <(nvwb completion zsh) # Fish — load permanently nvwb completion fish > ~/.config/fish/completions/nvwb.fish
Internal Commands#
- These commands are intended for power users, tooling integrations and the Desktop App GUI.
They are not shown in the main
--helpoutput. Runnvwb internal <subcommand> --helpfor syntax and options.
Build Assistant#
- The build assistant analyzes failed container builds and proposes fixes using an AI inference backend.
See How to Use the AI Workbench Build Assistant for the full how-to guide.
Command |
Description |
|---|---|
|
View or update build assistant configuration ( |
|
Start the build assistant to analyze a failed build. Streams status until |
|
Stop a running build assistant session. |
|
Show current build assistant status for the project. |
|
Check whether unacknowledged changes block |
|
Acknowledge changes made by the build assistant, clearing the build gate. |
|
List available inference models. |
Context Lifecycle#
Command |
Description |
|---|---|
|
Start the AI Workbench service and container runtime for a context if not already running. Used internally by |
|
Stop the AI Workbench service and container runtime for a context. |
|
Open and maintain SSH tunnels for a remote context. |
Container Lifecycle#
Command |
Description |
|---|---|
|
Start the project container directly (lower-level than |
|
Stop the project container directly. |
Shell and UI Helpers#
Command |
Description |
|---|---|
|
Install the shell hook that enables |
|
Interactively prompt to select a project. Used internally by |
|
Verify a credential before use. Pushes refreshed credentials to active contexts. |
System and Migration#
Command |
Description |
|---|---|
|
Assemble host-trusted CA certificates into a bundle in the AI Workbench directory. |
|
Migrate SSH keys from symlink to copy-on-create (Windows/WSL only). |
|
Migrate CLI config files from Windows to WSL. |
Reference Labels#
- The following labels are preserved for cross-reference compatibility.
They point to the relevant section in this page or to the command index above. Run
nvwb <command> --helpfor complete syntax.