Skip to main content
Every command in this reference is generated directly from the bm CLI binary.
  • Required parameters: Both REQUIRED command flags and positional <args> must be provided for the command to execute.
  • Global flags: The following global flags apply to every single command:
    • --json — Force JSON format output.
    • --table — Force table format output.
    • --non-interactive — Disable terminal prompts, loading animations, and colors (useful for CI/CD or agent scripts).
    • --yes — Automatically bypass confirmation dialogs.
    • --debug — Output detailed network logs and execution tracing to stderr.
    • --watch — Poll the command on an interval and re-render the output.
    • --watch-interval <N> — Set the polling interval in seconds (minimum 1, default 2).
    • --api-key <key> / --api-secret <secret> — Pass partner M2M credentials directly for a single invocation.
For a detailed explanation of authorization states, environment configuration, and scripting examples, refer to the CLI Developer Guide.

Global Options

bm

Buildmarkets developer CLI

Synopsis

bm — the Buildmarkets developer CLI. A thin, scriptable front end to the Buildmarkets brokerage API for humans at terminals, CI/CD pipelines, and focused-action agents. Talks to the API gateway directly (never through the MCP). Auth:
Output is a table on a TTY and JSON otherwise; use --json/--table to force.

Options


Configuration

bm config

Get and set CLI configuration

Synopsis

Manage ~/.buildmarkets/config.yaml. Environment variables override the file at runtime (env always wins). Settable keys:
  • environment sandbox | qa | live
  • api-key partner API key (stored in OS keychain)
  • api-secret partner API secret (stored in OS keychain)
  • api-base-url override the API gateway URL
  • auth-base-url override the Keycloak base URL
  • auth-realm override the Keycloak realm
  • auth-client-id override the OAuth client id

Options

bm config get

Get a config value (effective, after env overrides)

Options

bm config list

Show all effective config values

Options

bm config set

Set a config value

Examples

Options


Authentication

bm login

Log in as a trader via OAuth device flow

Synopsis

Starts the OAuth 2.0 device authorization flow against Keycloak. Prints a verification URL and user code, then polls until you approve in the browser. The resulting token is stored in the OS keychain (or a 0600 config file if no keychain is available). For partner / M2M auth, use an API key instead:

Options

bm logout

Clear stored credentials

Options

bm whoami

Print the current authentication identity

Options


Accounts

bm accounts

Accounts commands

Options

bm accounts balances

Get balances

Synopsis

Returns cash balances, buying power, equity, and margin details. Live accounts fetch.

Options

bm accounts close

Close account

Synopsis

Close endpoint. Same as DELETE /v1/accounts/{accountId}.

Options

bm accounts get

Get account details

Options

bm accounts list

List all accounts (paginated)

Synopsis

Returns a slim list of accounts. Use GET /v1/accounts/{accountId} for full details.

Options

bm accounts open

Open a new brokerage account (interactive KYC or --data)

Synopsis

Opens a new brokerage account (POST /v1/accounts) with inline KYC. Two ways to supply the application:
  • --interactive walk through the required fields (default on a TTY)
  • --data <json> provide the full CreateAccountRequest body, inline or @file.json
Note: sandbox KYC outcomes are determined by the real verification pipeline (identity verification + clearing-system CIP screening), not by deterministic tax_id test values.

Options

bm accounts update

Update account info

Synopsis

Updates account fields. Identity fields (name, DOB, tax ID) are only updatable while account is pending. Supply the request body with --data '<json>' or --data @file.json.

Options


Orders

bm orders

Orders commands

Options

bm orders place

Place an order

Synopsis

Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm orders list

List orders

Options

bm orders get

Get order details

Options

bm orders modify

Modify an open order

Synopsis

Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm orders cancel

Cancel order

Options

bm orders executions

Get execution reports (fills)

Options

bm orders cancel-all

Cancel every open order for an account (bulk-destructive)

Synopsis

Lists open orders for the account, confirms, then cancels each. Confirmation is required in interactive mode.

Options


Positions

bm positions

Positions commands

Options

bm positions list

Get all open positions

Synopsis

Returns positions with real-time prices and unrealized P&L.

Options

bm positions get

Get position by symbol

Synopsis

Returns position with real-time price and unrealized P&L.

Options

bm positions close-all

Liquidate every open position for an account (bulk-destructive)

Synopsis

Lists open positions and places an offsetting market order to close each. Confirmation is required in interactive mode.

Options


bm funding

Funding commands

Options

bm funding ach

Ach commands

Options

Link a bank account

Synopsis

Links a bank account via ACH. Profile is auto-approved with third-party verification. Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm funding ach list

List ACH relationships

Options

bm funding ach remove

Remove ACH relationship

Synopsis

Removes the ACH bank link and sets status to cancelled.

Options

bm funding deposit

ACH deposit

Synopsis

Initiate an ACH deposit (credit) into the brokerage account. Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm funding withdraw

ACH withdrawal

Synopsis

Initiate an ACH withdrawal (debit) from the brokerage account. Supports IRA distribution fields for IRA accounts. Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm funding activity

List funding activity

Options

bm funding activity-detail

Get funding details

Options


Market Data

bm marketdata

Marketdata commands

Options

bm marketdata quote

Real-time price

Synopsis

Live bid/ask/last from market data feed

Options

bm marketdata historical

Historical data

Synopsis

EOD OHLCV bars from QuoteMedia

Options

bm marketdata profile

Company profile

Synopsis

Company details including market cap, P/E, sector, description

Options

bm marketdata news

News & corporate actions

Options

Stock logo

Options

bm marketdata balance-sheet

