NocoBase CLI
Description
NocoBase CLI (nb) is the command-line entry point for NocoBase, used to initialize, connect to, and manage NocoBase applications in a local workspace.
It supports two common initialization paths:
- Connect to an existing NocoBase application and save it as a CLI env
- Install a new NocoBase application via Docker, npm, or Git, then save it as a CLI env
When creating a new local application, nb init can also install or update NocoBase AI coding skills. To skip this step, use --skip-skills.
Usage
The root command itself is mainly used to display help and dispatch invocations to command groups or standalone commands.
Command groups (Topics)
The following command groups are shown in nb --help:
Commands
Standalone commands currently exposed directly by the root command:
Viewing help
View help for the root command:
View help for a command or command group:
Examples
Interactive initialization:
Initialize using a browser form:
Create a Docker application non-interactively:
Connect to an existing application:
Resync env status after starting the application:
Call an API:
View CLI default configuration:
View commercial license status:
Create and download a backup:
Restore a local backup:
Environment variables
The following environment variables affect CLI behavior:
Example:
Configuration files
Default configuration file:
After setting NB_CLI_ROOT=/your/workspace, the configuration file path becomes:
The CLI is also compatible with reading legacy project configuration in the current working directory.
The session-level cache for the current env is stored in:
The globally last-used env is stored in the lastEnv field of config.json. When NB_SESSION_ID is not set, the CLI falls back to this global value.
The runtime command cache is stored in:
This file is generated or refreshed by nb env update and is used to cache runtime commands synchronized from the target application.

