Skip to main content

Module cli

Module cli 

Source
Expand description

rightkit-control command-line dispatch. Every effectful subcommand is admitted through one EffectGate (EFF-001); read-only subcommands (trusted, frontmost, windows, ax, find) are not effects.

Global options (before the subcommand):

  • --policy <file> (or RIGHTKIT_CONTROL_POLICY=<file>): admission policy (see Policy). Without one the gate is allow-all, so behaviour is unchanged, but every effect is still validated and settled. A policy that cannot be read or parsed is fatal (exit 2); it never falls back to allow-all.
  • --events (or RIGHTKIT_CONTROL_EVENTS=stderr): print content-free lifecycle events to stderr.

Exit codes: 0 ok, 1 failed, 2 usage/configuration, 3 denied by admission, 4 cancelled.

Structs§

CliConfig
Global CLI configuration.
Policy
A file-configured admission hook. Line format (# starts a comment):

Constants§

USAGE

Functions§

exit_code
Exit code for a settled effect; prints the refusal/failure to stderr.
gate_for
Build the CLI gate: allow-all unless a policy is configured.
parse_global
Split leading global options from the subcommand arguments. env is consulted for RIGHTKIT_CONTROL_POLICY / RIGHTKIT_CONTROL_EVENTS; flags win over the environment.