Balance sheet

Synopsis

Financial statements. Symbol can be ticker or *CUSIP/*ISIN (e.g. *US02079K3059).

Options

bm marketdata dividends

Cash dividends

Synopsis

Dividend history. Symbol can be ticker or *CUSIP/*ISIN.

Options

bm marketdata industries

All industries

Options

bm marketdata sectors

All sectors

Options

bm marketdata securities

Equity security master

Synopsis

Search equity instruments with pagination Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm marketdata sector-symbols

Symbols by sector

Synopsis

Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm marketdata symbol-details

Symbol details

Synopsis

Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm marketdata options

Options commands

Options

bm marketdata options chain

Get options chain

Synopsis

Returns every active option contract (calls and puts) for the given underlying symbol on the requested expiration date, sorted by strike. Quotes and Greeks are not included in this response. If the underlying has no listed options, the request fails with 400 NON_OPTIONABLE_TICKER.

Options

bm marketdata options expirations

Get options expirations

Synopsis

Returns the distinct expiration dates available for the given underlying symbol, sorted chronologically. Each entry includes the contract type (weekly, monthly, etc.) and, when strikes=true is supplied, the count of distinct strikes at that expiration.

Options

bm marketdata options strikes

Get options strikes

Synopsis

Returns the distinct strike prices available for the given underlying symbol on the requested expiration date, sorted numerically. Use this to power a strike picker without paying for the full chain payload.

Options

bm marketdata options lookup

Lookup option symbols

Synopsis

Returns every active option symbol for one or more underlying tickers, grouped by underlying. Use this to enumerate contracts before requesting per-contract details. Up to 30 underlyings can be supplied per request as a comma-separated list. If every supplied underlying is non-optionable, the request fails with 400 NON_OPTIONABLE_TICKER. Partial matches are returned successfully with the unmatched underlyings listed under non_optionable_symbols.

Options


Documents

bm documents

Documents commands

Options

bm documents types

List Supported Documents

Synopsis

Returns the full catalog of document types available within the system.

Options

bm documents list

Retrieve Documents

Synopsis

Retrieves a filtered list of documents. Filter by document type, account number, date (month, year, day), and pagination. Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm documents upload

Upload an owner document for an account

Synopsis

Uploads an owner document (POST /v1/accounts/{accountId}/documents/upload). The file is read locally, base64-encoded, and its MIME type inferred from the extension unless --mime-type is given. Example:

Options

bm documents email

Email Document

Synopsis

Sends a specified document to a recipient by email. Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm documents w9

Request W-9 Form

Synopsis

Generates a W-9 form for a specified user and returns processing status.

Options


API Keys

bm keys

Keys commands

Options

bm keys create

Generate a new API key

Synopsis

Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm keys list

List all API keys

Options

bm keys revoke

Revoke an API key

Options


Webhooks

bm webhooks

Webhooks commands

Options

bm webhooks create

Create webhook endpoint

Synopsis

Register a URL to receive webhook events. Pass an empty events array to subscribe to all events. Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm webhooks list

List webhooks

Options

bm webhooks get

Get webhook

Options

bm webhooks update

Update webhook

Synopsis

Set fields via flags, or pass --data '<json>' / @file.json to merge a full body.

Options

bm webhooks delete

Delete webhook

Options

bm webhooks test

Send test event

Options

bm webhooks deliveries

List delivery attempts

Options

bm webhooks tail

Stream webhook events to your terminal or a local URL

Synopsis

Forwards webhook events from your Buildmarkets tenant to the terminal (or a local URL via --forward-to) so you can test handlers without a tunnel. Backend: GET /v1/webhooks/stream (SSE). Examples:

Options


Logging & Diagnostics

bm logs

API request log streaming

Options

bm logs tail

Stream API request logs for your tenant

Synopsis

Streams API request logs for the authenticated tenant. Backend: GET /v1/logs/stream (SSE). Filters compose with logical AND. Status filter accepts an exact code (404) or a class (4xx, 5xx, 2xx). Examples:

Options


Migration Tools

bm migrate

Migrate from another brokerage to Buildmarkets

Options

bm migrate from-alpaca

Plan and apply a migration from the Alpaca Broker API

Options

bm migrate from-alpaca plan

Read Alpaca state and generate a reviewable migration plan

Options

bm migrate from-alpaca apply

Execute a migration plan (resumable, journaled)

Options

bm migrate status

Show a migration plan’s progress

Options


System Commands

bm system

System commands

Options

bm system health

API health check

Options

bm system ready

Readiness check

Options

bm system live

Liveness check

Options

bm system metrics

Latency metrics

Options

bm version

Print version information

Options


Developer Sandbox Tools

bm dev

Developer utilities

Options

bm dev sandbox

Sandbox tenant management

Options

bm dev sandbox reset

Wipe and reseed a sandbox tenant

Synopsis

Wipes all data in the sandbox tenant and reseeds with a fixture set. Backend: POST /v1/dev/sandbox/reset. Refuses to run against a live tenant: if the resolved API key looks live, the command exits 3 before any network call. Fixtures:
  • minimal 3 accounts (approved/rejected/manual_review), approved funded $10,000
  • full minimal + open orders, ACH relationships, a webhook, sample documents

Options

bm sandbox

Sandbox helpers

Options

bm sandbox test-paths

List deterministic sandbox test paths (deprecated)

Synopsis

Deprecated. Sandbox KYC outcomes are no longer controlled by deterministic tax_id test paths — applications run through the real verification pipeline (identity verification + clearing-system CIP screening). This command is retained for backwards compatibility only.

Options