nb portal

nb portal は Portal ワークスペースを管理します。Portal は独自のフロントエンドソース、入口パス、デプロイ結果を持つことができ、このコマンドグループは NocoBase の Portal レコードとローカルワークスペース、source storage をつなぎます。

一般的な流れは、ローカルワークスペースを作成し、開発モードを起動し、ソース変更を source storage に push してから build と deploy を行うことです。既存 Portal を引き継ぐ場合は、まず pull します。

使い方

nb portal <command>

サブコマンド

コマンド説明
nb portal configローカル Portal ワークスペースのソース設定を更新し、可能な場合はリモート Portal レコードへ同期します
nb portal createテンプレートからローカル Portal ワークスペースを作成し、Portal レコードを作成または更新します
nb portal deploy指定した Portal ワークスペースをビルドしてデプロイします
nb portal destroyPortal レコードとローカルワークスペースを削除します
nb portal dev指定した Portal ワークスペースの開発モードを起動します
nb portal info指定した Portal レコードとローカルワークスペースの詳細を表示します
nb portal listPortal レコードとローカルワークスペースの同期状態を一覧表示します
nb portal pullsource storage から Portal ソースをローカルワークスペースへ取得します
nb portal pushローカルの Portal ソース変更を source storage に push します

典型的な流れ

customer という Portal を作成する:

nb portal create customer -e dev --yes

ローカル開発モードを起動する:

nb portal dev customer -e dev --yes

ローカルワークスペースとリモートレコードを確認する:

nb portal info customer -e dev --yes
nb portal list -e dev --yes

ソースを push してデプロイする:

nb portal push customer -e dev --yes --message "Update customer portal"
nb portal deploy customer -e dev --yes

既存 Portal を引き継ぐ:

nb portal list -e dev --yes
nb portal pull customer -e dev --yes
nb portal dev customer -e dev --yes

source storage を切り替える:

nb portal config customer -e dev --yes --source-storage git --git-repo git@github.com:nocobase/customer-portal.git
nb portal push customer -e dev --yes --message "Move customer portal source to Git"

source storage

Portal 作成時に、ソースコードの管理場所を選択できます:

モード説明
nocobaseDefault mode. Source code is managed by NocoBase source storage.
gitSource code is stored in a Git repository, configured with --git-repo, --git-branch, and --git-path.

For quick creation and development, the default nocobase storage is usually enough. Use git when the Portal source should be reviewed, versioned, or built through an existing team workflow.

Source configuration is written to portal.config.json in the local workspace. create, pull, and config maintain this file; push and deploy read it to sync source or deployment output.

Env Types

nb portal currently supports local, docker, and http envs:

モード説明
localThe workspace and app storage are on the current machine. With default nocobase storage, pull/push usually do not need extra sync.
dockerThe workspace is shared with the app through a Docker volume. With default nocobase storage, pull/push usually do not need extra sync.
httpSource and deployment output are synced through APIs. pull downloads a source archive, and push uploads one.

ssh envs do not support Portal management in the current version.

Local Workspace Path

Portals are stored under the selected env storage:

<storagePath>/portals/<app>/<portal>

The main app access path is usually:

<appPublicPath>/x/<portal>/

A sub-app access path is usually:

<appPublicPath>/x/apps/<app>/<portal>/

Env Confirmation

Most nb portal subcommands support --env and --yes:

パラメーター説明
--env, -eCLI env name. If omitted, the current env is used.
--yes, -ySkip cross-env confirmation when an explicit --env targets a different env from the current env.

In scripts or AI agent workflows, pass --env and --yes explicitly to avoid stopping at an interactive confirmation.

関連コマンド