Skip to content

CLI

The ryot CLI (package @ryot-app/cli) turns a plugin package into an installable archive. It has two commands, ryot plugin build and ryot plugin messages. Run both from the plugin package root, the directory that holds its package.json.

package.json
{
"exports": { ".": { "types": "./manifest/plugin.ts", "default": "./manifest/plugin.ts" } },
"scripts": { "build": "ryot plugin build", "messages": "ryot plugin messages" }
}

The build reads the manifest from the module named by exports["."].default and fails when it is missing.

Validates the plugin and writes a deterministic, source-free archive.

Flag Effect
--output <path> Write the archive to this path instead of dist/<publisher>/<name>.zip
--watch Build, then rebuild whenever authoring inputs change
--skip-initial With --watch, skip the first build and wait for the first change

A build stops at the first failing step and leaves any existing archive untouched.

  1. Messages. Runs the ryot plugin messages step.
  2. Manifest. Loads the authored manifest and validates it against the strict authored schema.
  3. Backend. Compiles every backend/**/*.sandbox.ts entry, with the shared/ sources it reaches, and derives the manifest’s scripts section from the compiled entries (see Script discovery).
  4. Manifest text. Requires every manifest display text, including property schema labels, hints and choice labels and the search options schemas of compiled provider scripts, to name an English key whose arguments are exactly the declared ones: none, except row text bindings.
  5. Client. When the manifest declares client, compiles client/ and the shared/ sources it reaches into a client artifact.
  6. Full manifest. Validates the manifest together with the derived scripts.
  7. Definitions. Validates the plugin’s definitions, declared queries, saved views and controls with the ingestion validator against the kernel baseline and the declared dependency closure.
  8. Archive. Writes the archive.

Source discovery skips test files (any file whose name contains .test.) and shared/messages.generated.ts. backend/ and shared/ contribute .ts files; client/ contributes .ts, .tsx, .css and supported asset files (.svg, .png, .jpg, .jpeg, .gif, .webp, .avif, .ico, .mp3, .woff2, .wasm).

ryot plugin build leaves shared/messages.generated.ts out of the compiler sources and passes the compiled English catalog to both compilers, which generate the builder themselves (see The generated builder). The compiled catalogs, plus the generated en-XA pseudo-locale, are written into the archive.

Manifest dependencies map importer-local aliases to { packageId, scope }. Authored imports use @ryot-app/plugins/<alias>/<export>; compilation replaces the alias with the exact scoped package target. It does not install dependencies or select revisions.

  • Each dependency resolves to an installed npm dependency of the importing package (from its dependencies, devDependencies or peerDependencies, found in node_modules) whose exports["."].default is a plugin manifest with the matching package ID.
  • Dependencies of dependencies are resolved the same way, from each dependency’s own package.
  • The build fails when a declared dependency is not installed.
  • A plugin that depends on a user-scope package is validated as a private plugin itself.

See Dependencies for the manifest side.

  • The archive is written to dist/<publisher>/<name>.zip (from metadata.packageId) unless --output names another path. It is written to a temporary file first and then renamed into place.
  • It contains the manifest (with derived scripts), compiled backend and client artifacts, and compiled message catalogs. It never contains authored sources or raw assets.
  • The archive is deterministic. See the archive format for entry order, limits and rejection reasons.
  • Client artifacts record the imported package/export targets and a hash of the full client declaration. Archive validation rejects an artifact whose declaration hash differs from the manifest, even when its package ID and executable bytes are unchanged.

--watch runs one build, then polls the package for changes and rebuilds in a fresh process.

  • Watched inputs are .ts files (except *.generated.ts), catalogs under shared/messages/, client source and asset files, and package.json. node_modules, dist and the --output path are ignored.
  • If the first build fails, watch mode exits. Pass --skip-initial to start watching without it.
  • After a failed rebuild, the next poll retries until a build succeeds.

Validates the message catalogs and writes the typed builder. Run it before type-checking plugin sources; it works from a clean checkout, before kernel catalog generation.

  1. Validates shared/messages/<locale>.json with the shared catalog validator from @ryot-app/i18n: the same rules and limits as kernel catalogs. en is required.
  2. Scans the plugin’s non-test .ts and .tsx sources under backend/, client/, manifest/, shared/ and the package root. Any quoted literal equal to a key counts as a use.
  3. Fails on a catalogMessage(...) or catalogRowText(...) call whose first literal is not a key, on a key that nothing references, and on a catalog that defines one of the kernel’s common message keys.
  4. Writes the typed catalogMessage builder, and catalogRowText for row text, to shared/messages.generated.ts, rewriting it only when its contents change.

Generated modules are not committed. See Messages and languages for catalog format and key rules.