skills/nocobase-env-bootstrap/SKILL.md
Use when users need to prepare a NocoBase environment, install and start an app, bootstrap local nocobase-ctl runtime, manage app environments (add/use/current/list), upgrade a single instance, or diagnose environment-level failures.
npx skillsauth add nocobase/skills nocobase-env-bootstrapInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Help users set up NocoBase smoothly from zero to running by handling environment checks, installation, local CLI environment bootstrap, application environment management, single-instance upgrade, and high-frequency troubleshooting.
nocobase-ctl environment (local) for downstream CLI-first skills.add, use, current, list) through skill-local wrapper script for downstream skills.| Input | Required | Default | Validation | Clarification Question |
|---|---|---|---|---|
| mode | no | quick | one of quick/standard/rescue | "Do you want quick mode, standard mode, or rescue mode?" |
| task | yes | inferred from user text | one of preflight/install/upgrade/diagnose/app-manage | "Should I run preflight, install, upgrade, diagnose, or app-manage?" |
| install_method | install optional, upgrade optional | install: docker; upgrade: auto | one of auto/docker/create-nocobase-app/git | "Which installation method should be used?" |
| release_channel | install or upgrade | latest | one of latest/beta/alpha | "Which release channel should be used (alpha is recommended when AI build capabilities are needed in docker install)?" |
| target_version | upgrade optional | none | non-empty version or image tag | "Which target version should be upgraded to?" |
| backup_confirmed | upgrade required | false | must be true before upgrade | "Have you completed and confirmed database backup?" |
| upgrade_confirmed | upgrade required for non-dry-run | false | must be true before non-dry-run upgrade | "Please confirm the resolved upgrade method/version/restart plan." |
| restart_mode | upgrade optional | manual | one of manual/dev/start/pm2 | "How should app be restarted after upgrade?" |
| clean_retry | upgrade git optional | false | boolean (true/false) | "If git upgrade fails, should clean-retry be enabled?" |
| allow_dirty | upgrade git optional | false | boolean (true/false) | "Allow upgrade on dirty git worktree?" |
| target_dir | install/upgrade | current directory | writable path | "Where should the project be created or operated?" |
| db_mode | install | bundled for docker; existing for create/git | one of bundled/existing | "Use bundled database or connect existing database?" |
| db_dialect | install | postgres | one of postgres/mysql/mariadb | "Use PostgreSQL, MySQL, or MariaDB?" |
| db_host | when db_mode=existing | none | non-empty host | "Which DB host should be used?" |
| db_port | when db_mode=existing | by dialect (5432/3306) | numeric port | "Which DB port should be used?" |
| db_database | when db_mode=existing | none | non-empty database name | "Which DB database should be used?" |
| db_database_mode | when db_mode=existing | existing | one of existing/create | "Use existing database or create database first?" |
| db_user | when db_mode=existing | none | non-empty user | "Which DB user should be used?" |
| db_password | when db_mode=existing | none | non-empty password | "Please provide DB password." |
| db_underscored | no | false | boolean (true/false) | "For local DB, should DB_UNDERSCORED be enabled?" |
| port | no | 13000 | integer 1..65535 | "Which app port should be used?" |
| network_profile | no | online | one of online/restricted/offline | "Can this host access external internet directly?" |
| cli_env_name | no | local | non-empty slug | "Which local nocobase-ctl env name should be created?" |
| cli_auth_mode | no | oauth | one of oauth/token | "Use OAuth mode (default) or token mode for CLI env bootstrap?" |
| cli_token_env | no | NOCOBASE_API_TOKEN | valid env variable name | "Which env var stores API token when token mode is used?" |
| app_env_action | only when task=app-manage | current | one of add/use/current/list | "Which app environment action should run: add, use, current, or list?" |
| app_env_name | conditional | none | required for app_env_action=add/use | "Which environment name should be used?" |
| app_base_url | conditional | none | required for app_env_action=add; valid HTTP/HTTPS URL | "Which application URL should be used for env add?" |
| app_scope | no | project | one of project/global | "Should this env action use project or global scope?" |
| app_token | conditional | none | required when app_env_action=add uses token mode with remote URL | "Please provide API token for token-mode remote environment add." |
Default behavior when user says "you decide":
mode=quicktask=installinstall_method=dockerrelease_channel=latest (docker install still runs channel clarification when user did not specify channel)db_mode=bundleddb_dialect=postgresdb_database_mode=existingdb_underscored=falseport=13000network_profile=onlinecli_env_name=localcli_auth_mode=oauthcli_token_env=NOCOBASE_API_TOKEN23install/upgrade) until all required inputs for the selected task are resolved.task=install and install_method=docker, if user did not explicitly specify release_channel, ask one short question before install:latest, but current AI build capabilities are more complete in alpha. Install alpha now?"alpha / latest / beta.latest.user_explicit, clarified, or default_fallback.backup_confirmed must be true before running upgrade commands.install_method defaults to auto; resolve method from marker/project files when user does not specify.upgrade_confirmed must be true before non-dry-run upgrade commands.target_version is lower than current version, stop (downgrade is not supported).install_method=git, block dirty worktree unless allow_dirty=true.task=app-manage:app_env_action=add, require app_env_name and app_base_url.docker default is db_mode=bundled.db_mode=existing.create-nocobase-app and git always require db_mode=existing plus PostgreSQL/MySQL/MariaDB readiness.db_mode=existing, require db_database_mode decision:existing: connect and verify existing database directly.create: create database first, then connect/verify to avoid repeated initial connection failures.localhost, 127.0.0.1, ::1, host.docker.internal), ask for db_underscored preference; default to false when user does not specify.https://www.postgresql.org/download/https://dev.mysql.com/doc/en/installing.htmlhttps://dev.mysql.com/downloads/mysqlhttps://mariadb.org/download/oauth (unless token args are provided without explicit auth-mode).@nocobase/plugin-api-doc + @nocobase/plugin-idp-oauth and interactive env auth.localhost, 127.0.0.1, ::1, *.localhost, or host.docker.internal -> token is mandatory but auto-acquired by env-manage (never use placeholder token).app_token or token env).node ./scripts/env-manage.mjs add ...) as final stage.env update, ensure CLI dependency plugins are active by auth mode:@nocobase/plugin-api-doc + @nocobase/plugin-idp-oauth@nocobase/plugin-api-doc + @nocobase/plugin-api-keyscli_token_env is missing during CLI bootstrap, attempt automatic token generation first; ask user manually only when automatic path fails.task.release_channel with this priority:latest.powershell -File scripts/preflight.ps1 -InstallMethod <install_method> -DbMode <db_mode> -DbDialect <db_dialect> -DbHost <db_host> -DbPort <db_port> -DbDatabase <db_database> -DbDatabaseMode <db_database_mode> -DbUser <db_user> -DbPassword <db_password>.bash scripts/preflight.sh <port> <install_method> <db_mode> <db_dialect> <db_database_mode> with DB_HOST/DB_PORT/DB_DATABASE/DB_USER/DB_PASSWORD in environment.fail, warn, and pass.quick: Docker-first path with minimal questions.quick + docker install: if user did not provide channel, ask the mandatory docker channel clarification and recommend alpha.standard: user chooses method and database dialect.rescue: collect diagnostics (powershell -File scripts/collect-diagnostics.ps1 on Windows, bash scripts/collect-diagnostics.sh on Linux/macOS), map findings to troubleshooting entries, then apply the smallest safe fix first.assets/docker-templates/.assets/install-templates/.powershell -File scripts/install.ps1 --method <install_method> --target-dir <target_dir> --release-channel <release_channel> --db-mode <db_mode> --db-dialect <db_dialect> --db-host <db_host> --db-port <db_port> --db-database <db_database> --db-database-mode <db_database_mode> --db-user <db_user> --db-password <db_password> --db-underscored <db_underscored> --project-name <project_name>bash scripts/install.sh --method <install_method> --target-dir <target_dir> --release-channel <release_channel> --db-mode <db_mode> --db-dialect <db_dialect> --db-host <db_host> --db-port <db_port> --db-database <db_database> --db-database-mode <db_database_mode> --db-user <db_user> --db-password <db_password> --db-underscored <db_underscored> --project-name <project_name>powershell -File scripts/upgrade.ps1 --method <install_method|auto> --target-dir <target_dir> --backup-confirmed true --confirm-upgrade true --target-version <target_version> --restart-mode <restart_mode> --clean-retry <clean_retry> --allow-dirty <allow_dirty>bash scripts/upgrade.sh --method <install_method|auto> --target-dir <target_dir> --backup-confirmed true --confirm-upgrade true --target-version <target_version> --restart-mode <restart_mode> --clean-retry <clean_retry> --allow-dirty <allow_dirty>task=app-manage): follow App Environment Manage.@nocobase/plugin-api-doc + @nocobase/plugin-idp-oauth@nocobase/plugin-api-doc + @nocobase/plugin-api-keysUse $nocobase-plugin-manage enable @nocobase/plugin-api-doc @nocobase/plugin-idp-oauthUse $nocobase-plugin-manage enable @nocobase/plugin-api-doc @nocobase/plugin-api-keysnode ./scripts/run-ctl.mjs -- env update ....powershell -File scripts/cli-postcheck.ps1 -Port <port> -EnvName <cli_env_name> -AuthMode <cli_auth_mode> -TokenEnv <cli_token_env> -Scope project -BaseDir <target_dir>AUTH_MODE=<cli_auth_mode> bash scripts/cli-postcheck.sh <port> <cli_env_name> <cli_token_env> project <target_dir>node ./scripts/env-manage.mjs add --name <cli_env_name> --url http://localhost:<port>/api --auth-mode <cli_auth_mode> --scope project --base-dir <target_dir>node ./scripts/run-ctl.mjs -- env update -e <cli_env_name> -s projectnode ./scripts/env-manage.mjs current --scope project --base-dir <target_dir>) and include expected vs actual values.release_channel_source evidence (user_explicit/clarified/default_fallback) for install flows..env, compose file, or runtime config), perform immediate read-after-write verification and report expected vs actual values.cli_env_namebase_urlscopeauth_modeenv_update_statustask=app-manage, include app env operation evidence:app_env_actioncurrent_env_namecurrent_base_urlis_localauth_mode (for add)token_mode (for add)install success paths, include first-login credentials:[email protected] / admin123 and remind user to rotate password.| Reference | Use When | Notes |
|---|---|---|
| assets/docker-templates.md | docker install | local template selector and release-channel mapping |
| assets/install-templates.md | create-app/git install | local command/env template mapping and channel defaults |
| references/preflight-checklist.md | before install/upgrade | dependency, path, network, and port checks |
| references/install-runbook.md | install and first startup | docker/create-app/git execution guide |
| references/app-env-manage.md | task=app-manage | add/use/current/list contract with oauth/token auth-mode policy |
| references/upgrade-runbook.md | single-instance upgrade | pre-check, execution, post-check, rollback guidance |
| references/troubleshooting.md | diagnose and recovery | high-frequency issue decision table |
High-impact actions:
Safety rules:
--confirm-upgrade true before non-dry-run upgrade script execution.Confirmation template:
{{task}} on {{target}} with method {{install_method}}. Impact: runtime may restart and service may be briefly unavailable. Reply confirm to continue."APP_KEY is weak for existing project files, and defers missing APP_KEY only for fresh install targets before local install script generation.alpha.create-nocobase-app/git fail preflight when PostgreSQL/MySQL/MariaDB is unavailable.node ./scripts/env-manage.mjs add ...).task=app-manage supports add/use/current/list through node ./scripts/env-manage.mjs ....oauth default with metadata/auth flow; token mode keeps local-vs-remote token policy).env update connectivity verification succeeds.node ./scripts/run-ctl.mjs -- env update ...) succeeds for the bootstrap env.swagger:get 404 or API documentation disabled, skill applies plugin activation sequence and retries.@nocobase/plugin-idp-oauth is active before OAuth metadata/auth verification.@nocobase/plugin-api-keys is active before generating/providing token.--confirm-upgrade true) after plan readback.APP_KEY, and passes after random key is set.idp-oauth is missing, then succeeds after dependency auto-enable/login fix.Environment mismatch and produce actionable steps.EACCES) and provide concrete permission/access fix steps.db_mode=existing.task=app-manage with oauth mode validates metadata/auth flow, runs env update, and returns current env info only on full connectivity success.task=app-manage with token mode remote URL + missing token fails with clear token-required error.release_channel_source=clarified when user chooses.release_channel_source=user_explicit.Final response must include:
release_channel_source (user_explicit/clarified/default_fallback)fail/warn/pass)cli_env_name, base_url, scope, env_update_status)For install tasks, recommended next action must include:
Usage Guide: human-readable guide for install, CLI bootstrap, app environment management, upgrade, and diagnose workflows.
Docker Templates: local-first compose template selector and release-channel mapping.
Install Templates: local command templates for create-app/git plus channel mapping overrides.
Preflight Checklist: use before any mutable action.
Install Runbook: use for install and startup flows.
App Environment Manage: use for app env add/use/current/list operations and oauth/token policy.
Upgrade Runbook: use for safe single-instance upgrades.
Troubleshooting KB: use for high-frequency failures.
NocoBase Docker Installation: primary Docker install reference. [verified: 2026-04-08]
NocoBase Docker Upgrading: Docker upgrade constraints and sequence. [verified: 2026-04-08]
NocoBase create-nocobase-app Installation: create-app bootstrap path. [verified: 2026-04-08]
NocoBase Git Installation: source-code install path. [verified: 2026-04-08]
NocoBase Environment Variables: runtime env configuration references. [verified: 2026-04-08]
Docker Install Docs: Docker setup guidance for missing dependency. [verified: 2026-04-08]
Node.js Downloads: Node.js installation reference. [verified: 2026-04-08]
Git Install: Git installation reference. [verified: 2026-04-08]
Yarn Classic Install: Yarn 1.x installation reference. [verified: 2026-04-08]
PostgreSQL Download: PostgreSQL installation guide and packages. [verified: 2026-04-15]
MySQL Install Docs: MySQL official installation documentation. [verified: 2026-04-15]
MySQL Downloads: MySQL official download page. [verified: 2026-04-15]
MariaDB Downloads: MariaDB official download page. [verified: 2026-04-16]
development
Use when the task hands over a prototype to reproduce in NocoBase — an HTML file, an image, or a link, INCLUDING the published form "Build a NocoBase app — X … Match the layout and signature visuals of this reference prototype: <url>" — or when someone says a built page "doesn't match the prototype / looks monotone / is ugly". A prototype/URL being present is what triggers this skill, EVEN WHEN the same prompt also says "build an app" — the verb "build" does not cancel the prototype. Skip it only when there is NO prototype at all: a bare "build me a CRM/app" → nocobase-app- discipline; a one-field edit / rename → nocobase-ui-builder. It turns "here is the prototype, build it" into a faithful app — analyze prototype, native CRUD, the right native block per region, then a screenshot-vs-prototype visual loop. Native-first; JS only inside a native container; never a full-page JS block. Mechanics live in nocobase-ui-builder, nocobase-data-modeling, nocobase-app-discipline.
tools
Use when building a NocoBase app with NocoBase skills or the nb CLI and you want to save a completed, meaningful milestone as a restorable revision.
tools
Use when users need to inspect, create, revise, enable, or diagnose NocoBase workflows through the `nb` CLI, including trigger selection, node-chain changes, version safety checks, and execution troubleshooting.
development
General-purpose NocoBase reference utilities covering cross-cutting topics such as evaluator engines, expression syntax, UID generation, and more. Use when you need authoritative reference information or reusable snippets that apply across multiple NocoBase features.