Core · Reference

Command-line reference

This page covers the application's nocobase command. Separate tools create apps and plugins or install production releases: see Create an app, Create a plugin and Deploy with PM2.

Entry points

Run the local dependency's command from the application source root:

Bash
pnpm nocobase commands
pnpm nocobase config check --no-connect
pnpm nocobase plugin register --help

Deployment output contains its own CLI. From the deployed application root:

Bash
node dist/cli/index.js commands
node dist/cli/index.js config check --no-connect

Deployment includes runtime commands retained during the build, rather than development commands such as dev, source plugin integration or builds. For app-installer installations, use the entry under the release directory described in the deployment guide.

Command index

“Source” means the development workspace; “Both” means source and deployment runtimes. Plugins contribute additional commands, so inspect the current application's commands output.

CommandEnvironmentPurpose and common options
dev / build / startSourceDevelop, build and start build output; flags are handled by each command
info / commandsBothInspect app information / command tree; commands --json reports arguments and execution capabilities
config initBothInitialize local configuration; --dialect, --config; does not install database drivers
config setBothWrite key=value; --from-env reads values from environment variables
config checkBothCheck configuration; --no-connect for offline checks; --strict treats warnings as failures
config env / config variablesBothList environment mappings / deployment metadata; variables --out writes the manifest
db applyBothApply pending migrations and seeds; supports --dry-run
db rollback / db redoBothRoll back the latest migration batch / roll back and reapply; changes the database
db resetBothReset managed tables; deletes data
db repairBothRepair migration checksums; not a substitute for schema migrations
db unlockBothHandle a stale migration lock; first confirm no migration process is active
db sampleDevelopment onlyLoad sample data; deployment execution is refused even if listed in its catalog
collections generateBothGenerate Collection artifacts; --check compares without writing
collections doctorBothDiagnose Collection/database differences; --fix applies changes
locales checkBothCheck locale resources
secrets status / secrets rotateBothInspect / rotate encrypted data; rotate --dry-run previews, --batch-size controls batches
plugin inspectSourceInspect plugin entries and integration information
plugin registerSourceInstall or register a plugin; preview with --dry-run
plugin unregisterSourceUnregister a plugin; does not remove its business data
plugin updateSourceUpgrade a named plugin, or all registered plugins when omitted, then synchronize Skills
package removeSourceRemove a dependency and related integration; supports --dry-run
skills syncSourceSynchronize dependency Skills; supports package/plugin selectors and --dry-run
dist check / dist retargetSourceCheck / retarget deployment output
cli build / cli linkSourceBuild a distributable business CLI / install local command links

Development and builds

Default application scripts provide common shortcuts:

Bash
pnpm dev
pnpm test
pnpm lint
pnpm typecheck
pnpm build
pnpm start

Your application's package.json determines its scripts. Build a target-specific deployment archive with:

Bash
pnpm build --target linux-x64 --node-version 24 --tar

--target selects a platform such as linux-x64 or linux-arm64-musl; match the actual server. --node-version selects the target Node major. --tar writes storage/exports/dist.tar.gz. Native database dependencies cannot simply be copied between operating systems.

Configuration commands

Bash
pnpm nocobase config init --dialect sqlite
pnpm nocobase config set server.port=13000 client.app.title="My App"
pnpm nocobase config env
pnpm nocobase config variables --json
pnpm nocobase config check --no-connect --strict

config init normally preserves an existing configuration; replacement requires explicit --force. config set accepts dotted paths and YAML scalars; edit the file directly for complex objects and arrays. Unknown sections are rejected, and environment overrides affect effective values.

config check attempts non-SQLite connections by default. --no-connect checks configuration only; --connect also checks SQLite. Connection checks do not apply migrations. See the Configuration reference for fields and secret input.

Database commands

Commands supporting connection selection accept --connection <name> or mutually exclusive --all. Omitting both selects the default connection. These are not universal command options.

Inspect the plan before applying migrations:

Bash
pnpm nocobase db apply --connection main --dry-run
pnpm nocobase db apply --connection main

Consult each command's --help for preview and confirmation options on rollback, redo, reset and repair. --force explicitly confirms an operation; it is not a routine remedy for failures. Investigate changed checksums in applied migrations first, and consider repair only when edits do not change deployed schema semantics. See Database migrations.

Plugins and Skills

In an app with packages/app-plugin-announcements/ already created, preview registration changes:

Bash
pnpm nocobase plugin register @nocobase/app-plugin-announcements --dry-run
pnpm nocobase skills sync --dry-run

The plugin's package.json determines its name. Use options such as --no-install or --no-skills only on commands that support them. Inspect the resulting Client, Server and CLI registration files to establish which runtime entries were integrated. See Manage plugins.

Synchronized guidance in .agents/skills/ can be regenerated. Maintain a plugin's distributed Skill in its source skills/ directory.

Application and plugin business commands

An application file at cli/commands/orders/sync.ts corresponds to:

Bash
pnpm nocobase app orders sync --help

Plugins declare commands through their CLI entries. The namespace normally strips the package scope and app-plugin- prefix; collisions fail. A deployment invokes packaged business commands rather than scanning newly added source files.

See Write application commands for authoring and verification, Integrate plugin commands for application registration, and Extend the CLI for plugin implementation.

cli link enables local development of a standalone client; cli build packages it for remote business calls. It uses a running application’s HTTP APIs. See Provide an application CLI client for integration.

JSON and automation

Bash
pnpm nocobase commands --json
pnpm nocobase config check --no-connect --json

The main success-envelope fields are shown below; each command defines its own result:

JSON
{
  "schemaVersion": 1,
  "ok": true,
  "command": "config check",
  "status": "success",
  "result": {},
  "warnings": []
}

This illustrates envelope fields rather than a complete configuration-check result. Automation should inspect the exit code, ok and status, then read result. Failures normally exit nonzero. success-noop means no change was needed; partial-success means work remains, so inspect warnings and reported issues. commands --json reports JSON, dry-run and force capabilities. Passthrough commands such as dev, build and start do not uniformly support JSON. NOCOBASE_CONTENT_TYPE=json likewise applies only where supported.

Verification scope

Checked on 2026-10-27 with default template beta.83, @nocobase/app-cli 1.0.0-beta.29, Node 24.21.0 and pnpm 11.7.0: source/deployment command catalogs, offline configuration validation, variable metadata, option help and registration preview for the local announcements plugin. Stateful operations such as resets, rollbacks and key rotation were not executed for this page. See the app-cli source.

NocoBase docs assistant

Ask anything about NocoBase…

Each question is answered independently, without earlier questions or answers. Include all relevant context.