registry
registry
¶
Command registry for terok-clearance.
Provides CommandDef and ArgDef dataclasses describing
every terok-clearance subcommand. The COMMANDS tuple is the single
source of truth consumed by both the standalone CLI and the terok
integration layer (terok dbus …).
Handler functions are async coroutines accepting **kwargs that match
the declared ArgDef names.
COMMANDS = (CommandDef(name='notify', help='Send a one-shot desktop notification', handler=_handle_notify, args=(ArgDef(name='summary', help='Notification title'), ArgDef(name='body', nargs='?', default='', help='Notification body text'), ArgDef(name='-t/--timeout', dest='timeout', type=int, default=(-1), help='Expiration timeout in milliseconds (-1 = server default)'))), CommandDef(name='serve', help='Run the clearance hub (serves org.terok.Clearance1 varlink on a unix socket)', handler=_handle_serve), CommandDef(name='serve-verdict', help='Run the verdict helper (serves org.terok.ClearanceVerdict1 for shield exec)', handler=_handle_serve_verdict), CommandDef(name='install-service', help="Install the terok-clearance systemd user unit (systemctl --user daemon-reload'd)", handler=_handle_install_service, args=(ArgDef(name='--bin-path', dest='bin_path', help='Override the resolved terok-clearance-hub launcher path'),)), CommandDef(name='clearance', help='Interactive terminal tool for shield clearance verdicts', handler=_handle_clearance))
module-attribute
¶
ArgDef(name, help='', type=None, default=None, action=None, dest=None, nargs=None)
dataclass
¶
Definition of a single CLI argument for a command.
name
instance-attribute
¶
help = ''
class-attribute
instance-attribute
¶
type = None
class-attribute
instance-attribute
¶
default = None
class-attribute
instance-attribute
¶
action = None
class-attribute
instance-attribute
¶
dest = None
class-attribute
instance-attribute
¶
nargs = None
class-attribute
instance-attribute
¶
CommandDef(name, help='', handler=None, args=())
dataclass
¶
Definition of a terok-clearance subcommand.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Subcommand name (e.g. |
help |
str
|
One-line help string for |
handler |
Callable[..., Coroutine[Any, Any, None]] | None
|
Async callable implementing the command logic. |
args |
tuple[ArgDef, ...]
|
CLI arguments beyond the subcommand name. |