cordis-cli
English | 简体中文
Command-line runner for the cordis-rs
plugin framework: cordis run <config.yml>.
Builds on cordis-loader to give a config-driven cordis application a process model:
$ cordis run cordis.yml
cordis: worker ready (2 entries, config: cordis.yml)
- daemon / worker —
cordis runsupervises a worker subprocess that boots the loader. The worker exits with code51to request a hot restart,52to quit, and53when the loader never booted; only51respawns. - signals —
SIGINT/SIGTERMdispose the root context gracefully and exit52, so Ctrl+C stops the whole application cleanly. A signal that reaches only the daemon (kill <pid>, supervisors with per-process kill modes) is forwarded: the daemon closes the worker's stdin pipe, the worker tears down through the same graceful path, and one that ignores it for ten seconds is killed — so the worker also exits when the daemon dies for any reason. - dotenv —
.envand.env.localare loaded from the working directory at startup (existing environment variables always win), and${{ env.NAME }}templates in the config expand from there. - hot reload — the entry file is watched (debounced); external edits reconcile fibers through the loader's diff machinery.
Plugins stop or restart the process through the worker service:
// inside a plugin's apply, with `ctx` the plugin context:
let handle = ctx.?;
handle.restart; // full worker reload (exit 51)
Scope
The stock binary registers only the built-in group plugin; entries with
other names are recorded in the loader's last_error() and skipped,
unless --plugin-dir <dir> (repeatable) lets them resolve from
dynamic-library plugins fingerprint-checked against the running toolchain —
a changed library hot-restarts the worker. Embedding applications register
their own plugins via
cordis_loader::PluginRegistry or fork
this runner.