| name | moonpay-auth |
| description | Set up the MoonPay CLI, authenticate, and manage local wallets. Use when commands fail, for login, or to create/import wallets. |
| tags | ["setup"] |
MoonPay auth and setup
Install
npm i -g @moonpay/cli
This installs the mp (and moonpay) binary globally.
Verify installation
mp --version
mp --help
Auth commands
mp login --email user@example.com
mp verify --email user@example.com --code 123456
mp user retrieve
mp logout
Local wallet management
The CLI manages local wallets stored encrypted in ~/.config/moonpay/wallets.json. Private keys are encrypted with AES-256-GCM using a random key stored in your OS keychain. No password required — keys never leave the machine.
mp wallet create --name "my-wallet"
mp wallet import --name "restored" --mnemonic "word1 word2 ..."
mp wallet import --name "imported" --key <hex-key> --chain ethereum
mp wallet list
mp wallet retrieve --wallet "my-wallet"
mp wallet export --wallet "my-wallet"
mp wallet delete --wallet "my-wallet" --confirm
Workflow
- Run
mp user retrieve to check if authenticated.
- If it fails, run
mp login --email <email>, then mp verify --email <email> --code <code>.
- Run
mp wallet list to see local wallets.
- If no wallets, create one:
mp wallet create --name "default".
Autonomous login
Agents can log in without human intervention if they have access to the user's email. For example, with the gog CLI (Google Workspace):
mp login --email user@example.com
gog gmail search "Your MoonPay verification code" --max-results 1
mp verify --email user@example.com --code <code>
This enables fully autonomous agent setup — no human in the loop.
Config locations
- Wallets:
~/.config/moonpay/wallets.json (encrypted, AES-256-GCM)
- Encryption key: OS keychain (
moonpay-cli / encryption-key)
- Credentials:
~/.config/moonpay/credentials.json (encrypted, AES-256-GCM)
- Config:
~/.config/moonpay/config.json (base URL, client ID)
Security
- Wallet secrets are always encrypted on disk
- Encryption key is stored in macOS Keychain / Linux libsecret
- No password to remember — the OS handles authentication
wallet export requires an interactive terminal (TTY) — agents and scripts cannot extract secrets
- 24-word BIP39 mnemonics (256-bit entropy)
Related skills
- moonpay-swap-tokens — Swap or bridge tokens using local wallets.
- moonpay-check-wallet — Check wallet balances.