Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,16 @@ c8 get process-instance 2251799813685249

# Get process instance with variables
c8 get pi 2251799813685249 --variables

# Render process instance diagram as PNG
c8 get pi 2251799813685249 --diagram

# Save diagram to file
c8 get pi 2251799813685249 --diagram --output=./diagram.png
```

### Get Process Instance Diagram
### Render Process Instance Diagram

```bash
# Render process instance diagram as PNG (inline terminal display)
c8 get pi 2251799813685249 --diagram
c8 diagram 2251799813685249

# Save diagram to a specific file
c8 get pi 2251799813685249 --diagram --output=./my-diagram.png
c8 diagram 2251799813685249 --output=./my-diagram.png
```

### Create Process Instance
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ c8ctl list pi # List process instances
c8ctl list pd # List process definitions
c8ctl get pi 123456 # Get process instance by key
c8ctl get pi 123456 --variables # Get process instance with variables
c8ctl get pi 123456 --diagram # Render process instance diagram as PNG
c8ctl get pi 123456 --diagram --output=./diagram.png # Save diagram to file
c8ctl get pd 123456 --xml # Get process definition as XML

# Render process instance diagram as PNG
c8ctl diagram 123456 # Display diagram inline in terminal
c8ctl diagram 123456 --output=./diagram.png # Save diagram to file

# Create process instance
c8ctl create pi --id=myProcess
c8ctl create process-instance --id=myProcess
Expand Down
57 changes: 57 additions & 0 deletions default-plugins/diagram/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# c8ctl-plugin-diagram

A default c8ctl plugin that renders BPMN process instance diagrams as PNG images with execution state highlighting.

## Features

- Renders BPMN diagrams for process instances
- Highlights completed elements (blue), active elements (blue/green), and incident elements (red)
- Shows taken sequence flows in blue
- Outputs inline to terminal (Kitty, iTerm2, WezTerm, Sixel) or saves as PNG file
- Uses system-installed Chrome/Chromium via puppeteer-core (no bundled browser)

## Usage

```bash
# Display diagram inline in supported terminals
c8ctl diagram <processInstanceKey>

# Save diagram to a PNG file
c8ctl diagram <processInstanceKey> --output ./diagram.png

# Use a specific profile
c8ctl diagram <processInstanceKey> --profile myprofile
```

## Requirements

- Google Chrome or Chromium must be installed on the system
- Download: https://www.google.com/chrome/

## Terminal Support for Inline Display

| Terminal | Protocol |
|----------|----------|
| Ghostty, Kitty | Kitty Graphics Protocol |
| WezTerm, Konsole | Kitty Graphics Protocol |
| iTerm2 | iTerm2 Inline Images Protocol |
| VS Code terminal | iTerm2 Inline Images Protocol |
| mintty | Sixel |
| xterm | Sixel |
| Others | iTerm2 fallback |

## Carving Out as Standalone Plugin

This plugin is designed to be extractable into a standalone npm package.
To use it as a standalone plugin:

1. Copy this directory to a new repository
2. Add the required dependencies to `package.json`:
- `puppeteer-core`
- `bpmn-js`
- `pngjs`
- `sixel`
- `supports-terminal-graphics`
- `@camunda8/orchestration-cluster-api`
3. Update the asset path resolution for the new package structure
4. Publish to npm with the `c8ctl-plugin` keyword
Loading