# CLI (/cli)



The LVGL Editor provides a Node-based command line tool, `lved-cli.js`, for generating and compiling code from XML, validating projects, syncing from Figma, comparing trees, and running headless UI tests.

<Callout type="warn">
  Pre-release build intended for development and CI integration.
</Callout>

Overview [#overview]

* **Binary:** `lved-cli.js` (Node script) [Download
  CLI](https://github.com/lvgl/lvgl_editor/releases)
* **Platform:** Node 18+ recommended
* **Container engine:** Podman (if not on Windows, [Download
  Podman](https://github.com/containers/podman/releases))

Quick Start [#quick-start]

Generate C and H files from XMLs:

```bash title="bash" lineNumbers=1
lved-cli.js generate path/to/project
```

Compile the runtime binary for previewing or testing the UI:

```bash title="bash" lineNumbers=1
lved-cli.js compile path/to/project --target web --start-service
```

Validate XML content and limit shown errors:

```bash title="bash" lineNumbers=1
lved-cli.js validate path/to/project --errorlimit 25
```

Run tests from XML files:

```bash title="bash" lineNumbers=1
lved-cli.js run-all-tests path/to/project
lved-cli.js run-test path/to/project tests/test-file.xml
```

Synchronize styles and images from Figma:

```bash title="bash" lineNumbers=1
lved-cli.js figma-sync path/to/project --start-service
```

Commands [#commands]

generate [#generate]

Generate code from XML.

```bash title="bash" lineNumbers=1
lved-cli.js generate <project-path> [--start-service]
```

compile [#compile]

Compile for a target.

```bash title="bash" lineNumbers=1
lved-cli.js compile <project-path> [--start-service] [--target <web|node>]
```

* `--target` defaults to `web` (choices: `web`, `node`)

compare [#compare]

Compare two directories by presence and normalized content.

```bash title="bash" lineNumbers=1
lved-cli.js compare <first-project-path> <second-project-path>
```

figma-sync [#figma-sync]

Synchronize project with Figma.

```bash title="bash" lineNumbers=1
lved-cli.js figma-sync <project-path> [--start-service]
```

validate [#validate]

Validate XML files and limit the number of shown errors.

```bash title="bash" lineNumbers=1
lved-cli.js validate <project-path> [--errorlimit n] [--start-service]
```

* `--errorlimit` default: `10` (minimum: 1)

run-test [#run-test]

Run tests from a single file.

```bash title="bash" lineNumbers=1
lved-cli.js run-test <project-path> <testing-file>
```

run-all-tests [#run-all-tests]

Discover and run all `test*.xml` files.

```bash title="bash" lineNumbers=1
lved-cli.js run-all-tests <project-path>
```

Common Arguments [#common-arguments]

| Argument         | Description                                                |
| ---------------- | ---------------------------------------------------------- |
| `<project-path>` | Path to an LVGL Editor project                             |
| `<testing-file>` | Test XML relative to `<project-path>` (used in `run-test`) |

Options [#options]

| Option                 | Description                                    |
| ---------------------- | ---------------------------------------------- |
| `-ss, --start-service` | Prepare/refresh container image before running |
| `--target <web\|node>` | Compile target (used in `compile`)             |
| `-l, --errorlimit n`   | Maximum errors shown (used in `validate`)      |

Examples [#examples]

Compare to a reference tree:

```bash title="bash" lineNumbers=1
lved-cli.js compare build/generated ./ci/reference
```

Compile for Node:

```bash title="bash" lineNumbers=1
lved-cli.js compile ./examples/my-project --target node --start-service
```

CI/CD Integration [#cicd-integration]

See an example [GitHub Actions workflow](https://github.com/lvgl/lvgl_editor/blob/master/.github/workflows/pr-check.yml) for integrating the CLI into your CI/CD pipeline.
