Skip to content

CLI Commands

Peter Lenahan edited this page Jul 10, 2019 · 3 revisions

The zimlet client tool exposes the following commands:

Create

The easiest way to create a Zimlet is using the interactive zimlet create command:

zimlet create

This will prompt you for any options needed to create a new Zimlet.

For extra control over the Zimlet you create, try choosing from a list of custom Zimlet templates or creating your own.

Options

zimlet create [template] [dest]

Create a new zimlet.

Options:
  --help         Show help                                             [boolean]
  --cwd          A directory to use instead of $PWD.              [default: "."]
  --name         The zimlet's name
  --force, -f    Force `dest` directory to created if it already exists; will
                 overwrite!                           [boolean] [default: false]
  --yarn         Install with `yarn` instead of `npm` [boolean] [default: false]
  --git          Initialize a `git` repository        [boolean] [default: false]
  --install, -i  Install dependencies                  [boolean] [default: true]
  --template     Remote template to clone (user/repo#tag)
  --dest         Directory to create the zimlet

Watch

Run zimlet watch to start live development on your Zimlet. watch will output a URL you can paste into /sdk/zimlets in the email app.

⚠️ Make sure to accept the self signed certificate generated by this command before loading the Zimlet.

Options

zimlet watch

Start a development server

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]
  --config   Path to a custom config file
                                        [string] [default: "./zimlet.config.js"]
  --port     Port of dev server                         [number] [default: 8081]
  --https    Protocol of dev server. https if true, http if false
                                                       [boolean] [default: true]

Build

Production build, create a bundle.js file to be added to the page running the Zimbra X app.

Options

zimlet build

Compile a zimlet

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]
  --config   Path to a custom config file
                                        [string] [default: "./zimlet.config.js"]
  --dest     Directory for build artifacts           [string] [default: ./build]

Package

Package for deployment to Zimbra server.

zimlet package --name com_mycompany_myzimlet -v 1.0.0 --description "My zimlet"

Options

zimlet package

Package a zimlet for deployment

Options:
  --version              Show version number                           [boolean]
  --help                 Show help                                     [boolean]
  --name, -n             Globally unique name for your zimlet, e.g.
                         "com_mycompany_examplezimlet"                [required]
  --pkg-version, -v      Version for your zimlet, e.g. "1.0.1"        [required]
  --description, --desc  Description for your zimlet                  [required]
  --zimbraXVersion       https://semver.org version range of Zimbra X that the
                         Zimlet is compatible with.         [default: ">=1.0.0"]
  --builddir, -b         Source directory of built artifacts to publish
                                                            [default: "./build"]
  --dest, -d             Directory for packaged artifacts       [default: ./pkg]
Clone this wiki locally