Skip to content

Configuration and Wallets

The CLI is a Rust command. Run examples from the ameba_cli project unless a Docker command says otherwise.

Terminal window
cargo run -- --help

The CLI talks to the hosted Amoeba backend by default at https://api.amoeba.farm.

Terminal window
export AMEBA_BACKEND_URL=https://api.amoeba.farm
export AMEBA_CLUSTER=devnet
export SOLANA_RPC_URL=https://api.amoeba.farm

Use http://127.0.0.1:4000 only when you intentionally want a local development backend. A devnet CLI pointed at one backend while a wallet expects another environment can produce confusing results.

For signing flows, pass a keypair path explicitly:

Terminal window
petri --keypair ~/.config/solana/id.json wallet address

The CLI also understands standard Solana CLI config:

Terminal window
export SOLANA_CONFIG=~/.config/solana/cli/config.yml
export SOLANA_KEYPAIR=~/.config/solana/id.json
export SOLANA_COMMITMENT=confirmed

On Unix systems, the CLI refuses group-readable or world-readable keypair files unless explicitly allowed:

Terminal window
petri --allow-insecure-keypair --keypair ./local-test-keypair.json wallet address

Use that override only for disposable local test keys.

Petri uses https://api.amoeba.farm by default for both standard Solana and compressed-state JSON-RPC methods. Save an advanced override from the CLI:

Terminal window
petri config set rpc-url https://rpc.example
petri config show
petri config reset rpc-url

The CLI and TUI read the same saved setting; endpoint editing is intentionally not exposed in the TUI. A custom endpoint must implement any compressed-state methods required by the selected command.

Remote overrides require HTTPS. Plain HTTP is accepted only for loopback or local-validator development. URL userinfo credentials are rejected, and Petri’s compressed-state and direct HTTP requests do not follow redirects.

Petri does not trust the RPC URL or AMEBA_CLUSTER label by itself. Before raw chain reads, signing, or transaction broadcast, it compares its compiled deployment catalog with the API’s short-lived chain-identity proof and fresh genesis, program, mint, vault, and Light-account observations from the selected RPC. If they disagree, the command stops before signing or sending. A custom RPC must serve the same Amoeba deployment as the configured API. There is no silent Devnet tree fallback.

Plain output is intended for people. JSON output is intended for scripts and agents.

Terminal window
petri markets
petri --json markets
petri --output json settlements oracle ramx JUL26

You can also set:

Terminal window
export AMEBA_OUTPUT=json

Use these before signing or submitting anything:

Terminal window
petri config show
petri config set rpc-url https://api.amoeba.farm
petri wallet address
petri wallet balance

config show should display effective configuration without printing secrets.