Motivation MoneyMotivation Money

CLI

Install and configure the Motivation Money command-line interface.

The Motivation Money CLI (mp) gives you terminal access to payroll runs, team management, treasury, audit logs, and webhooks. It's built for operators who prefer the command line and for AI agents that work through shell execution.

Install

npm install -g @motivation-money/cli

This installs the mp command globally.

Authentication

Authenticate with an API key from the Motivation Money dashboard (Settings > API Keys):

mp auth login --key mpk_live_<your-key>

Credentials are stored in ~/.mp/credentials.json with restricted file permissions (mode 0600). The CLI uses the same API key scopes as the REST API.

Check your auth status:

mp auth status

Log out (clears stored credentials):

mp auth logout

Configuration

View current config:

mp config

Set the API base URL (useful for self-hosted or staging environments):

mp config --set-url https://your-instance.example.com/api/v1

Set the default output format:

mp config --set-format json

Config is stored in ~/.mp/config.json. The default base URL is https://motivation-money.vercel.app/api/v1.

Output Formats

Every command supports three output formats via -f, --format:

FormatDescription
tableHuman-readable ASCII table (default in terminal)
jsonStructured JSON (default when piped)
csvComma-separated values

The CLI auto-detects piped output and switches to JSON, so commands like mp runs list | jq '.data[0]' work without extra flags.

Global Options

OptionDescription
--base-url <url>Override API base URL for a single command
-f, --format <fmt>Output format: table, json, or csv

Error Handling

The CLI retries failed requests automatically (up to 2 retries). Rate-limited responses (429) respect the Retry-After header. If you're not authenticated, commands return:

Not authenticated. Run: mp auth login --key <your-api-key>

Next

See the command reference for the full list of commands.

On this page