Skip to main content
Version: v5

CLI flags

openbb -h prints the same list. Flags that take a value accept both --flag value and --flag=value.

Modes​

These flags are mutually exclusive. Without any of them, the CLI runs the command given as positional arguments and exits; see Modes.

FlagEffect
-i, --interactiveOpen the interactive REPL.
--batchRead NDJSON requests from stdin and write NDJSON responses to stdout, up to --batch-concurrency at a time.
--generate-specWrite a .spec file built from --server, with optional --openapi-path, or from --socrata-story, then exit.
--generate-extensionWrite an installable OpenBB extension project built from one --spec into --output, then exit. See Codegen.
--list-commandsPrint the command catalog as a JSON response, the same as the __commands__ batch command. Needs --spec or --server.
--describe COMMAND[:PROVIDER]Print one command's parameters and response schema as a JSON response, the same as __schema__. Needs --spec or --server. The :PROVIDER suffix selects one provider's parameters for commands that declare providers.
--print-config-templatePrint a commented TOML configuration template.
--show-configPrint the merged TOML configuration as JSON.

Backend​

FlagDefaultEnvironmentNotes
--server URLnoneOPENBB_SERVER_URLDispatch over HTTP to an openbb-api or other OpenAPI 3.x server. Ignored for dispatch when a spec is configured.
--spec [NAME=]PATHnoneOPENBB_SPEC_PATHDispatch from a .spec file. Repeatable; with more than one, every entry needs a NAME= namespace. The variable is used only when no spec is set by flag or openbb.toml.
--openapi-path PATHnonenonePath appended to the server URL, or a full URL, of the OpenAPI document. When unset, /openapi.json is tried. Read only by --generate-spec.
--socrata-story URL_OR_PATHnonenoneBuild a spec from a Socrata story or dataset. With --generate-spec it is saved; otherwise it is used for this run only.

With no spec and no server, commands run in-process against the installed openbb extensions. Backends covers the selection rules.

Auth​

FlagDefaultEnvironmentNotes
-H KEY=VALUE, --header KEY=VALUEnonenoneHTTP header for every request and for the OpenAPI download. KEY: VALUE also works. Repeatable. NS:KEY=VALUE limits it to namespace NS.
--header-file PATHnoneOPENBB_HEADER_FILEJSON object of headers. -H flags win on conflicts.
-Q KEY=VALUE, --query-param KEY=VALUEnoneOPENBB_HTTP_QUERY_<NAME>Query parameter for every request. Repeatable. NS:KEY=VALUE limits it to namespace NS. Each OPENBB_HTTP_QUERY_<NAME> variable adds <name> in lower case.
--query-param-file PATHnoneOPENBB_QUERY_PARAM_FILEJSON object of query parameters. OPENBB_HTTP_QUERY_* variables and -Q flags win on conflicts.

Auth hooks have no flag; they are configured in openbb.toml. See Authentication.

Codegen​

FlagDefaultUsed byNotes
--output PATH, -o PATHopenbb.spec--generate-spec, --generate-extensionSpec file path, or the parent directory of the generated project. The output key in openbb.toml is not applied in v5.
--provider-name NAMEname of the --output directory--generate-extensionSource of the snake_case slug for the provider, namespace, and default names.
--project-name NAMEopenbb-<slug>--generate-extensionDistribution name and project directory.
--package-name NAMEopenbb_<slug>--generate-extensionPython package directory.
--router-name NAMEnone--generate-extensionAccepted but not used in v5; the namespace is the slug.
--include PATTERNNone--generate-extensionKeep only commands whose dotted name matches the glob. Repeatable. Overrides --exclude.
--exclude PATTERNNone--generate-extensionDrop commands whose dotted name matches the glob. Repeatable. Ignored when --include is set.

Configuration files​

FlagDefaultEnvironmentNotes
--config PATHnoneOPENBB_CLI_CONFIGTOML file merged over pyproject.toml, the user-global openbb.toml, and the project openbb.toml. See Configuration.
--env-file PATHnoneOPENBB_CLI_ENV_FILE.env file loaded into the environment after ~/.openbb_platform/.env. Variables that are already set are kept.

Runtime​

FlagDefaultEnvironmentNotes
--batch-concurrency N8OPENBB_CLI_BATCH_CONCURRENCYMaximum number of batch requests in flight. The batch-concurrency key in openbb.toml is not applied in v5.
--devoffnoneSets DEV_BACKEND for the REPL session. Only used with -i.
--debugoffnoneSets DEBUG_MODE for the REPL session. Only used with -i.

Positional arguments​

Everything after the flags is collected as the command: the dotted command path followed by --key value or --key=value pairs. With -i, it is run as the first REPL input instead, written as a REPL path such as /oecd/gdp_real --country japan. With --generate-spec, a single positional argument is taken as the output path when --output is not given. Modes explains how the pairs are parsed for each backend.