# bpmn-js-cli

> A command-line interface for bpmn-js

Latest version **2.4.0** (published 2024-01-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install bpmn-js-cli
pnpm add bpmn-js-cli
yarn add bpmn-js-cli
bun add bpmn-js-cli
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.4.0 |
| Published | 2024-01-10 |
| First published | 2014-08-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 20.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 59 |
| Author | Nico Rehwaldt |
| Maintainers | vsgoulart, skaiir-camunda, marstamm, beatrizmendes, bpmn-io-admin, nikku, barmac, philippfromme, maxtru, iso50 |
| Keywords | bpmn-js, bpmn-js-plugin |

## Links

- npm: https://www.npmjs.com/package/bpmn-js-cli
- Repository: https://github.com/bpmn-io/bpmn-js-cli
- Homepage: https://github.com/bpmn-io/bpmn-js-cli#readme
- Issues: https://github.com/bpmn-io/bpmn-js-cli/issues
- npm.io page: https://npm.io/package/bpmn-js-cli

## Dependencies (1)

- [min-dash](https://npm.io/package/min-dash.md) ^4.1.1

## Recent versions

- 2.4.0 (latest) — 2024-01-10
- 2.3.0 — 2022-11-24
- 2.2.1 — 2022-09-20
- 2.2.0 — 2022-02-28
- 2.1.0 — 2021-12-03
- 2.0.2 — 2021-03-01
- 2.0.1 — 2021-03-01
- 2.0.0 — 2020-06-27
- 1.4.1 — 2020-06-27
- 1.4.0 — 2020-06-27
- 1.3.1 — 2020-06-17
- 1.3.0 — 2020-06-16
- 1.2.0 — 2020-01-02
- 1.1.0 — 2019-08-09
- 1.0.0 — 2018-12-12
- … 23 more at https://npm.io/package/bpmn-js-cli/versions

## README

> As of version `1.0.0` this library exposes [ES modules](http://exploringjs.com/es6/ch_modules.html#sec_basics-of-es6-modules). Use an ES module aware bundler such as [Webpack](https://webpack.js.org) or [Rollup](https://rollupjs.org) to bundle it for the browser.

# bpmn-js-cli

[![CI](https://github.com/bpmn-io/bpmn-js-cli/workflows/CI/badge.svg)](https://github.com/bpmn-io/bpmn-js-cli/actions?query=workflow%3ACI)

An extensible command line interface for [bpmn-js](https://github.com/bpmn-io/bpmn-js).


## Demo

<img src="./resources/screencast.gif" style="max-width: 100%" />

Checkout [`demo.js`](./resources/demo.js) for the commands powering this demo.


## Features

* Model BPMN 2.0 diagrams in the browser, without a mouse
* Full undo and redo functionality
* Extensible through your own commands
* [Numerous built-in commands](#built-in-commands)


## Built in Commands

Out of the box, the cli supports the following commands:

 * `append source type [deltaPos]`
 * `connect source target type`
 * `create type position parent`
 * `element id`
 * `elements`
 * `move shape delta [newParentId]`
 * `undo`
 * `redo`
 * `save svg|bpmn`
 * `setLabel element label`
 * `setRoot element|elementId`
 * `removeShape  shape|elementId`
 * `removeConnection  connection|connectionId`


## Quickstart

Get the list of available commands:

```
cli.help();
```

Get the list of elements:

```
cli.elements();
```

Export SVG or BPMN 2.0 xml

```
cli.save('svg' || 'bpmn');
```


## Usage

Deploy the cli with [bpmn-js](https://github.com/bpmn-io/bpmn-js):

```
var BpmnModeler = require('bpmn-js/lib/Modeler'),
    CliModule = require('bpmn-js-cli');

var modeler = new BpmnModeler({
  container: document.body,
  additionalModules: [
    CliModule
  ],
  cli: {
    bindTo: 'cli'
  }
});

modeler.importXML('some-bpmn-xml')
  .then(({ warnings }) => {
    // ...
  })
  .catch(err => {
    console.error(err);
  });
```

Access the cli as `cli` in your developer console (open via `F12` in most browsers).

Use the cli to model BPMN 2.0 diagrams in your browser. Pain free.


## License

MIT

---
_Source: https://npm.io/package/bpmn-js-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
