Command line tools for working with Backbase CXP.
Last updated 2 years ago by backbase-admin .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install bb-cli -g
SYNC missed versions from official npm registry.

Backbase CLI tools

Npm Version Build Status

Command line tools for working with Backbase CXP.

Scaffold new components, navigate through archetypes and work with REST API helpers using clean, automated workflow.

Table of contents


npm install --global bb-cli



Each command has its own help section bb COMMAND -h, containing information about arguments, default values and examples.

Global help is also available:

bb -h


Scaffold new widgets, containers and other Backbase CXP components.

The tool generates the starting template for the chosen item in the directory where you run the command.

In order to start generating you must first install the generators you wish to use.

npm install @backbase/generator-widget @backbase/generator-widget-lp @backbase/generator-container @backbase/generator-container-template -g 

The command will search for installed packages starting with @backbase/generator-<name> and make them available. Once installed you can generate using bb generate <name> command.

bb generate widget
bb generate container
bb generate container templates

To see the list of available templates, simply run:

bb generate

Some generators (like the widget and continaer generator) may have mutliple template. You can specify the template to use as the 2nd paramter. Eg:

bb generate widget ng


bb export [OPTIONS]

Exports portal. The chunk option exports to separate xml files grouped by item type. It will also pretty print xml files and sort items and properties alphabetically on name. bb rest options for defining host, port, context, username and password also work. You can define those properties inside the .bbrc file.

  -s,  --save <string>			    portal-name.ext	 File or dir to save the export to.
  -t,  --type <string>			    model		     What to export: model(portal without content), portal, widget, container
  -n,  --name <string>					             Name of the widget or container to export.
  -C,  --item-context <string>		[BBHOST]	     Context of the widget or container that is to be exported.
       --pretty <boolean>			true		     Prettify the output.
       --sanitize <boolean>			true		     Sanitize the output.
  -k,  --chunk <boolean>			false		     Parse output and chunk it into multiple files.
  -f,  --force <boolean>			false		     Force overwrite.

Outputs prettified, sorted xml file:

bb export

Saves export to myPortal.xml:

bb export --save myPortal.xml

Chunks export to myPortal dir:

bb export --portal my-portal --save myPortal -k

Saves export, including content, to

bb export --type portal --save

Chunks full export into retail dir:

bb export --type portal --portal retail-banking --save retail -k

Chunks widget-accounts export to accounts dir:

bb export -s accounts --type widget --name widget-accounts -k


bb import [OPTIONS]

Imports portal exported by export tool. It supports importing of chunked exports.

-t,  --target <string>			       File or dir to import.

Imports portal from myPortal.xml:

bb import --target myPortal.xml

Imports a portal exported with bb export and the chunk option from the dir chunked:

bb import --target chunked

Import Collection

bb import-collection [OPTIONS]

Imports a collection of items into the portal. This tool gets information from the bower and zip for every component, then uploads it via REST API (import package) to the server.

All components should contain model.xml files. Any component without a model.xml file is ignored, unless the --auto option is set, in which case the component will be installed to the portal as a feature.

The version property is automatically added to each item.

bb rest options for defining host, port, context, username and password also work. Or you can define those properties inside a .bbrc file.


Backbase CXP v5.6 Bower

  -t,  --target <string>                  Dir where bower.json is.
  -a,  --auto <boolean>                    Auto generate model.xml when it is missing.

  -H,  --host <string>		localhost	  The host name of the server.
  -P,  --port <number>		7777		  The port of the server.
  -c,  --context <string>	portalserver  The application context of the portal.
  -u,  --username <string>	admin		  Username.
  -w,  --password <string>	admin		  Password.
  -p,  --portal <string>                  Name of the portal to target.

Imports a collection from the current directory. Every component without a model.xml file will be installed as a feature.

bower install
bb import-collection --auto

Import Item

bb import-item [OPTIONS]

Imports item to the portal. This tool zips the targeted directory, then uploads it to the server via REST API(import package).

Target directory should contain model.xml file. If --watch option is set, component will be installed to the portal as feature. Directories .git, .gitignore, bower_components and node_modules are ignored by watch process.

bb rest options for defining host, port, contaxt, username and password also work. Or you can define those properties inside .bbrc file.


Backbase CXP v5.6

  -t,  --target <string>        Current directory   Dir to import.
  -W,  --watch <boolean>                             Watch for file changes and autosubmit.
  -l,  --collection <boolean>                        Watch collection directory tree for changes.
  -i,  --init-import <boolean>                       Import whole collection on init.
  -a,  --auto <boolean>                              Auto create model.xml if doesn't exist.
  -n,  --name <boolean>                              Name of the feature to auto create before reading bower.json
  -v,  --version <boolean>                           Version of the feature to auto create before reading bower.json
       --verbose <boolean>                           Enables detailed output.

  -H,  --host <string>          localhost           The host name of the server.
  -P,  --port <number>          7777                The port of the server.
  -c,  --context <string>       portalserver        The application context of the portal.
  -u,  --username <string>      admin               Username.
  -w,  --password <string>      admin               Password.
  -p,  --portal <string>                            Name of the portal to target.

