CLI Reference

The MagicBlock Console CLI (mb-console) provides full control over Ephemeral Rollups from the terminal.

Installation

npm install -g @magicblock-console/cli

Authentication

The CLI authenticates via a Solana keypair file. Set the path through an environment variable:

export MB_KEYPAIR_PATH=~/.config/solana/id.json

If not set, the CLI looks for a keypair at ~/.config/solana/id.json by default. If no keypair is found, the CLI runs in simulated mode — all operations return realistic mock data without touching the blockchain.

Network

By default, the CLI connects to devnet. To change the network:

export MB_NETWORK=devnet   # or mainnet

Projects

mb-console project create

Create a new project.

mb-console project create <name> [options]
FlagDefaultDescription
--region <region>usER region: us, eu, asia

mb-console project list

List all projects.

mb-console project list

mb-console project configure

Configure features for a project.

mb-console project configure <name> [options]
FlagDescription
--gaslessEnable gasless transactions
--privacyEnable privacy mode (TEE)
--vrfEnable VRF randomness
--cranksEnable scheduled execution
--oracleEnable price feeds
--no-gaslessDisable gasless
--no-privacyDisable privacy
--no-vrfDisable VRF
--no-cranksDisable cranks
--no-oracleDisable oracle

mb-console project get

Display current project configuration.

mb-console project get <name>

mb-console project delete

Delete a project and all its configuration.

mb-console project delete <name>

ER Management

mb-console er delegate

Delegate an account to an Ephemeral Rollup.

mb-console er delegate <address> --project <name>
FlagDescription
--project <name>Target project (required)
--owner-program <pubkey>Owner program of the account (required for real blockchain operations)

mb-console er status

Check delegation status of an account.

mb-console er status <address>

mb-console er commit

Commit ER state to the Solana base layer.

mb-console er commit <address> --project <name>

mb-console er undelegate

Undelegate an account — final commit + return to Solana.

mb-console er undelegate <address> --project <name>
FlagDescription
--project <name>Target project (required)
--owner-program <pubkey>Owner program of the account

mb-console er diff

Show state diff between ER and base layer.

mb-console er diff <address>

mb-console er list

List all delegated accounts in a project.

mb-console er list --project <name>

Features

mb-console vrf request

Request verifiable randomness.

mb-console vrf request --project <name>

mb-console privacy deposit

Deposit SPL tokens into a private vault via TEE.

mb-console privacy deposit 
  --token <symbol> 
  --amount <number> 
  --project <name> 
  --mint <spl_mint_address>  # optional

mb-console privacy transfer

Transfer tokens privately within PER.

mb-console privacy transfer 
  --token <symbol> 
  --amount <number> 
  --to <recipient_wallet> 
  --project <name> 
  --mint <spl_mint_address>  # optional

mb-console privacy withdraw

Withdraw tokens from private vault to Solana.

mb-console privacy withdraw 
  --token <symbol> 
  --amount <number> 
  --project <name> 
  --mint <spl_mint_address>  # optional

mb-console crank create

Create a scheduled execution task.

mb-console crank create 
  --interval <ms> 
  --iterations <count> 
  --project <name> 
  --account <pubkey>  # optional, enables real blockchain commits

mb-console crank list

List all cranks in a project.

mb-console crank list --project <name>

mb-console crank stop

Stop a running crank.

mb-console crank stop <crank_id>

mb-console oracle price

Get current price from a feed.

mb-console oracle price --feed <pair> --project <name>

Monitoring

mb-console monitor status

Show project status overview.

mb-console monitor status --project <name>

mb-console monitor logs

Show project log entries.

mb-console monitor logs --project <name> [--limit <n>]

mb-console monitor costs

Display cost breakdown.

mb-console monitor costs --project <name> [--period <period>]

Default period is 30d. Options: 7d, 30d, 90d.

Configuration

Session and project data are stored in ~/.mb-console/:

~/.mb-console/
├── <key1>.json
├── <key2>.json
└── ...

Global Options

FlagDescription
--versionShow version
--helpShow help