Tools for Nimbu projects
Last updated 18 days ago by wouterh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nimbu-toolbelt 
SYNC missed versions from official npm registry.


Build Status codecov

Toolbelt for Nimbu projects

Version Downloads/week License



You need a recent node and yarn. On Mac OS X:

brew install node yarn

You still need what was needed to use the old toolchain (ruby, bundler, ...)

Getting started

Add this package to your project:

yarn add --dev nimbu-toolbelt

This will also execute bundle install to install the old toolchain it uses.

Development server

To start developing on your project that uses this toolbelt, just run:

yarn nimbu server

This will start a webpack-dev-server (and the old nimbu server that it proxies to). Your browser should automatically open a connection to it at http://localhost:4567/.

Pushing to nimbu

  1. Stop your development server
  2. Make a production build with yarn nimbu build
  3. Push to nimbu with yarn nimbu themes:push (this calls the ruby-based toolchain -> all arguments you know are supported)

NOTE: Both the development and production webpack configuration generate snippets/webpack.liquid that gives access to the information about which files webpack generated. This should be included and used in the layout of your theme. Make sure that include is there and that you push the snippet to nimbu!


nimbu apps:config

Add an app to the local configuration

  $ nimbu apps:config

See code: src/commands/apps/config.ts

nimbu apps:list

List the applications registered in Nimbu

  $ nimbu apps:list

See code: src/commands/apps/list.ts

nimbu apps:push [FILES]

Push your cloud code files to nimbu

  $ nimbu apps:push [FILES]

  FILES  The files to push.

  -a, --app=app  The (local) name of the application to push to (see apps:list and apps:config).

See code: src/commands/apps/push.ts

nimbu apps:transpile SOURCE TARGET

Transpile a file from ES6 to ES5 for compatiblity with Nimbu Cloud applications

  $ nimbu apps:transpile SOURCE TARGET

See code: src/commands/apps/transpile.ts

nimbu auth:login

login with your nimbu credentials

  $ nimbu auth:login

  -e, --expires-in=expires-in  duration of token in seconds (default 1 year)

  $ nimbu login

See code: src/commands/auth/login.ts

nimbu auth:logout

clears local login credentials and invalidates API session

  $ nimbu auth:logout

  $ nimbu logout

See code: src/commands/auth/logout.ts

nimbu auth:token

outputs current CLI authentication token.

  $ nimbu auth:token

  -h, --help  show CLI help

  By default, the CLI auth token is only valid for 1 year. To generate a long-lived token, use nimbu

See code: src/commands/auth/token.ts

nimbu auth:whoami

display the current logged in user

  $ nimbu auth:whoami

  $ nimbu whoami

See code: src/commands/auth/whoami.ts

nimbu autocomplete [SHELL]

display autocomplete installation instructions

  $ nimbu autocomplete [SHELL]

  SHELL  shell type

  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

  $ nimbu autocomplete
  $ nimbu autocomplete bash
  $ nimbu autocomplete zsh
  $ nimbu autocomplete --refresh-cache

See code: @oclif/plugin-autocomplete

nimbu browse:admin

open the admin area for your current site

  $ nimbu browse:admin

See code: src/commands/browse/admin.ts

nimbu browse:simulator

open the simulator for your current site

  $ nimbu browse:simulator

See code: src/commands/browse/simulator.ts

nimbu build

build a production version of your javascript and CSS

  $ nimbu build

See code: src/commands/build.ts

nimbu channels:copy

copy channel configuration from one to another

  $ nimbu channels:copy

  -f, --from=from  (required) slug of the source channel
  -t, --to=to      (required) slug of the target channel

See code: src/commands/channels/copy.ts

nimbu channels:entries:copy

copy channel entries from one to another

  $ nimbu channels:entries:copy

  -f, --from=from          (required) slug of the source channel
  -p, --per_page=per_page  number of entries to fetch per page
  -q, --query=query        query params to apply to source channel
  -t, --to=to              (required) slug of the target channel
  -u, --upsert=upsert      name of parameter to use for matching existing documents

See code: src/commands/channels/entries/copy.ts

nimbu config

Show resolved configuration

  $ nimbu config

See code: src/commands/config.ts

nimbu customers:config:copy

copy channel configuration from one to another

  $ nimbu customers:config:copy

  -f, --from=from  subdomain of the source site
  -t, --to=to      subdomain of the destination site

See code: src/commands/customers/config/copy.ts

nimbu help [COMMAND]

display help for nimbu

  $ nimbu help [COMMAND]

  COMMAND  command to show help for

  --all  see all commands in CLI

See code: @oclif/plugin-help

nimbu init

initialize your working directory to code a selected theme

  $ nimbu init

  -c, --cloudcode  Create CloudCode directory
  -h, --haml       Use HAML for the templates in this project
  -s, --site=site  The site (use the Nimbu subdomain) to link to this project.

See code: src/commands/init/index.ts

nimbu mails:pull

download all notification templates

  $ nimbu mails:pull

See code: src/commands/mails/pull.ts

nimbu mails:push

upload all notification templates

  $ nimbu mails:push

See code: src/commands/mails/push.ts

nimbu products:config:copy