Imports current directory as item to the portal. Then it watches for file changes and re-imports whenever a file is changed.

bb import-item --watch

Theme Build

Builds a theme. Requires a bower.json file in the directory with a "main" array pointing to the base and core less files

bb theme-build
-short, --name                 default      description

-t,  --target <string>                 .            Path to directory to build.
-e,  --edition <string>                             Pass edition var to less.
-b,  --base-path <string>                           Pass base-path var to less.
-s   --sourcemaps                                   Whether to generate source maps.
-W   --watch                                        Watch less files and rebuild on change.
     --disable-compress                             Don't compress CSS into .min files.
     --disable-ie                                   Don't create reworked .ie files for IE8.
     --disable-assets                               Don't collect font/image assets.
-i   --import                                       Run bb import-item after building.


Syncs local XML model with remote. Run it in the component folder to sync with CXP. It parses the first *.xml file or the one defined with the --file argument. If that xml file does not exist, one is created by saving the response from the REST API call. This call is made on server catalog for the item defined by the --save parameter. If --save is undefined, it will search for the bower.json file and use the name of the package as item name (handy for LP widgets).

bb sync
-short, --name (type)          default              description

-f,  --file (string)	    first xml file		 A file to target.
-c,  --context (string)	portalserver		 Portal server context (for other options use `.bbrc`).
-s,  --save (string)	            			 Name of the server item for which the model is to be exported to a file.
-y,  --yes (boolean)	            			 Disables dialogs.
-v,  --verbose		    false   			 Prints detailed output.


Command line version of Backbase Rest API library for low-level and precise tasks.

bb rest [OPTIONS]
-short, --name <type>               default         description

-H,  --host <string>		    localhost	    The host name of the server running portal foundation.
-P,  --port <number>		    7777		    The port of the server running portal foundation.
-c,  --context <string>		    portalserver	The application context of the portal foundation.
-u,  --username <string>		admin   		Username.
-w,  --password <string>		admin	    	Password.
-p,  --portal <string>				        Name of the portal on the server to target.
-t,  --target <string>		    server		    Context target: server, portal, catalog, portalCatalog, page, container, widget, link, template, user, group, audit or cache.
-T,  --target-arg <string/json>			        Target arguments. When there are more arguments, pass JSON array.
-m,  --method <string>		    get		        HTTP method to use: get, post, put or delete.
-f,  --file <string/json>				        Path of the file to send. Or JSON string when using mosaic-xml-js.
-r,  --rights					                Targets context rights.
-g,  --tags					                    Targets context tags.
-q,  --query <json>				                Sets query string.
-x,  --empty-cache				                Shortcut to empty all server caches.
-v,  --verbose					                Prints detailed output.
-s,  --save <string>				            Saves response into file.

Ln (Symlink)

Symlinks source directory to defined target.

Use this command to symlink a clone of your widget/module working repo to the working portal.

bb ln --source /component/path --target /path/to/portalserver/static/dir/

This command also supports conventions used in Launchpad and ES. For example:

If --lp-trunk path is set, target will be:

{lp path}/launchpad-bundles/static/launchpad/{bundle}/widgets/{package name}

If --lp-portal path is set, target will be:

{cxp portal path}/src/main/webapp/static/launchpad/{bundle}/widgets/{package name}

Following the LP convention, if the package name starts with widget- it will be stripped out when creating a symlink.

If --portal path is set, target will be:

{cxp portal path}/src/main/webapp/static/widgets/{package name}

where package_name will be the name of the package read from bower.json or package.json.

-short, --name <type>          default               description

    -s, --source <string>      current directory     Path to source directory.
    -t, --target <string>                            Path to directory in which to (un)link a source.
        --lp-trunk <string>                          Path to `launchpad-trunk`.
        --lp-portal <string>                         Path to portalserver containing lp.
        --portal <string>                            Path to portalserver.
    -f, --force                                      Force removal of the target.
    -u, --unlink                                     Remove symlink.


Wraps a bower install and applies additional options like RequireJS conf generation and server catalog update.


-short, --name <type>               default             description

     C, --catalog <boolean>		    false			    Upload single component to CXP via REST after install.
    -A, --catalog-all <boolean>	    false			    Upload all installed components to CXP via REST after install.
    -n, --nested <boolean>		    false			    Run secondary `bb install` in installed component.
    -v, --verbose <boolean>		    false			    Enable verbose logging mode.
        --base-url <string>		    path/to/bower_comp	Web path to bower components directory (also configurable from .bbrc).
        --require-confs <string>				        Coma seperated list of relative paths to existing require configuration (also configurable from .bbrc).

