> For the complete documentation index, see [llms.txt](/llms.txt).

# Use the CLI directly

Run `mm` commands yourself when you are testing, scripting, or operating in CI without an AI agent. For day-to-day use, prefer [Quickstart](/agent-wallet/quickstart/) and prompt your agent in natural language.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

- [Quickstart](/agent-wallet/quickstart/) completed (CLI installed and signed in)
- An Early Access invite from [MetaMask Agent Wallet Early Access](https://metamask.io/agent-wallet)

## 1. Install the CLI[​](#1-install-the-cli "Direct link to 1. Install the CLI")

- npm
- Yarn
- pnpm
- Bun

```
npm install -g @metamask/agentic-cli

```

```
yarn global add @metamask/agentic-cli

```

```
pnpm add -g @metamask/agentic-cli

```

```
bun add --global @metamask/agentic-cli

```

## 2. Sign in[​](#2-sign-in "Direct link to 2. Sign in")

```
mm login
mm auth status

```

During `mm login`, choose QR code, Google, or email. Your sign-in method also determines how you receive 2FA approvals when a transaction needs your confirmation:

| Sign-in method  | 2FA delivery                        |
| --------------- | ----------------------------------- |
| QR code         | MetaMask Mobile push notification   |
| Google or email | Email link with transaction details |

For headless or CI environments:

```
mm login google --no-wait
mm login --token "<cliToken:cliRefreshToken>"

```

## 3. Initialize wallet[​](#3-initialize-wallet "Direct link to 3. Initialize wallet")

Run `mm init` and follow the prompts to choose wallet mode and trading mode, or pass flags explicitly.

### Wallet modes[​](#wallet-modes "Direct link to Wallet modes")

#### Server-wallet[​](#server-wallet "Direct link to Server-wallet")

Your private key is held securely in a TEE-backed environment. MetaMask manages key material; you retain self-custody and can export your secret recovery phrase when supported by your account.

```
mm init --wallet server-wallet --mode guard

```

Server-wallet mode uses an asynchronous signing model. Long-running operations return a `pollingId` unless you pass `--wait`.

#### BYOK (bring your own key)[​](#byok-bring-your-own-key "Direct link to BYOK (bring your own key)")

You supply a BIP-39 mnemonic. Useful when you need local key control or an existing seed phrase.

Never pass `--mnemonic` on the command line. Set the `MM_MNEMONIC` environment variable instead:

```
export MM_MNEMONIC="word1 word2 ..."
mm init --wallet byok

```

Optionally encrypt the mnemonic at rest with `MM_PASSWORD` or `mm wallet password set`.

### Trading modes (server-wallet only)[​](#trading-modes-server-wallet-only "Direct link to Trading modes (server-wallet only)")

| Mode       | CLI flag     | Behavior                                                                                                                                                       |
| ---------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Guard Mode | --mode guard | Enforces spend limits and allowlists. 2FA is required when a transaction exceeds those limits, targets a non-allowlisted protocol, or is flagged as high risk. |
| Beast Mode | --mode beast | Skips routine policy checks for scripted workflows. 2FA still applies to malicious or flagged transactions.                                                    |

Switch modes by re-running `mm init` with a different `--mode` value.

### View current settings[​](#view-current-settings "Direct link to View current settings")

```
mm init show

```

## 4. Show your address[​](#4-show-your-address "Direct link to 4. Show your address")

```
mm wallet address

```

Fund this address on the chain you plan to use.

## 5. Send your first transfer[​](#5-send-your-first-transfer "Direct link to 5. Send your first transfer")

```
mm transfer --to <ADDRESS> --amount 0.001 --token native --chain-id 8453 --wait

```

## Machine-readable output[​](#machine-readable-output "Direct link to Machine-readable output")

Pass `--format json` or `--json` for scripts and automation:

```
mm wallet balance --chain 8453 --json
mm auth status --json

```

## Next steps[​](#next-steps "Direct link to Next steps")

- [Commands reference](/agent-wallet/reference/commands/)
- [Troubleshooting](/agent-wallet/troubleshooting/)
