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)].
All fields are resolved from MA_* environment variables, a YAML config
file, and built-in defaults — in that priority order.
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.
Environment variable: MA_SLUG
log_level: Option<String>Log level for the log file (trace, debug, info, warn, error).
Environment variable: MA_LOG_LEVEL. Falls back to YAML → default "info".
log_file: Option<PathBuf>Path to the log file. Defaults to XDG_DATA_HOME/ma/<slug>.log.
Environment variable: MA_LOG_FILE. Falls back to YAML → XDG default.
log_level_stdout: Option<String>Log level for stdout output (trace, debug, info, warn, error).
Environment variable: MA_LOG_LEVEL_STDOUT. Falls back to 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.
Environment variable: MA_DID_RESOLVER_POSITIVE_TTL_SECS. Falls back to 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.
Environment variable: MA_DID_RESOLVER_NEGATIVE_TTL_SECS. Falls back to YAML → default 10.
secret_bundle: Option<PathBuf>Path to the encrypted secret bundle file.
Defaults to XDG_CONFIG_HOME/ma/<slug>.bin.
Environment variable: MA_SECRET_BUNDLE. Falls back to 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.
Environment variable: MA_SECRET_BUNDLE_PASSPHRASE. Falls back to YAML.
kubo_rpc_url: Option<String>Kubo RPC API URL. Defaults to http://127.0.0.1:5001.
Environment variable: MA_KUBO_RPC_URL. Falls back to YAML → default.
kubo_key_alias: Option<String>IPNS key alias used in Kubo. Defaults to the slug.
Environment variable: MA_KUBO_KEY_ALIAS. Falls back to 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