Skip to content
machinemail

config

Read and change CLI settings (config file, keys masked). The `machinemail config` commands: arguments, flags, examples and the API routes they call.

Read and change CLI settings (config file, keys masked).

CommandSummary
config getPrint the value of a config key in effect
config listPrint the config file, keys masked
config pathPrint the config file path
config setSet a config key
config unsetRemove 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.

shell
machinemail config get <key>

Arguments

<key>stringRequired
base_url | api_key | current_profile | update_check

Examples

shell
machinemail config get base_url
machinemail config get api_key --profile staging
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.

shell
machinemail config list

Examples

shell
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.

shell
machinemail config path

Examples

shell
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.

shell
machinemail config set <key> <value>

Arguments

<key>stringRequired
base_url | api_key | current_profile | update_check
<value>stringRequired
New value (- reads stdin)

Examples

shell
machinemail config set base_url http://127.0.0.1:8080 --profile local
machinemail config set update_check true
machinemail config set current_profile staging
printf %s "$KEY" | machinemail config set api_key - --profile ci

config unset

Remove a config key (back to its default).

shell
machinemail config unset <key>

Arguments

<key>stringRequired
base_url | api_key | current_profile | update_check

Examples

shell
machinemail config unset base_url --profile local
machinemail config unset update_check