Skip to main content
Version: v5

ODP CLI

openbb-cli installs the openbb command, a client for the OpenBB Platform and for any service that publishes an OpenAPI 3.x document. The same set of commands can be driven three ways. By default, openbb <command> --key value runs one command, writes a single JSON line to stdout, and exits with a status that reflects the outcome, which suits scripts, CI jobs, and agents. openbb --batch reads NDJSON requests from stdin and writes one NDJSON response per request as each finishes. openbb -i opens an interactive REPL with menus, tab completion, a registry of cached results, and routine scripts.

openbb oecd.gdp_real --country japan --frequency annual

Where the commands come from depends on the backend. Without a backend flag, the CLI imports the local openbb package and calls the extensions installed in that Python environment, so the command above needs openbb-oecd. --server URL reads the OpenAPI document of an openbb-api server, or of any other OpenAPI 3.x service, and sends each command over HTTP. --spec PATH does the same from a .spec file saved with --generate-spec, skipping the schema download on every call. Passing --spec NAME=PATH more than once mounts several APIs side by side, each under its own namespace and with its own headers, query parameters, and auth hook.

A .spec file can also be turned into an installable OpenBB extension with --generate-extension. The generated project registers a provider, holds a fetcher module for each GET command, and mounts routers that mirror the API's paths; after pip install and openbb-build, its commands appear under obb.<namespace> in Python.

Pages in this section​

Start with Installation and the Quickstart, which walks through one-shot, batch, and REPL use. Modes covers argument parsing, the NDJSON wire format, and exit codes. Backends explains how each backend resolves commands and what a .spec file contains. Configuration describes openbb.toml, .env files, environment variables, and their precedence, while Settings lists the REPL display settings stored in ~/.openbb_platform/.cli.env. Authentication covers static headers, query parameters, and importable auth hooks. Codegen documents --generate-spec, --socrata-story, and --generate-extension. Every flag is listed in the CLI flags reference.

The interactive REPL has its own section. Structure and Navigation explains menus, paths, and the global commands, Commands and Arguments covers help output, flags, and completion, and Data Sources shows how providers and credentials are selected. Cached results, the load command, and the /feature table tools are described in Results Registry. Display options are covered in Interactive Tables and Interactive Charts, file locations in OpenBBUserData Folder, and scripted sessions in Routines.