> ## Documentation Index
> Fetch the complete documentation index at: https://docs.iron.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Access Iron via the MoonPay CLI (mp). Manage virtual accounts, onramps, KYC verification, wallets, and more from the terminal.

## Iron CLI

In addition to the [REST API](/api-access), Iron can be accessed through the [MoonPay CLI](https://www.moonpay.com/agents) (`mp`). The CLI provides direct terminal access to virtual accounts, fiat-to-stablecoin onramps, KYC verification, wallet management, and more.

Iron is a [MoonPay](https://www.moonpay.com/) Company. The `mp` CLI is the unified command-line tool for all MoonPay products, including Iron.

## Installation

<CodeGroup>
  ```bash Bash theme={null}
  npm install -g @moonpay/cli
  ```
</CodeGroup>

This installs the `mp` binary globally. You can verify the installation with:

<CodeGroup>
  ```bash Bash theme={null}
  mp --version
  ```
</CodeGroup>

## Authentication

Before using any commands, you must authenticate with your MoonPay account.

<Steps>
  <Step>
    Send a verification code to your email.

    <CodeGroup>
      ```bash Bash theme={null}
      mp login --email user@example.com
      ```
    </CodeGroup>
  </Step>

  <Step>
    Verify the code you received.

    <CodeGroup>
      ```bash Bash theme={null}
      mp verify --email user@example.com --code 123456
      ```
    </CodeGroup>
  </Step>
</Steps>

You can check your current session or log out at any time:

<CodeGroup>
  ```bash Bash theme={null}
  mp user retrieve
  mp logout
  ```
</CodeGroup>

## Wallet Management

The CLI manages local wallets stored on your machine. Private keys are encrypted with AES-256-GCM using a key stored in your OS keychain. Keys never leave the device.

### Creating a Wallet

<CodeGroup>
  ```bash Bash theme={null}
  mp wallet create --name "my-wallet"
  ```
</CodeGroup>

This creates a new HD wallet with addresses on Solana, Ethereum, Bitcoin, and Tron.

### Importing a Wallet

You can import an existing wallet from a mnemonic or a private key:

<CodeGroup>
  ```bash Mnemonic theme={null}
  mp wallet import --name "restored" --mnemonic "word1 word2 ..."
  ```

  ```bash Private Key theme={null}
  mp wallet import --name "imported" --key <hex-key> --chain ethereum
  ```
</CodeGroup>

### Managing Wallets

<CodeGroup>
  ```bash Bash theme={null}
  mp wallet list
  mp wallet retrieve --wallet "my-wallet"
  mp wallet delete --wallet "my-wallet" --confirm
  ```
</CodeGroup>

<Note>
  Deleting a wallet is irreversible. Make sure you have exported your mnemonic or private key before deleting.
</Note>

## Virtual Accounts

Virtual accounts let you spin up named virtual bank accounts (IBANs, ACH) that automatically convert incoming fiat into stablecoins and deliver them to a registered wallet. This is the primary Iron product accessible via the CLI.

For more context on virtual accounts, see [Named Virtual Account](/account).

### Setting Up a Virtual Account

<Steps>
  <Step>
    Create an account and start KYC verification.

    <CodeGroup>
      ```bash Bash theme={null}
      mp virtual-account create
      ```
    </CodeGroup>

    This returns a URL to complete identity verification.
  </Step>

  <Step>
    Complete KYC verification. You can check your status or retrieve the verification link at any time.

    <CodeGroup>
      ```bash Bash theme={null}
      mp virtual-account kyc continue
      mp virtual-account retrieve
      ```
    </CodeGroup>

    If verification needs to be restarted:

    <CodeGroup>
      ```bash Bash theme={null}
      mp virtual-account kyc restart
      ```
    </CodeGroup>
  </Step>

  <Step>
    Accept required legal agreements.

    <CodeGroup>
      ```bash Bash theme={null}
      mp virtual-account agreement list
      mp virtual-account agreement accept --contentId <content-id>
      ```
    </CodeGroup>
  </Step>

  <Step>
    Register a wallet to receive stablecoin deliveries. This creates a proof-of-ownership message, signs it locally, and submits the registration in a single command.

    <CodeGroup>
      ```bash Bash theme={null}
      mp virtual-account wallet register --wallet main --chain solana
      ```
    </CodeGroup>

    You can list registered wallets with:

    <CodeGroup>
      ```bash Bash theme={null}
      mp virtual-account wallet list
      ```
    </CodeGroup>
  </Step>
</Steps>

### Creating an Onramp

Once your account is verified and a wallet is registered, you can create an onramp rule that converts incoming fiat into stablecoins.

<CodeGroup>
  ```bash Bash theme={null}
  mp virtual-account onramp create \
    --name "EUR to USDC" \
    --fiat EUR \
    --stablecoin USDC \
    --wallet <registered-wallet-address>
  ```
</CodeGroup>

You can retrieve onramp details (including bank information for wire or ACH transfers), list onramps, or cancel them:

<CodeGroup>
  ```bash Bash theme={null}
  mp virtual-account onramp retrieve --onrampId <id>
  mp virtual-account onramp list --status Approved
  mp virtual-account onramp delete --onrampId <id>
  ```
</CodeGroup>

### Funding via Open Banking

You can trigger a payment directly from the CLI using open banking:

<CodeGroup>
  ```bash Bash theme={null}
  mp virtual-account onramp payment create \
    --onrampId <id> \
    --amount 1000 \
    --fiat EUR
  ```
</CodeGroup>

To check the status of a payment:

<CodeGroup>
  ```bash Bash theme={null}
  mp virtual-account onramp payment retrieve \
    --onrampId <id> \
    --paymentId <payment-id>
  ```
</CodeGroup>

### Viewing Transactions

<CodeGroup>
  ```bash Bash theme={null}
  mp virtual-account transaction list
  ```
</CodeGroup>

## Checking Balances

After funds have been converted and delivered, you can verify your wallet balances:

<CodeGroup>
  ```bash Bash theme={null}
  mp token balance list --wallet "my-wallet"
  ```
</CodeGroup>

## Virtual Account Command Reference

| Command                                      | Description                                |
| -------------------------------------------- | ------------------------------------------ |
| `mp virtual-account create`                  | Create a virtual account and start KYC     |
| `mp virtual-account retrieve`                | Get account status                         |
| `mp virtual-account kyc continue`            | Check KYC status or get verification link  |
| `mp virtual-account kyc restart`             | Restart KYC verification                   |
| `mp virtual-account agreement list`          | List legal agreements                      |
| `mp virtual-account agreement accept`        | Accept a legal agreement                   |
| `mp virtual-account wallet register`         | Register a wallet with the virtual account |
| `mp virtual-account wallet list`             | List registered wallets                    |
| `mp virtual-account onramp create`           | Create a fiat-to-stablecoin onramp         |
| `mp virtual-account onramp retrieve`         | Get onramp details and banking info        |
| `mp virtual-account onramp list`             | List all onramps                           |
| `mp virtual-account onramp delete`           | Cancel an onramp                           |
| `mp virtual-account onramp payment create`   | Create an open banking payment link        |
| `mp virtual-account onramp payment retrieve` | Get payment status                         |
| `mp virtual-account transaction list`        | List fiat-to-stablecoin conversions        |

## Additional MoonPay CLI Capabilities

The `mp` CLI is the unified interface for the entire MoonPay infrastructure. Beyond Iron's virtual account and stablecoin features, the same CLI provides access to additional capabilities including buying crypto with fiat, swapping and bridging tokens across chains, transferring assets, setting up trading automations, discovering tokens, and creating multi-chain deposit links. These features support Solana, Ethereum, Base, Polygon, Arbitrum, Optimism, BNB, Avalanche, TRON, and Bitcoin.

Run `mp --help` to explore all available commands.
