bm CLI binary.
- Required parameters: Both
REQUIREDcommand 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.
Global Options
bm
Buildmarkets developer CLISynopsis
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:--json/--table to force.
Options
Configuration
bm config
Get and set CLI configurationSynopsis
Manage~/.buildmarkets/config.yaml. Environment variables override the file at runtime (env always wins).
Settable keys:
environmentsandbox|qa|liveapi-keypartner API key (stored in OS keychain)api-secretpartner API secret (stored in OS keychain)api-base-urloverride the API gateway URLauth-base-urloverride the Keycloak base URLauth-realmoverride the Keycloak realmauth-client-idoverride the OAuth client id
Options
bm config get
Get a config value (effective, after env overrides)Options
bm config list
Show all effective config valuesOptions
bm config set
Set a config valueExamples
Options
Authentication
bm login
Log in as a trader via OAuth device flowSynopsis
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 a0600 config file if no keychain is available).
For partner / M2M auth, use an API key instead:
Options
bm logout
Clear stored credentialsOptions
bm whoami
Print the current authentication identityOptions
Accounts
bm accounts
Accounts commandsOptions
bm accounts balances
Get balancesSynopsis
Returns cash balances, buying power, equity, and margin details. Live accounts fetch.Options
bm accounts close
Close accountSynopsis
Close endpoint. Same asDELETE /v1/accounts/{accountId}.
Options
bm accounts get
Get account detailsOptions
bm accounts list
List all accounts (paginated)Synopsis
Returns a slim list of accounts. UseGET /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:
--interactivewalk through the required fields (default on a TTY)--data <json>provide the full CreateAccountRequest body, inline or@file.json
tax_id test paths (deterministic KYC outcomes):
- ending
0001→ approved - ending
0002→ rejected - ending
0003→ manual_review
Options
bm accounts update
Update account infoSynopsis
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 commandsOptions
bm orders place
Place an orderSynopsis
Set fields via flags, or pass--data '<json>' / @file.json to merge a full body.
Options
bm orders list
List ordersOptions
bm orders get
Get order detailsOptions
bm orders modify
Modify an open orderSynopsis
Set fields via flags, or pass--data '<json>' / @file.json to merge a full body.
Options
bm orders cancel
Cancel orderOptions
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 commandsOptions
bm positions list
Get all open positionsSynopsis
Returns positions with real-time prices and unrealized P&L.Options
bm positions get
Get position by symbolSynopsis
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
Funding & Bank Links
bm funding
Funding commandsOptions
bm funding ach
Ach commandsOptions
bm funding ach link
Link a bank accountSynopsis
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 relationshipsOptions
bm funding ach remove
Remove ACH relationshipSynopsis
Removes the ACH bank link and sets status to cancelled.Options
bm funding deposit
ACH depositSynopsis
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 withdrawalSynopsis
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 activityOptions
bm funding activity-detail
Get funding detailsOptions
Market Data
bm marketdata
Marketdata commandsOptions
bm marketdata quote
Real-time priceSynopsis
Live bid/ask/last from market data feedOptions
bm marketdata historical
Historical dataSynopsis
EOD OHLCV bars from QuoteMediaOptions
bm marketdata profile
Company profileSynopsis
Company details including market cap, P/E, sector, descriptionOptions
bm marketdata news
News & corporate actionsOptions
bm marketdata logo
Stock logoOptions
bm marketdata balance-sheet
Balance sheetSynopsis
Financial statements. Symbol can be ticker or*CUSIP/*ISIN (e.g. *US02079K3059).
Options
bm marketdata dividends
Cash dividendsSynopsis
Dividend history. Symbol can be ticker or*CUSIP/*ISIN.
Options
bm marketdata industries
All industriesOptions
bm marketdata sectors
All sectorsOptions
bm marketdata securities
Equity security masterSynopsis
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 sectorSynopsis
Set fields via flags, or pass--data '<json>' / @file.json to merge a full body.
Options
bm marketdata symbol-details
Symbol detailsSynopsis
Set fields via flags, or pass--data '<json>' / @file.json to merge a full body.
Options
bm marketdata options
Options commandsOptions
bm marketdata options chain
Get options chainSynopsis
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 with400 NON_OPTIONABLE_TICKER.
Options
bm marketdata options expirations
Get options expirationsSynopsis
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 strikesSynopsis
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 symbolsSynopsis
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 with400 NON_OPTIONABLE_TICKER. Partial matches are returned successfully with the unmatched underlyings listed under non_optionable_symbols.
Options
Documents
bm documents
Documents commandsOptions
bm documents types
List Supported DocumentsSynopsis
Returns the full catalog of document types available within the system.Options
bm documents list
Retrieve DocumentsSynopsis
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 accountSynopsis
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 DocumentSynopsis
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 FormSynopsis
Generates a W-9 form for a specified user and returns processing status.Options
API Keys
bm keys
Keys commandsOptions
bm keys create
Generate a new API keySynopsis
Set fields via flags, or pass--data '<json>' / @file.json to merge a full body.
Options
bm keys list
List all API keysOptions
bm keys revoke
Revoke an API keyOptions
Webhooks
bm webhooks
Webhooks commandsOptions
bm webhooks create
Create webhook endpointSynopsis
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 webhooksOptions
bm webhooks get
Get webhookOptions
bm webhooks update
Update webhookSynopsis
Set fields via flags, or pass--data '<json>' / @file.json to merge a full body.
Options
bm webhooks delete
Delete webhookOptions
bm webhooks test
Send test eventOptions
bm webhooks deliveries
List delivery attemptsOptions
bm webhooks tail
Stream webhook events to your terminal or a local URLSynopsis
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 streamingOptions
bm logs tail
Stream API request logs for your tenantSynopsis
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 BuildmarketsOptions
bm migrate from-alpaca
Plan and apply a migration from the Alpaca Broker APIOptions
bm migrate from-alpaca plan
Read Alpaca state and generate a reviewable migration planOptions
bm migrate from-alpaca apply
Execute a migration plan (resumable, journaled)Options
bm migrate status
Show a migration plan’s progressOptions
System Commands
bm system
System commandsOptions
bm system health
API health checkOptions
bm system ready
Readiness checkOptions
bm system live
Liveness checkOptions
bm system metrics
Latency metricsOptions
bm version
Print version informationOptions
Developer Sandbox Tools
bm dev
Developer utilitiesOptions
bm dev sandbox
Sandbox tenant managementOptions
bm dev sandbox reset
Wipe and reseed a sandbox tenantSynopsis
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:
minimal3 accounts (approved/rejected/manual_review), approved funded $10,000fullminimal + open orders, ACH relationships, a webhook, sample documents
Options
bm sandbox
Sandbox helpersOptions
bm sandbox test-paths
List deterministic sandbox test pathsSynopsis
Fetches the sandbox test-path catalog fromGET /v1/dev/sandbox/test-paths.
If the endpoint is unreachable, falls back to the hard-coded list shipped in this binary (updated each release):
tax_idending0001→ approvedtax_idending0002→ rejectedtax_idending0003→ manual_review