CLI reference / database / grant

stado database grant

Invocation

stado database grant [OPTIONS] --consumer <CONSUMERS> <NAME>

Purpose

Grant one or more consumers access to a declared database. Adds each consumer to the declaration and widens that consumer's own Skarbiec grant (`~/.stado/<consumer>-skarbiec-token`) to read the database's credential item, keeping its bearer and every capability it already holds. Granting a consumer already on the list settles its Skarbiec read again; a consumer Skarbiec still refuses is named and the command exits non-zero. The result's `declaration_changed` field reports whether this command added a consumer, not whether Skarbiec granted access. On refusal, the error distinguishes a changed consumer declaration from an unchanged one. Consumers added before a refusal remain declared; retrying settles their credential access again.

Required inputs and options

Input or optionContract
<NAME>Positional input; required or optional as shown in the invocation.
--consumer <CONSUMERS>Command option; required or optional as shown in the invocation.
--jsonEmit machine-readable output

Output and state effect

It performs the operation described above and emits its operator result on standard output or standard error. Any state change is limited to the resources and records named by the purpose and options on this page.

Refusals

  • Before dispatch, Stado refuses a missing required token shown in the invocation, an unknown option, or a value outside a listed value set; argument-usage failures exit with code 2.