config · MachineMail Docs
config get
Read and change CLI settings (config file, keys masked).
| Command | Summary |
|---|---|
config get |
Print the value of a config key in effect |
config list |
Print the config file, keys masked |
config path |
Print the config file path |
config set |
Set a config key |
config unset |
Remove a config key (back to its default) |
Every command also takes the global flags.
config get
Print the value of a config key in effect.
Prints the value the CLI will actually use, after flags and environment variables (so base_url is the default when nothing is set). api_key is always masked. With —json it also says where the value came from.
machinemail config get <key>
Arguments
| Field | Description |
|---|---|
<key> |
string Required |
base_url api_key current_profile update_check |
Examples
machinemail config get base_url
machinemail config get api_key --profile work
machinemail config get current_profile --json
config list
Print the config file, keys masked.
Also: machinemail config ls, machinemail config show.
Every value stored in the config file as key=value lines, with API keys masked. Use machinemail config get <key> for the value in effect after flags and environment variables.
machinemail config list
Examples
machinemail config list
machinemail config list --json
config path
Print the config file path.
The config file is $XDG_CONFIG_HOME/machinemail/config.json (or ~/.config/machinemail/config.json), written with mode 0600. MACHINEMAIL_CLI_CONFIG points at another file.
machinemail config path
Examples
machinemail config path
ls -l "$(machinemail config path)"
config set
Set a config key.
Per-profile keys (base_url, api_key) go to the current profile, or the one named with —profile, which is created if needed. For api_key pass - to read it from stdin; machinemail login is better, since it checks the key first.
machinemail config set <key> <value>
Arguments
| Field | Description |
|---|---|
<key> |
string Required |
base_url api_key current_profile update_check |
|
<value> |
string Required |
New value (- reads stdin) |
Examples
machinemail config set update_check true
machinemail config set current_profile work
printf %s "$KEY" | machinemail config set api_key - --profile ci
config unset
Remove a config key (back to its default).
machinemail config unset <key>
Arguments
Examples
machinemail config unset api_key --profile work
machinemail config unset update_check