Skip to Content
Droot Developers

droot CLI Reference

Every command of the droot CLI, with its options.

The droot CLI (Apache-2.0, sdk/cli) builds, checks, tests and installs DrootERP packages. It talks to a system only over its HTTP APIs (API v1, the admin package APIs and the sign-in endpoints). See getting-started.md for the workflow.

Environment: DROOT_SYSTEM (the default system), DROOT_CONFIG_DIR (where config.json and, without a keychain, credentials.json live; default ~/.config/droot), DROOT_CREDENTIALS=file (never the keychain), DROOT_ORIGIN (an Origin header for systems that check it), DROOT_SCHEMAS, DROOT_STARTERS and DROOT_TESTING (other copies of the schemas, starters and test harness).

Command What it does
droot login Sign in to a system and keep the tokens in the OS keychain (else a 0600 file)
droot logout Forget a system's tokens
droot whoami Show who the CLI is signed in as on a system
droot app init Create a package from a starter
droot app code Add a code unit (record hook, custom action, transition hook, event handler or scheduled job) to the package, with a unit test
droot app validate Check the manifest, metadata, seed and migrations against the published schemas, the structure, scopes and size limits
droot app lint Validate, plus the guidelines: Title Case labels, design tokens instead of raw colours, no vendor names
droot app dev Install the package on a sandbox system and re-upload it on every change
droot app test Run the package's tests against an in-memory system with the package installed
droot app pack Build the package archive (deterministic zip) and its SHA-256 checksum
droot app keygen Create your publisher signing key pair (Ed25519), kept outside every repository
droot app sign Sign the package archive with your publisher key
droot app verify Check a signed archive against a publisher public key
droot app check Ask a system whether the package can install: signature, compatibility, migrations (a dry run)
droot app history List a system's package history: installs, updates, roll backs and uninstalls
droot app install Install the package on a system as a private package, showing the changes first
droot app publish Pack the package for the marketplace (publishing itself comes later)
droot types Generate TypeScript types for the package's models, and the typed API client of a system
droot connector init Create a sync connector package (integration hub) from the sync starter
droot connector test Run a sync connector's tests: its mappings checked, the hub and sync engine against stand-in servers

droot login

Sign in to a system and keep the tokens in the OS keychain (else a 0600 file).

With --client-id: OAuth code + PKCE in the browser, through a public OAuth app registered with the redirect URI http://127.0.0.1:<port>/callback; the token works on API v1 (droot types). With --email: a sign-in as yourself, asking for the password without echo; installing packages (app dev, app install) needs this, as a person holding apps.admin. The system becomes the default for later commands.

droot login <url> [options]
Argument Description
url (required) The system's URL
Option Description Default
--client-id <value> The public OAuth app's client id (OAuth sign-in)
--scopes <value> Space-separated scopes to ask for offline_access
--port <value> The loopback port of the redirect URI 8976
--app-url <value> Where the web app serves /oauth/authorize. Default: the address the system publishes (GET /api/instance), else the system URL
--email <value> Sign in as this user instead (asks for the password)

Examples:

droot login https://erp.example.com --email dev@example.com
droot login https://erp.example.com --client-id dca_123 --scopes "crm.read offline_access"

droot logout

Forget a system's tokens.

droot logout [options]
Option Description Default
--system <value> The system's URL (default: DROOT_SYSTEM, else the last login)

droot whoami

Show who the CLI is signed in as on a system.

droot whoami [options]
Option Description Default
--system <value> The system's URL (default: DROOT_SYSTEM, else the last login)

droot app init

Create a package from a starter.

Templates: app (a small vertical app: models, fields, list and form views, navigation, a flow, automations, a role, a setting, a document layout and seed data); connector (a connector: connection and settings, outbound operations, a signed inbound webhook and a delivery log); sync (a sync connector on the integration hub: an external REST entity, a default mapping both ways, a schedule and conflict rule, tests against a stand-in API); extension (an extension of an installed app: a field, a record tab and list actions on business partners (declarative UI slots only)); blank (one model with its views and navigation, every folder ready).

