
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@nocobase/ctl
Advanced tools
NocoBase CTL is a command-line tool for managing and controlling NocoBase applications. Its relationship with multiple NocoBase App instances is shown below:
+----------------------+
| NocoBase CTL |
| Controller |
+----------------------+
|
+----------------+----------------+
| | |
v v v
+----------------+ +----------------+ +----------------+
| NocoBase App | | NocoBase App | | NocoBase App |
| Dev | | Test | | Prod |
+----------------+ +----------------+ +----------------+
NocoBase CTL combines:
This allows the CLI to stay aligned with the target application instead of relying on a fixed command list.
Install NocoBase CTL globally:
npm install -g @nocobase/ctl@latest
Add an environment:
nocobase-ctl env add --name local --base-url http://localhost:13000/api
Add an environment with an API key:
nocobase-ctl env add --name local --base-url http://localhost:13000/api --token <api-key>
Authenticate an environment with OAuth:
nocobase-ctl env auth -e local
Show the current environment:
nocobase-ctl env
List configured environments:
nocobase-ctl env list
Switch the current environment:
nocobase-ctl env use local
Update the runtime command cache from swagger:get:
nocobase-ctl env update
nocobase-ctl env update -e local
Use the generic resource commands:
nocobase-ctl resource list --resource users
nocobase-ctl resource get --resource users --filter-by-tk 1
nocobase-ctl resource create --resource users --values '{"nickname":"Ada"}'
When you execute a runtime command, the CLI will:
swagger:getIf the API documentation plugin is disabled, the CLI will prompt to enable it.
Use -e, --env to temporarily select an environment:
nocobase-ctl env update -e prod
nocobase-ctl resource list --resource users -e prod
This does not change the current environment unless you explicitly run:
nocobase-ctl env use <name>
The env command supports two config scopes:
project: use ./.nocobase-ctl in the current working directoryglobal: use the global .nocobase-ctl directoryUse -s, --scope to select one explicitly:
nocobase-ctl env list -s project
nocobase-ctl env add -s global --name prod --base-url http://example.com/api --token <api-key>
nocobase-ctl env auth -e prod -s global
nocobase-ctl env use local -s project
If you do not pass --scope, the CLI uses automatic resolution:
./.nocobase-ctl existsNOCOBASE_HOME_CLICurrent built-in topics:
envresourceCheck available commands at any time:
nocobase-ctl --help
nocobase-ctl env --help
nocobase-ctl resource --help
-e, --env: temporary environment selection-s, --scope: config scope for env commands--role: role override, sent as X-Role-t, --token: API key override-j, --json-output: print raw JSON responseExample:
nocobase-ctl env update -e prod -s global
nocobase-ctl resource list --resource users -e prod -j
nocobase-ctl resource list --resource users -e prod --role admin
The CLI stores its local state in .nocobase-ctl, including:
config.json: environment definitions and current selectionversions/<version>/commands.json: cached runtime commands for a generated versionFAQs
NocoBase Command Line Tool
We found that @nocobase/ctl demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.