pub struct MaArgs {
pub config: Option<PathBuf>,
pub slug: Option<String>,
pub log_level: Option<String>,
pub log_file: Option<PathBuf>,
pub log_level_stdout: Option<String>,
pub did_resolver_positive_ttl_secs: Option<u64>,
pub did_resolver_negative_ttl_secs: Option<u64>,
pub secret_bundle: Option<PathBuf>,
pub secret_bundle_passphrase: Option<String>,
pub kubo_rpc_url: Option<String>,
pub kubo_key_alias: Option<String>,
pub gen_headless_config: bool,
}Expand description
Standard ma-core CLI arguments.
Add these to your binary with #[command(flatten)].
MA_CONFIG and MA_SLUG are the only statically-named environment
variables; all other fields are resolved dynamically in
super::Config::from_args using the binary’s compile-time MA_DEFAULT_SLUG
constant as a prefix (e.g. MA_PANTEIA_LOG_LEVEL), with a plain
MA_LOG_LEVEL-style fallback.
Fields§
§config: Option<PathBuf>Path to the YAML config file. Overrides the slug-derived default
(XDG_CONFIG_HOME/ma/<slug>.yaml).
Environment variable: MA_CONFIG
slug: Option<String>Runtime slug. Overrides MA_DEFAULT_SLUG for file naming
(<slug>.yaml, <slug>.bin, <slug>.log) only.
The env-var prefix MA_<MA_DEFAULT_SLUG>_* is always determined by
the compile-time constant — this value does not change the prefix.
Environment variable: MA_SLUG
log_level: Option<String>Log level for the log file (trace, debug, info, warn, error).
Resolved via MA_<MA_DEFAULT_SLUG>_LOG_LEVEL → MA_LOG_LEVEL → YAML
→ default "info".
log_file: Option<PathBuf>Path to the log file. Defaults to XDG_DATA_HOME/ma/<slug>.log.
Resolved via MA_<MA_DEFAULT_SLUG>_LOG_FILE → MA_LOG_FILE → YAML
→ XDG default.
log_level_stdout: Option<String>Log level for stdout output (trace, debug, info, warn, error).
Resolved via MA_<MA_DEFAULT_SLUG>_LOG_LEVEL_STDOUT →
MA_LOG_LEVEL_STDOUT → YAML → default "warn".
did_resolver_positive_ttl_secs: Option<u64>Positive DID cache TTL in seconds.
Set to 0 to disable caching successful DID resolutions.
Resolved via MA_<MA_DEFAULT_SLUG>_DID_RESOLVER_POSITIVE_TTL_SECS →
MA_DID_RESOLVER_POSITIVE_TTL_SECS → YAML → default 60.
did_resolver_negative_ttl_secs: Option<u64>Negative DID cache TTL in seconds.
Set to 0 to disable caching failed DID resolutions.
Resolved via MA_<MA_DEFAULT_SLUG>_DID_RESOLVER_NEGATIVE_TTL_SECS →
MA_DID_RESOLVER_NEGATIVE_TTL_SECS → YAML → default 10.
secret_bundle: Option<PathBuf>Path to the encrypted secret bundle file.
Defaults to XDG_CONFIG_HOME/ma/<slug>.bin.
Resolved via MA_<MA_DEFAULT_SLUG>_SECRET_BUNDLE →
MA_SECRET_BUNDLE → YAML → XDG default.
secret_bundle_passphrase: Option<String>Passphrase to unlock the secret bundle.
In headless configs this is stored in cleartext in the YAML file. Prefer setting via environment variable rather than CLI to avoid shell history exposure.
Resolved via MA_<MA_DEFAULT_SLUG>_SECRET_BUNDLE_PASSPHRASE →
MA_SECRET_BUNDLE_PASSPHRASE → YAML.
kubo_rpc_url: Option<String>Kubo RPC API URL. Defaults to http://127.0.0.1:5001.
Resolved via MA_<MA_DEFAULT_SLUG>_KUBO_RPC_URL →
MA_KUBO_RPC_URL → YAML → default.
kubo_key_alias: Option<String>IPNS key alias used in Kubo. Defaults to the slug.
Resolved via MA_<MA_DEFAULT_SLUG>_KUBO_KEY_ALIAS →
MA_KUBO_KEY_ALIAS → YAML → slug.
gen_headless_config: boolGenerate a headless config with a fresh secret bundle, write both files with 0600 permissions, and exit.
If --secret-bundle-passphrase is not provided, a random passphrase
is generated and written into the config file.
Trait Implementations§
Source§impl Args for MaArgs
impl Args for MaArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl FromArgMatches for MaArgs
impl FromArgMatches for MaArgs
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(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for MaArgs
impl RefUnwindSafe for MaArgs
impl Send for MaArgs
impl Sync for MaArgs
impl Unpin for MaArgs
impl UnsafeUnpin for MaArgs
impl UnwindSafe for MaArgs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more