Skip to main content

Global options

The Mesmer CLI has several options that you can use to change functionality across every command. They're grouped into a few general categories:

Formatting and Querying Output#

Every subcommand's output has two forms: human-readable text, and JSON. You can pick which one you want with the --json flag, of with the MESMER_OUTPUT_JSON environment variable:

# Get output as JSON$ mesmer --json build list
# Alternatively: set this with an environment variable$ MESMER_OUTPUT_JSON=true mesmer build list
# Get output as a table$ mesmer build list

If you happen to have jq installed on your system, you can run queries over this JSON output with the --query flag (abbreviated as -q), or the MESMER_OUTPUT_QUERY environment variable:

# Output a plaintext list of device UDIDs$ mesmer -q '.[].udid' device list
# Alternatively: set this with an environment variable$ MESMER_OUTPUT_QUERY=".[].udid" device list

jq's raw output mode is enabled by default here, so you can use the --query flag to integrate the Mesmer CLI easily with other standard UNIX commands:

# Print detailed build metadata, for every build in the current project:$ mesmer -q ".[]._id" build list | xargs -L1 mesmer build describe

Batch and Interactive Mode#

By default, mesmer detects whether stdin or stdout is a TTY, and uses that to enable or disable interactive prompts and formatting. You can override this detection with the --interactive and --batch flags:

# Never show progress indicators$ mesmer --batch submit binary.apk
# Always show progress indicators$ mesmer --interactive submit binary.apk
# Never prompt to select a project$ mesmer --batch project list

Project, Tenant, and Token#

mesmer will look for authentication information in auth.yml, located in the config directory; and it will look for project and tenant information in .mesmer.yml in the current directory (see: mesmer init). If you want to override this, you can use the --tenant, --project, and --token global options.

# List builds in $project_id$ mesmer --project $project_id build list
# Describe a project$ mesmer --tenant my.tenant.here.mesmerhq.com --project $project_id project describe
# Override the auth token from `auth.yml`$ mesmer --token $auth_token device list

You can also pass these variables in via the environment, which is useful in a CI workflow:

$ export MESMER_TENANT="[your tenant hostname]"$ export MESMER_AUTH_TOKEN="[your auth token]"$ export MESMER_PROJECT="[your project id]"$ mesmer submit application.apk

These values, whether passed in via parameter or the environment, will override those found in auth.yml and .mesmer.yml.