pub enum Command {
Show 22 variants
NewKey {
key_id: String,
key_type: KeyTypeArg,
},
Import {
key_id: String,
key_type: KeyTypeArg,
seed_hex: Option<String>,
pkcs8_file: Option<PathBuf>,
check: bool,
},
ImportSet {
file: PathBuf,
check: bool,
},
Sign {
key_id: String,
payload: String,
},
Verify {
key_id: String,
signature: String,
payload: String,
},
Encrypt {
key_id: String,
algorithm: AeadAlg,
aad_hex: Option<String>,
plaintext: String,
},
Decrypt {
key_id: String,
algorithm: AeadAlg,
version: u32,
nonce: String,
ciphertext: String,
aad_hex: Option<String>,
},
Get {
key_id: String,
version: Option<u32>,
raw: bool,
format: Option<GetOutputFormatArg>,
out_file: Option<PathBuf>,
},
IssueNatsCreds {
jwt: Option<String>,
jwt_file: Option<PathBuf>,
seed: Option<String>,
seed_file: Option<PathBuf>,
out_file: PathBuf,
mode: SecretFileModeArg,
},
Set {
key_id: String,
hex: bool,
value: String,
},
Rotate {
key_id: String,
},
List {
prefix: Option<String>,
},
MintJwt {
key_id: String,
sub: String,
ttl_secs: Option<u64>,
claims_json: String,
},
MintNatsUser {
key_id: String,
user_nkey: String,
issuer_account: Option<String>,
name: String,
ttl_secs: Option<u64>,
pub_allow: Vec<String>,
pub_deny: Vec<String>,
sub_allow: Vec<String>,
sub_deny: Vec<String>,
},
SignNatsJwt {
key_id: String,
claims_json: Option<String>,
claims_file: Option<PathBuf>,
expect_type: Option<NatsJwtTypeArg>,
ttl_secs: Option<u64>,
expires_at_unix: Option<u64>,
issued_at_unix: Option<u64>,
rewrite_jti: bool,
},
IssueCert {
key_id: String,
common_name: String,
dns_san: Vec<String>,
ip_san: Vec<String>,
ttl_secs: u64,
},
Status,
Health {
json: bool,
},
Ready {
json: bool,
},
Reload {
check: bool,
json: bool,
},
Explain {
subject: String,
op: String,
key: String,
json: bool,
},
Revoke {
trust_domain: String,
jti: String,
expires_at_unix: u64,
json: bool,
},
}Variants§
NewKey
Create a new asymmetric key.
Import
Import caller-provided (BYOK) key material into a catalog key. The broker
fetches the backend transit wrapping_key, wraps the material with
RSA-OAEP + AES-KWP in place, and POSTs it to keys/<k>/import; the raw
material never lands on the backend unwrapped. Supply exactly one material
source: --seed-hex (64 hex chars = a 32-byte Ed25519 seed; Ed25519-only)
or --pkcs8-file (a PKCS#8 DER private key for Ed25519/RSA/P-256).
Prints the key_id + public_key hex.
Fields
key_type: KeyTypeArgKey type of the imported material.
ImportSet
Import several keys from a JSON manifest in one all-or-nothing call. The
broker authorizes import on EVERY entry before importing ANY, so an
unauthorized entry rejects the whole batch and creates no keys. The
manifest is a JSON array of objects: {"key_id": "...", "key_type": "ed25519", "seed_hex": "<64 hex>"} or with "pkcs8_file": "<path>"
instead of "seed_hex". Raw seeds are Ed25519-only; RSA/P-256 use
PKCS#8 DER. key_type defaults to ed25519 when omitted.
Prints one key_id/public_key pair per imported key.
Fields
Sign
Sign a payload and print the signature as hex.
Verify
Verify a payload signature.
Encrypt
Encrypt a payload and print envelope fields.
Decrypt
Decrypt an envelope and print plaintext as hex.
Fields
Get
Fetch a value key. Prints version + hex value by default; --raw writes
the bytes to stdout and --out-file writes them to a 0600 file. Use
--format base64 when materializing secrets for consumers that require
standard padded Base64.
Basil attests the caller by its kernel SO_PEERCRED uid/gid, so to fetch a
secret as a particular service, run this CLI under that service’s identity
(systemd User=/Group=, or runuser -u <svc>); the CLI cannot impersonate.
Fields
format: Option<GetOutputFormatArg>Encode the value as raw, hex, standard padded base64, or
URL-safe unpadded Base64. When set, stdout prints only the value and
--out-file writes the encoded value instead of raw bytes.
IssueNatsCreds
Assemble a local NATS user .creds file from a signed user JWT and
user NKey seed. This is local file plumbing: mint/sign the JWT first,
then call this command to render the canonical credentials document.
Fields
jwt: Option<String>Signed compact NATS user JWT. Prefer --jwt-file for automation so
secrets do not appear in argv.
mode: SecretFileModeArgDestination file mode.
Set
Store a value key from text or hex.
Rotate
Rotate a key and print the new version.
List
List visible catalog keys.
MintJwt
Mint a generic JWT.
MintNatsUser
Mint a NATS user JWT signed by an account key held by Basil.
When --key-id is an account signing key (not the account identity
key), pass --issuer-account with the owning account’s identity public
NKey (A…); otherwise the minted user carries no issuer_account and
nats-server rejects the connection with an authorization violation. Omit
--issuer-account when --key-id is the account identity key itself.
Fields
SignNatsJwt
Validate and sign a caller-supplied NATS JWT claim document.
Fields
expect_type: Option<NatsJwtTypeArg>IssueCert
Issue a DNS/IP-SAN X.509 leaf (TLS cert) from a backend PKI engine, signed
by the issuer CA the broker holds in place. Prints the leaf+chain and the
issuing-CA chain as CERTIFICATE PEM blocks and the leaf key as a
PRIVATE KEY PEM block, so the output pipes into openssl x509/openssl pkey. The issuing CA key never leaves the backend.
Fields
Status
Print the agent backend, version, and protocol.
Health
Liveness probe: is the agent process up and serving the socket? Cheap; the
agent does no backend I/O. Exits 0 when alive, nonzero on a connect/RPC
failure. With --json, prints a stable one-line JSON object for automation
(systemd WatchdogSec companion, container liveness check).
Ready
Readiness probe: can the agent actually serve data-plane ops? The agent
probes every backend and catalog key and returns a non-secret summary.
Exits 0 when ready, 1 when not ready (and nonzero on a connect/RPC
failure). With --json, prints a stable one-line JSON object for
automation (systemd ExecStartPost, container HEALTHCHECK, k8s readiness
probe). Never prints key names or secret material.
Reload
Hot-reload the agent’s catalog/policy generation FROM DISK. The agent
re-reads the catalog/policy from the paths it was started with (the request
carries NO config: config can never be supplied over the wire), validates
the candidate, and atomically swaps in a new generation on success. Prints
the old->new generation id + key/grant counts. Requires the dedicated
reload permission (not implied by any data-plane grant); a caller lacking
it is denied. Exits 0 on success, nonzero on rejection or permission-denied.
With --check, validates the candidate WITHOUT swapping (dry-run).
Fields
Explain
Ask the running agent why a subject would be allowed or denied for a
given operation and key. Requires the dedicated explain admin permission.
Fields
Revoke
Revoke a JWT-SVID by trust-domain and jti. Requires the dedicated
revoke admin permission over broker.revoke and a configured
persistent revocation_store=jwt-svid value key.
Trait Implementations§
Source§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request