Skip to main content

decdn_common/cli/
whoami.rs

1//! Arguments for the `decdn whoami` subcommand.
2
3use std::path::PathBuf;
4
5use clap::Args;
6
7/// Print the local identity — iroh node id, eth address, and the resolved key
8/// paths — read-only, without generating or rotating any keys.
9#[derive(Args, Debug)]
10pub struct WhoamiArgs {
11    /// Directory holding the keys. Overrides `identity.data_dir` from the
12    /// config file; when neither is set, defaults to `~/.decdn`.
13    #[arg(long, value_name = "DIR")]
14    pub output_dir: Option<PathBuf>,
15
16    /// File whose contents are the keystore password, used to decrypt the eth
17    /// address when it is available. Consulted after the
18    /// `DECDN_KEYSTORE_PASSWORD` env var and before an interactive prompt on a
19    /// TTY. A single trailing newline is stripped. When no password source is
20    /// available, the node id and paths still print and the eth address is
21    /// reported as needing a password. A path that does not exist falls
22    /// through; one that exists but cannot be read is an error.
23    #[arg(long, value_name = "PATH", env = "DECDN_KEYSTORE_PASSWORD_FILE")]
24    pub keystore_password_file: Option<PathBuf>,
25}