> For the complete documentation index, see [llms.txt](https://docs.astralbeam.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.astralbeam.io/operators/cli-reference.md).

# CLI Overview

The `bridge-cli` is the command-line tool for operating and managing AstralBeam.

## Installation

```bash
cd cli
npm install
npm run build
npm link  # Makes 'bridge-cli' available globally
```

## Global Options

| Option          | Description                                                                        |
| --------------- | ---------------------------------------------------------------------------------- |
| `-V, --version` | Show version number                                                                |
| `--config`      | Show current configuration (use with a command, e.g. `bridge-cli --config status`) |
| `-h, --help`    | Show help for command                                                              |

## Command Categories

### [Worker Commands](/operators/worker-commands.md)

Start, stop, and monitor bridge workers.

| Command  | Description                |
| -------- | -------------------------- |
| `start`  | Start relay services       |
| `stop`   | Stop relay services        |
| `status` | Check relay service status |
| `watch`  | Full-screen TUI dashboard  |

### [Admin Commands](/operators/admin-commands.md)

Administrative operations for the bridge.

| Command                      | Description                                      |
| ---------------------------- | ------------------------------------------------ |
| `admin register-token`       | Register an ERC-20 token on MultiSigLocker       |
| `admin update-token-mapping` | Update token mapping for registered token        |
| `admin deploy-wrapped-token` | Deploy wrapped ERC-20 for Casper-native token    |
| `admin lock-tokens`          | Lock ERC-20 tokens (EVM → Casper)                |
| `admin burn-tokens`          | Burn CEP-18 tokens (Casper → EVM)                |
| `admin lock-native`          | Lock CEP-18 native tokens (Casper → EVM wrapped) |
| `admin burn-wrapped`         | Burn wrapped ERC-20 (EVM → Casper native)        |
| `admin update-relayer-set`   | Update relayers on EVM contract                  |
| `admin get-relayer-set`      | Query current relayer configuration              |
| `admin casper-*`             | Casper contract admin operations                 |

### [Casper Commands](/operators/casper-commands.md)

Query Casper contract state.

| Command                        | Description                 |
| ------------------------------ | --------------------------- |
| `casper EthClient <method>`    | Query EthClient contract    |
| `casper TokenFactory <method>` | Query TokenFactory contract |
| `casper BridgedToken <method>` | Query CEP-18 bridged tokens |

**Note:** Contract names are case-sensitive (`EthClient`, not `eth_client`).

### [EVM Commands](/operators/evm-commands.md)

Query EVM contract state.

| Command                       | Description                   |
| ----------------------------- | ----------------------------- |
| `evm networks`                | List available EVM networks   |
| `evm MultiSigLocker <method>` | Query MultiSigLocker contract |

### [Service Commands](https://github.com/make-software/cspr-bridge/tree/master/gitbook/cli-reference/service-commands.md)

Manage bridge as a systemd service.

| Command             | Description             |
| ------------------- | ----------------------- |
| `service install`   | Install systemd service |
| `service uninstall` | Remove systemd service  |
| `service start`     | Start service           |
| `service stop`      | Stop service            |
| `service logs`      | View service logs       |

## Quick Examples

### Start the Relayer

```bash
# Start all workers
bridge-cli start

# Start only EVM→Casper direction
bridge-cli start --direction eth2casper
```

### Check Status

```bash
bridge-cli status
```

### Launch TUI Dashboard

```bash
bridge-cli watch
```

### Lock Tokens (EVM → Casper)

```bash
bridge-cli admin lock-tokens \
  --erc20 0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238 \
  --amount 100000000 \
  --recipient account-hash-abc123... \
  --network sepolia
```

### Query Casper Contract

```bash
# List method categories
bridge-cli casper EthClient

# Call specific method
bridge-cli casper EthClient get_threshold
bridge-cli casper TokenFactory is_paused
```

### Query EVM Contract

```bash
# List available networks
bridge-cli evm networks

# Query on specific network
bridge-cli evm --network sepolia MultiSigLocker getRelayerSet
```

## Environment Variables

The CLI reads configuration from environment variables:

```bash
# Required EVM Chain Config
SEPOLIA_RPC_URL=https://sepolia.infura.io/v3/KEY
SEPOLIA_LOCKER=0x6aaea12cF566C9fddbC7082c15d38F1447a57D10

# Required Casper Config
CASPER_NODE_URL=https://node.testnet.casper.network

# Optional
LOG_LEVEL=debug
METRICS_ENABLED=true
```

See [Configuration](/operators/configuration.md) for complete list.

## Error Handling

### Exit Codes

| Code | Meaning       |
| ---- | ------------- |
| 0    | Success       |
| 1    | General error |

### Common Errors

```bash
# Missing private key
Error: ETH_PRIVATE_KEY not configured in .env

# Token not registered
Error: Token is not registered on MultiSigLocker

# Not admin
Error: Caller 0x... is not admin (0x...)
```

## Getting Help

```bash
# General help
bridge-cli --help

# Command-specific help
bridge-cli admin --help
bridge-cli casper --help
bridge-cli evm --help
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.astralbeam.io/operators/cli-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
