CLI
Project Initialization
Initialize a project with buildbear init
Interactive project initialization. Runs a wizard that creates a new sandbox and writes a .buildbear.json file in the current directory so that other CLI commands can find your sandbox without requiring an explicit RPC URL argument.
Options:
| Flag | Description |
|---|---|
--json | Output as JSON after initialization |
What it does
- Checks whether
.buildbear.jsonalready exists in the current directory. If it does, prompts you to confirm overwrite. - Fetches the list of supported networks so you can pick a chain.
- Walks you through the configuration interactively:
| Prompt | Required | Notes |
|---|---|---|
| Chain ID | Yes | Numeric chain ID of the network to fork (e.g. 1 for Ethereum) |
| Fork block number | No | Leave blank to fork from the latest block |
| Custom chain ID | No | Override the chain ID inside the sandbox (defaults to the network default) |
| Prefund addresses | No | Comma-separated wallet addresses to pre-fund on creation |
- Creates the sandbox and writes
.buildbear.json:
After init
Any command that accepts an optional [rpcUrl] argument will automatically read from .buildbear.json if no URL is provided. For example:
Example session
Committing .buildbear.json
.buildbear.json stores a personal sandbox URL — it is safe to commit for team-shared sandboxes, but keep in mind that each developer on your team may prefer their own sandbox. A common pattern is to add .buildbear.json to .gitignore and let each developer run buildbear init locally.