copy channel configuration from one to another

  $ nimbu products:config:copy

  -f, --from=from  subdomain of the source site
  -t, --to=to      subdomain of the destination site

See code: src/commands/products/config/copy.ts

nimbu server

run the development server

  $ nimbu server

  --host=host              [default:] The hostname/ip-address to bind on.
  --nimbu-port=nimbu-port  [default: 4568] The port for the ruby nimbu server to listen on.
  --nocookies              Leave cookies untouched i.s.o. clearing them.
  --port=port              [default: 4567] The port to listen on.

See code: src/commands/server.ts

nimbu sites:list

list sites you can edit

  $ nimbu sites:list

  -s, --subdomain  show Nimbu subdomain for each site

  $ nimbu sites

See code: src/commands/sites/list.ts

nimbu themes:diff [THEME]

describe the command here

  $ nimbu themes:diff [THEME]

  THEME  The name of the theme to list

See code: src/commands/themes/diff.ts

nimbu themes:list [THEME]

list all layouts, templates and assets

  $ nimbu themes:list [THEME]

  THEME  The name of the theme to list

See code: src/commands/themes/list.ts

nimbu themes:push [FILES]

describe the command here

  $ nimbu themes:push [FILES]

  FILES  The files to push with --only

  --css-only     only push css
  --fonts-only   only push fonts
  --force        skip the usage check and upload anyway
  --images-only  only push new images
  --js-only      only push javascript
  --liquid-only  only push template code
  --only         only push the files given on the command line

See code: src/commands/themes/push.ts


Webpack is configured to support the features below.


The javascripts pipeline supports:

There is one entrypoint src/index.js that gets compiled into javascripts/app.js and javascripts/vendor.js (split automatically).


The CSS pipeline supports:

  • SCSS using sass-loader
  • Minification and autoprefixing using postcss-loader and autoprefixer

The entrypoint is src/index.scss, but any (S)CSS you import in your javascript or coffeescript will also be included in the output.

To import scss files from node_modules, use a ~ prefix. For example, to import bourbon that was added with yarn add bourbon:

@import '~bourbon/core/bourbon';

In development mode, the CSS is injected dynamically into the DOM using style-loader to support Hot Module Reloading. In production, the CSS is extracted into stylesheets/app.css.

Sometimes the dynamic injecting of CSS breaks stuff. For example, if you use javascript plugins that measure certain widths/heights when the document is ready. These might execute before the styles get injected. To test these kind of things, you can tell webpack to extract the CSS into stylesheets/app.css in development too. Start the development server with the following command to do that:

EXTRACT_CSS=true yarn start

Using the webpack output in your layout

Webpack generates snippets/webpack.liquid. If you include that snippet, you get access to:

  • webpack_build_timestamp: timestamp of the moment that webpack generated the snippet. Useful in a cache key.
  • webpack_chunks: an array of the names of the chunks that webpack generated.
  • webpack_js: a map of chunkname to javascript filename for that chunk.
  • webpack_css: a map of chunkname to array of css filenames for that chunk.

For example, you can use this snippet of liquid in your layout:

{% include 'webpack' %}
{% for chunk in webpack_chunks, cache: webpack_build_timestamp %}
{% for file in webpack_css[chunk] %}
{{ file | stylesheet_tag }}
{% endfor %}
{% endfor %}

{% for chunk in webpack_chunks, cache: webpack_build_timestamp %}
{{ webpack_js[chunk] | javascript_tag }}
{% endfor %}

Current Tags

  • 1.5.0-beta.4                                ...           beta (a month ago)
  • 1.6.0                                ...           latest (18 days ago)

30 Versions

  • 1.6.0                                ...           18 days ago
  • 1.5.2                                ...           20 days ago
  • 1.5.1                                ...           25 days ago
  • 1.5.0                                ...           a month ago
  • 1.5.0-beta.4                                ...           a month ago
  • 1.5.0-beta.2                                ...           a month ago
  • 1.5.0-beta.1                                ...           a month ago
  • 1.5.0-beta.0                                ...           a month ago
  • 1.4.2                                ...           4 months ago
  • 1.4.1                                ...           4 months ago
  • 1.4.0                                ...           4 months ago
  • 1.3.0                                ...           5 months ago
  • 1.2.6                                ...           5 months ago
  • 1.2.5                                ...           6 months ago
  • 1.2.4                                ...           6 months ago
  • 1.2.3                                ...           7 months ago
  • 1.2.2                                ...           8 months ago
  • 1.2.1                                ...           9 months ago
  • 1.2.0                                ...           10 months ago
  • 1.1.2                                ...           10 months ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.0-rc.1                                ...           a year ago
  • 1.0.0-beta6                                ...           a year ago
  • 1.0.0-beta5                                ...           a year ago
  • 1.0.0-beta3                                ...           a year ago
  • 1.0.0-beta2                                ...           a year ago
  • 1.0.0-beta                                ...           a year ago
Maintainers (2)
Today 0
This Week 0
This Month 94
Last Day 0
Last Week 60
Last Month 90
Dependencies (74)
Dev Dependencies (28)
Dependents (0)

Copyright 2014 - 2017 © |