droot app init <name> [options]
Argument Description
name (required) The package name, lowercase words joined by dashes (visitor-log)
Option Description Default
--template <value> (-t) The starter: app, connector, sync, extension, blank app
--publisher <value> Your publisher id; the package id is <name>@<publisher> example
--publisher-name <value> Your publisher's display name
--label <value> The app's name as people see it (default: the name in Title Case)
--dir <value> Where to create the package folder .

Examples:

droot app init gate-pass --publisher acme
droot app init ticket-relay --template connector --publisher acme

droot app code

Add a code unit (record hook, custom action, transition hook, event handler or scheduled job) to the package, with a unit test.

Writes code/<key>.js, its entry in code/code.json (with the scopes it needs) and tests/<key>.code.test.ts, which runs the unit against a stub bridge. Hooks, actions and transition hooks need --model; event handlers take --events (catalog types or families, comma-separated) and scheduled jobs --every (minutes, at least 5). Code runs in the system's sandbox; see docs/superpowers/plans/2026-10-08-e6-runtime.md.

droot app code <key> [options]
Argument Description
key (required) The unit key, lowercase words joined by dashes (check-credit)
Option Description Default
--kind <value> hook, action, transition, event or schedule action
--model <value> The model it runs on (sales.order)
--event <value> A hook's event: before_insert, before_save, before_delete, after_insert, after_save, after_delete before_save
--transition <value> A transition hook's transition key, or * for any *
--when <value> A transition hook runs before (may refuse) or after the transition before
--events <value> An event handler's event types or families, comma-separated (record.created,record.updated) record.created
--every <value> A scheduled job's interval in minutes (5 to 1440, dividing a day) 60
--dir <value> The package folder .

droot app validate

Check the manifest, metadata, seed and migrations against the published schemas, the structure, scopes and size limits.

droot app validate [dir] [options]
Argument Description
dir The package folder (default: the current folder)
Option Description Default
--json Print the report as JSON

droot app lint

Validate, plus the guidelines: Title Case labels, design tokens instead of raw colours, no vendor names.

droot app lint [dir] [options]
Argument Description
dir The package folder (default: the current folder)
Option Description Default
--json Print the report as JSON

droot app dev

Install the package on a sandbox system and re-upload it on every change.

Installs the package as a private package (an install needs a sign-in holding apps.admin across every company: droot login <url> --email), then watches the folder: each change is validated locally and, when it passes, uploaded; the system's verdict (what changed, or why it refused) is printed. With --company the package is active in that company only (app activation), so a sandbox company sees it and the others don't.

droot app dev [dir] [options]
Argument Description
dir The package folder (default: the current folder)
Option Description Default
--system <value> The system's URL (default: DROOT_SYSTEM, else the last login)
--company <value> The sandbox company to activate the package in
--once Upload once and exit (no watching)

Examples:

droot app dev --system https://sandbox.example.com --company DEV-01

droot app test

Run the package's tests against an in-memory system with the package installed.

