# sleelactl — the unified SLeeLa control plane `sleelactl` is one command that controls every SLeeLa module family: the daemons and servers, the HTTP and wireless protocols, the codec / compression / video registries, the compiler and decompiler tools, and the availability of the data systems. ``` sleelactl [args] control one module sleelactl all fan a verb across every compatible module sleelactl list [nature] list modules (optionally by nature) sleelactl status [module|all] show running status sleelactl natures explain the natures and their verbs sleelactl help [verb|module] help, or the verbs legal for a module ``` ## Why the verbs differ by module SLeeLa modules are genuinely different *kinds* of thing, so forcing one verb set (`start/stop`) onto all of them would be dishonest — the repo's own [`lib/core/SERVICE-STANDARD.md`](../lib/core/SERVICE-STANDARD.md) says "a worse abstraction forced onto a subsystem is worse than a little duplication." `sleelactl` therefore classifies each module by **nature** and offers only the verbs that fit it. An unsupported verb is **refused** with the correct verb set — `sleelactl` never fakes an action a module cannot perform. | Nature | Legal verbs | What it is | | --- | --- | --- | | **daemon** | `start stop restart reload status enable disable` | long-lived process under the host service manager (systemd, launchd, Windows SCM) | | **registry** | `list probe status` | closed handler set owned by a process-local Controller (SLPluginService) | | **datasource** | `open close status available` | open/close/active data surface + pooling (SLDataSource) | | **protocol** | `negotiate grade simulate validate info` | spec / stack / reference model | | **tool** | `run build inspect info` | on-demand, one-shot toolchain component | | **subject** | `run info` | native C/C++ subject library compiled into the runtime (import ;) | | **library** | `info` | pure library; informational only | _Generated from the script's single `NATURE_TABLE` by `sleelactl natures --markdown`; `tests/sleelactl_cli_test.sh` fails if this table drifts._ Mechanisms: **daemon** → the host service manager (systemd `unit=`, launchd `launchd=`, Windows SCM `winsvc=`); **registry** → `list` reports the declared handlers, `probe`/`status` run the reference pipeline (`demo=`) via `sleela run`; **datasource** → reports the `dir=` surface; **protocol** → the module's `make` targets and registered `sim=`; **tool** → `make -C dir=` + the `bin=` CLI, or a `script=` driver; **subject** → its `demo=` via `sleela run`; **library** → info. The verb vocabulary is drawn directly from the code: `start/enable` from the systemd units (`server-edition/.../sleela-server.service`, `antivirus/systemd/sleela-antivirus.service`); `load/unload/canProcess` from `SLPluginService` and `lib/codecs`; `open/close/active` from `SLDataSource`; `negotiate/grade/simulate/validate` from the HTTP and CDMA protocol trees. ## Examples ```sh sleelactl start server-edition # start the server daemon (systemd / launchd) sleelactl enable antivirus # enable the antivirus coordinator at boot sleelactl status all # status of every controllable module (non-zero if any fails) sleelactl --dry-run stop all # preview stopping every daemon; changes nothing sleelactl stop all --yes # mutating daemon verbs with 'all' need --yes sleelactl probe codecs # run the codec registry reference pipeline sleelactl list registry # just the registry-nature modules sleelactl list codecs # the codec registry's declared handlers (ids 0..19) sleelactl --json status all # machine-readable status sleelactl check-registry --strict # validate the module registry sleelactl where # resolved root, registry, runtime, service manager sleelactl available database # report the database data-source availability sleelactl open ledger # how to open the ledger data surface sleelactl validate http-9.0 # validate the HTTP/9.0 protocol spec sleelactl simulate cdma --std wcdma # run the CDMA simulator sleelactl build decompiler # build the Slecompiler CLI sleelactl run decompiler # invoke the built decompiler sleelactl run math # exercise the native math subject (__NativeMath) sleelactl info math # how the math subject is reached (import math;) sleelactl info native-drive sleelactl build native-drive main.c helper.c -o build/app sleelactl build native-drive plugin.cpp --kind shared --require-sleela-abi -o build/plugin.so sleelactl build native-drive hot.sleela --require-sleela-abi -o build/hot.so # @native methods -> typed-ABI plugin sleelactl run native-drive --capture -- build/app sleelactl inspect native-drive xclass --mode info Example.xclass sleelactl inspect native-drive service --name worker --executable /opt/worker --working-directory /var/lib/worker sleelactl build java-convert # C lexer + C++ translator (sleelactl/convert) sleelactl run java-convert --jdk-version 28 # sleelactl/jdk/28/java -> sleelactl/jdk/28/sleela, functionally equivalent, fails closed ``` The **subject** nature is for the native C/C++ subject libraries compiled into the `sleela` runtime (`impl/subjects//`). They are not daemons, handler registries, data connections, or specs — a program reaches them with `import ;` and qualified calls (e.g. `math.sqrt(144.0)`), which the frontend lowers onto the native `__Native` methods. `sleelactl run ` executes that native backend by running the subject's reference demo through `sleela run`. There is deliberately no `check` verb: `sleela check` does not load the SHEET-registered native subjects, so `run` is the one faithful execution verb. The first registered subject is `math`. The `native-drive` tool builds multi-unit C/C++ executables and shared libraries, compiles the `@native` methods of a `.sleela` file into a typed-ABI v1 plugin (one entry point per method; `--kind shared` is the default for `.sleela`), executes processes without an implicit shell, and routes XClass operations through the production loader. `sleelactl` passes its resolved `sleela` CLI to the driver, so a fresh `impl/build/sleela` works without PATH setup. Use `sleelactl inspect native-drive service ...` to render or explicitly install a hardened systemd unit. The VM owns an authorized, bounded native-module lifecycle API with typed scalar/UTF-8 dispatch and bytecode fallback, and a host may bind `@native` methods explicitly (`slvm_bind_native_method()`). Parser-enforced process annotations remain future compiler/runtime work. See [Native Drive](../impl/native-drive/README.md) and [`@native` dispatch](../impl/native-drive/AT-NATIVE-DISPATCH.md). `sleelactl all` applies the verb to every module whose nature accepts it (e.g. `sleelactl enable all --yes` enables the daemons; `sleelactl build all` builds the tools). Mutating daemon verbs (`start stop restart reload enable disable`) fanned out with `all` are refused without `--yes`; preview them with `--dry-run`. Fan-out follows registry `after=` dependencies: `start`/`restart`/ `enable` bring dependencies up first, `stop`/`disable` tear dependents down first. ## Options, help topics, and exit codes ``` sleelactl [--dry-run] [--yes|-y] [--json] [args] sleelactl list [nature|registry-module] status [module|all] sleelactl natures [--markdown] help [verb|module|nature] sleelactl check-registry [--strict] keys [--markdown] sleelactl where completion bash|zsh version ``` - `--dry-run` prints the exact action (for daemons, the service-manager command, including `sudo` when it would be used) and changes nothing. `--yes` confirms an `all` fan-out of a mutating daemon verb. Both may also follow `all` (`sleelactl stop all --yes`). - `--json` gives machine-readable output for `list`, `status`, `natures`, `keys`, and `where` (other commands reject it with exit 2). `status` entries carry `module`, `nature`, `state` (`ok`, `failed`, `unavailable`, `none`), `exit`. - `help ` lists the natures and modules that accept the verb; `help ` lists its verbs and modules; an unknown topic exits 2. - `where` (alias `doctor`) prints the resolved root, registry (and whether it came from beside the script, an installed layout, or `SLEELACTL_REGISTRY`), registry format, runtime and version, Python, and service manager. - `completion bash|zsh` prints a completion script generated from the registry: `eval "$(sleelactl completion bash)"` (or `zsh`). `make -C install install` also writes both to `/share/sleela/completions/` (`sleelactl.bash`, `sleelactl.zsh`) — source one from your shell profile. - `keys [--markdown]` prints the registry key schema (see below). - Diagnostics go to stderr, results to stdout. `SLEELACTL_VERBOSE=1` shows the full `sleela` stderr (verification preamble included); by default it is suppressed on success and the last diagnostic lines are printed on failure. | Exit | Meaning | | --- | --- | | 0 | success | | 1 | the operation ran and failed, or the module is not present in this install | | 2 | usage error: unknown module/nature/option/topic, bad arguments, missing `--yes`, missing `SLEELACTL_REGISTRY` file, an unsafe registry entry, or an untrusted override asked to escalate with `sudo` | | 3 | mechanism unavailable (no service manager or no mapping for it, runtime not built, simulator or CLI not built) | | 64 | the verb is not legal for the module's nature | `status all` returns non-zero when any controllable module fails or cannot be checked. Protocol `validate` prefers a `validate` target, then `syntax`, then `test`. Tool `run`/`inspect` execute only the CLI named by the registry's `bin=` (searched in `build/`, `build/Release/`, `build/stage/bin/`, `cli/`, `bin/`, or the tool directory) — never "the first executable found". ### Service managers Daemon verbs go through an adapter selected by `SLEELACTL_SERVICE_MANAGER` (`auto` by default: systemd if `systemctl` exists, launchd on macOS, the Windows SCM if `sc.exe` exists, else `none`). Each daemon names its service per manager in the registry: `unit=` (systemd), `launchd=` (launchd label), `winsvc=` (Windows service). A daemon with no mapping for the active manager exits 3 instead of guessing. | Verb | systemd | launchd | Windows SCM | | --- | --- | --- | --- | | start | `systemctl -- start ` | `launchctl kickstart /