Expand description
CLI shell over the library’s typed lifecycle drivers.
The typed core — the LifecycleService trait, driver functions
(create, enable, disable, show, delete, status_for),
and the *Outcome types — lives in
zad::service::lifecycle. This module adds the CLI-only layer:
CliLifecycle— extendsLifecycleServicewith aclap::Args-derivedCreateArgsassociated type and an interactiveresolvestep that turns CLI flags into(Cfg, Secrets).- clap arg structs —
CreateArgsBase,BotTokenArgs,ScopesArg,EnableArgs,DisableArgs,ShowArgs,StatusArgs,DeleteArgs. Per-serviceCreateArgsflatten these in. run_*driver wrappers that prompt where needed, call into the library drivers, and render the typed*Outcomevalues to stdout in human or JSON form.resolve_bot_token/resolve_scopes— the only placesdialogueris invoked from inside the lifecycle layer.
Structs§
- BotToken
Args - Drop-in clap flags for a single bot-token credential.
- Create
Args Base - Flags every
zad service create <name>accepts. - Delete
Args - Disable
Args - Enable
Args - Project
Block - Scope
Block - Per-scope view of credentials, for
show/statusoutput. - Scopes
Arg - Drop-in clap flag for the common “comma-separated scopes” pattern.
- Secret
Ref - One OS-keychain entry belonging to a service.
- Service
Status Output - Per-service envelope for
zad service status --service <svc>. - Show
Args - Status
Args - Status
Block - One scope’s view for status.
checkis populated only for the effective scope. - Status
Check
Traits§
- CliLifecycle
- CLI-side extension of the library’s
LifecycleService. Adds the clap-derivedCreateArgsshape and the interactiveresolvestep. Implementors live incli/service_<name>.rsalongside theirLifecycleServiceimpl. - Create
Args Like - Lets the driver read
CreateArgsBaseout of a service-specific wrapper. - Lifecycle
Service - Library-shaped lifecycle plumbing for one service. Implement this
when adding a new service so the typed
create/enable/ … driver functions below work for it.
Functions§
- leak
- Leak an owned
Stringto satisfyScope::Project(&'a str). Safe in fire-and-forget binaries: the process runs one command and exits, so the “leak” ends with the process. Library callers in long-lived processes should constructScope::Project(&slug)from a string they own and avoid this helper. - resolve_
bot_ token - resolve_
scopes - run_
create - run_
delete - run_
disable - run_
enable - run_
show - run_
status - Run
zad service status --service <svc>for serviceT. Emits JSON or human output, then exits the process with code 1 if the effective scope failed its live ping. - status_
for - Collect the status envelope for service
Twithout emitting anything. Pings only the effective scope.