nb portal

nb portal gère les workspaces Portal. Un Portal peut avoir son propre code source frontend, son chemin d’entrée et son résultat de déploiement ; ce groupe relie l’enregistrement Portal dans NocoBase au workspace local et au source storage.

Le flux courant consiste à créer un workspace local, lancer le mode développement, pousser les changements vers le source storage, puis builder et déployer. Pour reprendre un Portal existant, commencez par le récupérer avec pull.

Utilisation

nb portal <command>

Sous-commandes

CommandeDescription
nb portal configUpdate portal source configuration
nb portal createCrée un workspace Portal local à partir d’un template et crée ou met à jour l’enregistrement Portal
nb portal deployConstruit et déploie le workspace Portal spécifié
nb portal destroySupprime l’enregistrement Portal et le workspace local
nb portal devDémarre le mode développement pour le workspace Portal spécifié
nb portal infoAffiche les détails de l’enregistrement Portal spécifié et du workspace local
nb portal listList portal records and development paths
nb portal pullRécupère le code source Portal depuis le source storage vers le workspace local
nb portal pushPousse les changements locaux du code source Portal vers le source storage

Flux typique

Créer un Portal nommé customer :

nb portal create customer -e dev --yes

Démarrer le mode développement local :

nb portal dev customer -e dev --yes

Inspecter le workspace local et l’enregistrement distant :

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

Pousser le code source et déployer :

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

Reprendre un Portal existant :

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

Changer le 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

Lors de la création d’un Portal, choisissez où le code source est géré :

ModeDescription
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.

nb portal config updates source storage and Git settings in the remote portal record. The development workspace path is stored separately in the CLI env config as portals.<portal>.path, maintained by create, pull --path, or config --path.

Env Types

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

ModeDescription
localThe workspace and app storage are on the current machine. pull writes source to the development path, and deploy builds from that path before syncing deployment output.
dockerThe workspace is shared with the app through a Docker volume. pull writes source to the development path, and deploy builds from that path before syncing deployment output.
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.

Development And Deployment Paths

Portal development workspaces are created under the current working directory by default:

./<portal>

Use --path with create, pull, or config to choose a different development path. Deployment output is still stored under the target app 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:

ParamètreDescription
--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.

Commandes liées