# brapi.dev CLI

The official command-line client is maintained in the `@brapi/cli` workspace package.
It provides a scriptable interface for agents and developers who prefer a terminal.

## Commands

~~~bash
brapi quote PETR4,VALE3
brapi get /api/v2/stocks/historical?symbols=PETR4
brapi get /api/v2/stocks/quote?symbols=PETR4 --token YOUR_TOKEN
~~~

## Supported options

- `--token TOKEN` sends a Bearer token.
- `--base-url URL` selects another brapi-compatible API host.
- `BRAPI_API_URL` sets the default API host.

The package source is ready for publication as `@brapi/cli`.
Publishing it on npm requires the maintainer's npm account and access to the package scope.
Until publication, use the REST API, OpenAPI contract, or MCP server directly.
The command writes successful responses to stdout and failures to stderr with a non-zero exit code.

- [OpenAPI contract](https://brapi.dev/openapi.json)
- [REST documentation](https://brapi.dev/docs)
- [MCP server](https://brapi.dev/docs/mcp)
