Documentation
Loading...
CLI

Output Modes

Use --json and --quiet for scripting and CI pipelines

Most BuildBear CLI commands support two optional output flags that make it easy to integrate the CLI into scripts, CI pipelines, and other tooling.


--json

Emit structured JSON to stdout instead of formatted human-readable text.

buildbear sandbox create --network 1 --json
{
  "sandboxId": "abc123",
  "rpcUrl": "https://rpc.buildbear.io/abc123",
  "explorerUrl": "https://explorer.buildbear.io/abc123",
  "faucetUrl": "https://faucet.buildbear.io/abc123",
  "mnemonic": "word1 word2 ... word12"
}

When to use: Whenever you need to extract values from command output in a script — pipe --json output through jq to get what you need.

# Extract just the RPC URL after creating a sandbox
RPC_URL=$(buildbear sandbox create --network 1 --json | jq -r '.rpcUrl')
echo "RPC: $RPC_URL"

--quiet

Suppress all informational output. Only errors are printed (to stderr).

buildbear faucet native --address 0xYourAddress --quiet

Exits with code 0 on success, non-zero on failure — no output on success.

When to use: When you only care about whether a command succeeded and don't want any output — for example, in a CI step that runs silently unless something goes wrong.

buildbear snapshot revert --snapshot 0x1 --quiet || exit 1

Combining flags

--json and --quiet can be used together. In that case:

  • On success: no output (quiet wins)
  • On error: JSON error object is emitted to stderr

This is useful when you need silent success but structured error information for logging:

buildbear sandbox delete https://rpc.buildbear.io/old-sandbox --json --quiet

Exit codes

CodeMeaning
0Success
1General error (authentication failure, API error, invalid argument, etc.)

All errors include a descriptive message regardless of output mode:

Error: Not authenticated. Run 'buildbear auth setup' to get started, or set BUILDBEAR_API_KEY env var.

Command availability

Command--json--quiet
auth statusYes
initYes
sandbox createYesYes
sandbox listYesYes
sandbox deleteYesYes
sandbox networksYesYes
statusYesYes
faucet nativeYesYes
faucet erc20YesYes
snapshot takeYesYes
snapshot revertYesYes
contract sourceYesYes
contract abiYesYes
contract verifyYesYes
rpcAlways onYes