5. Command Line Interface

The OrmFactory Command Line Interface (CLI) provides access to project operations without starting the graphical user interface.

The CLI is intended for automation scenarios such as:

  • CI/CD pipelines
  • diagram export
  • build scripts
  • scheduled tasks
  • integration with external tools

The desktop and command-line modes share the same project format and processing engine, ensuring consistent results regardless of how a command is executed.

The CLI currently supports exporting diagrams as SVG files and deploying model changes to a database. The database deployment workflow includes checking the model against the target database and applying changes when appropriate.

Docker

OrmFactory CLI is available as a Docker image for Linux on AMD64 and ARM64. Docker allows you to run the CLI without installing it directly on the host.

Pull the image:

docker pull ormfactory/cli:latest

Display the available commands and options:

docker run --rm ormfactory/cli:latest --help

To run a command against a project in the current directory, mount the project directory into the container:

docker run --rm \
    -v "$PWD:/work" \
    -w /work \
    ormfactory/cli:latest \
    check --project=model.0fproj

Replace model.0fproj with the path to your project file. Mount the project directory so that all files required by the project are available to the CLI.

The same approach can be used to run deploy, export-svg, and other CLI commands. For database operations, the container must have network access to the target database and receive the required connection settings.

See the OrmFactory CLI image on Docker Hub for available tags and supported platforms.

Running CLI commands

When installed directly, all commands are executed through the ormfactory executable.

General syntax:

ormfactory <command> [options]

For example:

ormfactory export-svg --project=model.ormfactory

Available commands

Command Description
export-svg Exports diagrams as SVG files.
check Checks the model against a target database and reports the changes required to bring the database in line with the model.
deploy Applies model changes to a target database.

See the individual command documentation for detailed options and examples.