Configuration
mpx reads credentials and settings from two INI files with named profiles.Credentials (your
app_id and app_key) live in ~/.mpx/credentials; other settings (endpoint,default output) live in
~/.mpx/config. Override the directory with MPX_CONFIG_DIR.Interactive setup
mpx configure
prompts for each value and writes both files. The credentials file is written
not world-readable, and secrets never go in the config file. Configure another profile with
0600 so your keys arenot world-readable, and secrets never go in the config file. Configure another profile with
--profile:mpx configure --profile work
Precedence
For every setting, the first value found wins: flag, then environment variable, then the profile
file.
file.
| setting | flag | environment | file |
|---|---|---|---|
| app_id | --app-id |
MATHPIX_APP_ID |
credentials |
| app_key | --app-key |
MATHPIX_APP_KEY |
credentials |
| endpoint | --endpoint |
MPX_ENDPOINT |
config |
| output | --output |
MPX_OUTPUT |
config |
| verbosity | --verbosity |
MPX_VERBOSITY |
config |
| profile | --profile |
MPX_PROFILE |
— |
Progress and verbosity
A
terminal: an animated spinner with a percent bar and page count as the pages are recognized. It is
drawn only on a terminal, so redirected output and log files stay clean.
convert that submits a document and polls for the result shows a live progress indicator on theterminal: an animated spinner with a percent bar and page count as the pages are recognized. It is
drawn only on a terminal, so redirected output and log files stay clean.
The
verbosity setting controls it, with two values:normal(the default) shows the progress indicator.quiethides it.
Set it per command with
session with
--quiet (shorthand for --verbosity quiet) or --verbosity quiet, for thesession with
MPX_VERBOSITY=quiet, or permanently in a profile with mpx configure (orverbosity = quiet in ~/.mpx/config):mpx --quiet scs convert paper.pdf paper.mmd
Endpoint
The endpoint defaults to
at a private deployment:
https://api.mathpix.com. Point it at the EU region for data residency, orat a private deployment:
mpx --endpoint https://eu.api.mathpix.com scs convert paper.pdf paper.mmd
Profiles
Select a profile per command with
independent set of credentials and settings, so one machine can hold several identities:
--profile NAME (or set MPX_PROFILE). Each profile is anindependent set of credentials and settings, so one machine can hold several identities:
mpx --profile work scs convert paper.pdf paper.mmd