Validates the package, then runs tests/**/*.test.ts with node:test. Tests import @drooterp/testing (startTestSystem: the kernel in memory, the package's dependencies and the package installed, records, transitions, fixtures from tests/fixtures, and drain for background work).

droot app test [dir] [files] [options]
Argument Description
dir The package folder (default: the current folder)
files Test files to run (default: every tests/**/*.test.ts)
Option Description Default
--harness <value> The @drooterp/testing folder (default: DROOT_TESTING, else next to the CLI)

droot app pack

Build the package archive (deterministic zip) and its SHA-256 checksum.

droot app pack [dir] [options]
Argument Description
dir The package folder (default: the current folder)
Option Description Default
--out <value> The output folder (default: <dir>/dist)

droot app keygen

Create your publisher signing key pair (Ed25519), kept outside every repository.

Writes <name>.key (private, mode 0600) and <name>.pub (public) to --out, default the CLI's keys folder. Give the public key to the administrators who trust your packages (Setup › Package Trust); never share or commit the private key.

droot app keygen [options]
Option Description Default
--out <value> The folder for the key files (default: the CLI's keys folder)
--name <value> The key files' name publisher

droot app sign

Sign the package archive with your publisher key.

Packs the folder (or takes --file), adds signature.json signed with your private key (--key, else DROOT_SIGNING_KEY) and writes the signed archive and its checksum to --out. The publisher is the package's own (droot.json).

droot app sign [dir] [options]
Argument Description
dir The package folder (default: the current folder)
Option Description Default
--key <value> Your private key file (default: DROOT_SIGNING_KEY)
--file <value> Sign this archive instead of packing the folder
--out <value> The output folder (default: <dir>/dist)

Examples:

droot app sign --key ~/.droot/keys/publisher.key

droot app verify

Check a signed archive against a publisher public key.

droot app verify <archive> [options]
Argument Description
archive (required) The signed archive
Option Description Default
--public-key <value> The publisher's public key file

droot app check

Ask a system whether the package can install: signature, compatibility, migrations (a dry run).

Uploads the archive for inspection only: the signature as that system's trust settings see it, the platform, API and dependency checks, the data migrations the update would run with their record counts, the restore point, and the changes. Nothing is written.

droot app check [dir] [options]
Argument Description
dir The package folder (default: the current folder)
Option Description Default
--system <value> The system's URL (default: DROOT_SYSTEM, else the last login)
--file <value> Check this archive instead of packing the folder
--json Print the result as JSON

droot app history

List a system's package history: installs, updates, roll backs and uninstalls.

droot app history [app] [options]
Argument Description
app One app's history (its id, such as visitor-log@acme)
Option Description Default
--system <value> The system's URL (default: DROOT_SYSTEM, else the last login)

droot app install

Install the package on a system as a private package, showing the changes first.

Uploads the archive for a dry run and prints what would change (created, updated, adopted and removed rows, seed records); then installs after you confirm (or with --yes). --dry-run stops after the preview. --company activates the package in that company only.

droot app install [dir] [options]
Argument Description
dir The package folder (default: the current folder)
Option Description Default
--system <value> The system's URL (default: DROOT_SYSTEM, else the last login)
--company <value> Activate the package in this company only
--dry-run Show the changes and stop
--yes (-y) Install without asking
--file <value> Install this archive (from droot app pack) instead of packing the folder

Examples:

droot app install --system https://erp.example.com --dry-run
droot app install --system https://erp.example.com --company HQ --yes

droot app publish

Pack the package for the marketplace (publishing itself comes later).

droot app publish [dir]
Argument Description
dir The package folder (default: the current folder)

droot types

Generate TypeScript types for the package's models, and the typed API client of a system.

Writes <out>/models.ts from the package's models and fields. With --system (signed in) or --spec (a saved GET /api/v1/openapi.json), also writes the typed API v1 client for that system's models to <out>/client (the E3 generator).

droot types [dir] [options]
Argument Description
dir The package folder (default: the current folder)
Option Description Default
--system <value> The system's URL (default: DROOT_SYSTEM, else the last login)
--spec <value> An OpenAPI document file instead of a system
--out <value> The output folder (default: <dir>/types)

droot connector init

Create a sync connector package (integration hub) from the sync starter.

The package has connector/sync.json (protocol, sign-in, defaults, external entities with sample records) and connector/mappings/*.json (default field mappings), the model it writes, and tests that run against a stand-in API. Validate, test and pack it like any package.

droot connector init <name> [options]
Argument Description
name (required) The package name, lowercase words joined by dashes (crm-sync)
Option Description Default
--publisher <value> Your publisher id; the package id is <name>@<publisher> example
--publisher-name <value> Your publisher's display name
--label <value> The app's name as people see it (default: the name in Title Case)
--dir <value> Where to create the package folder .

Examples:

droot connector init crm-sync --publisher acme

droot connector test

Run a sync connector's tests: its mappings checked, the hub and sync engine against stand-in servers.

Validates the package, then runs tests/**/*.test.ts with node:test. Tests import @drooterp/testing (startConnectorHarness: the package read and checked, records in memory, the real sync engine and egress guard; configure, run, preview, checkMappings).

droot connector test [dir] [files] [options]
Argument Description
dir The package folder (default: the current folder)
files Test files to run (default: every tests/**/*.test.ts)
Option Description Default
--harness <value> The @drooterp/testing folder (default: DROOT_TESTING, else next to the CLI)