Available options in .bbrc:

  "install": {
    "excludes": ["jquery"],
    "includes" ["jquery"],
    "requirejsConfigs": ["./portal/target/portal/static/launchpad/modules/config/requirejs.conf.js"],
    "requirejsBaseUrl": "bower_components"
bb install [OPTIONS]
bb install <bower-endpoint> [<bower-endpoint> ..] [OPTIONS]

Also accepts bower install arguments such as --save, -save-dev, --production, check bower install -h.

bb install jquery --save
bb install todo-widget -C --save
  • excludes - define paths to exclude from generated RequireJS conf
  • includes - define paths to include to generated RequireJS conf, ignoring existing configurations merge
  • requirejsConfigs - list of paths to existing RequireJS confs, to automatically get excludes list
  • requirejsBaseUrl - base url for paths in RequireJS conf


All REST-based commands support a .bbrc configuration file. The .bbrc file is looked for first in the current directory, and then recursively in parent directories. The first .bbrc file encountered is used. This allows the default configuration to be overridden.

Example of .bbrc (must contain valid JSON) content:

"context": "/",
"port": "7778",
"username": "me",
"password": "it's me"


If a CXP-based project has a custom configuration for context or admin credentials, put a custom .bbrc in the root folder, so CLI can use custom defaults.


Where the .bbrc file contains this conf:

  "scheme": "http",
  "host": "localhost",
  "port": "7777",
  "context": "portalserver",
  "username": "me",
  "password": "it's me",
  "portal": "myportal",
  "path": "/path/to/the/portalserver"

When running bb import from /project/config dir, CLI will use the defined REST configuration with overriden context and user credentials.

API docs

Programmatic API.

Copyright © 2016 Backbase B.V.

Current Tags

  • 0.2.4-fsevents.3                                ...           fsevents (3 years ago)
  • 0.3.8                                ...           latest (2 years ago)
  • 0.4.4                                ...           nightly (2 years ago)
  • 0.3.0-beta.1                                ...           page-export (4 years ago)

69 Versions

  • 0.4.4                                ...           2 years ago
  • 0.3.8                                ...           2 years ago
  • 0.4.3                                ...           2 years ago
  • 0.3.7                                ...           2 years ago
  • 0.3.6                                ...           2 years ago
  • 0.4.2                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           3 years ago
  • 0.3.5                                ...           3 years ago
  • 0.3.4                                ...           3 years ago
  • 0.3.2                                ...           3 years ago
  • 0.3.1                                ...           3 years ago
  • 0.3.1-beta.3                                ...           3 years ago
  • 0.3.1-beta.2                                ...           3 years ago
  • 0.3.1-beta.1                                ...           3 years ago
  • 0.3.1-beta.0                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
  • 0.3.0-beta.3                                ...           3 years ago
  • 0.3.0-beta.2                                ...           3 years ago
  • 0.2.5-beta.1                                ...           3 years ago
  • 0.2.5-beta.0                                ...           3 years ago
  • 0.2.4                                ...           3 years ago
  • 0.2.4-beta.4                                ...           3 years ago
  • 0.2.4-fsevents.3                                ...           3 years ago
  • 0.2.4-beta.3                                ...           3 years ago
  • 0.2.4-beta.2                                ...           3 years ago
  • 0.2.4-beta.1                                ...           4 years ago
  • 0.2.4-beta.0                                ...           4 years ago
  • 0.2.3                                ...           4 years ago
  • 0.2.3-beta.4                                ...           4 years ago
  • 0.2.3-beta.3                                ...           4 years ago
  • 0.2.3-beta.2                                ...           4 years ago
  • 0.2.3-beta.1                                ...           4 years ago
  • 0.2.3-beta.0                                ...           4 years ago
  • 0.3.0-beta.1                                ...           4 years ago
  • 0.2.2                                ...           4 years ago
  • 0.2.2-beta.0                                ...           4 years ago
  • 0.2.1                                ...           4 years ago
  • 0.3.0-beta.0                                ...           4 years ago
  • 0.2.1-beta.1                                ...           4 years ago
  • 0.2.1-beta.0                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.2.0-beta.14                                ...           4 years ago
  • 0.2.0-beta.13                                ...           4 years ago
  • 0.2.0-beta.12                                ...           4 years ago
  • 0.2.0-beta.11                                ...           4 years ago
  • 0.2.0-beta.10                                ...           4 years ago
  • 0.2.0-beta.9                                ...           4 years ago
  • 0.2.0-beta.8                                ...           4 years ago
  • 0.2.0-beta.7                                ...           4 years ago
  • 0.2.0-beta.6                                ...           4 years ago
  • 0.2.0-beta.5                                ...           4 years ago
  • 0.2.0-beta.4                                ...           4 years ago
  • 0.1.10                                ...           4 years ago
  • 0.1.9                                ...           4 years ago
  • 0.1.8                                ...           4 years ago
  • 0.1.7                                ...           4 years ago
  • 0.2.0-beta                                ...           4 years ago
  • 0.1.6                                ...           4 years ago
  • 0.1.5                                ...           4 years ago
  • 0.1.4                                ...           4 years ago
  • 0.1.3                                ...           4 years ago
  • 0.1.2                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0-1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
  • 0.1.0-rc.2                                ...           4 years ago
  • 0.1.0-rc.1                                ...           4 years ago
  • 0.1.0-rc                                ...           4 years ago
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 69
Dependencies (52)
Dev Dependencies (8)
Dependents (0)

Copyright 2014 - 2016 © |