May 30, 2024 6 MIN

Introducing the OpenBB Platform CLI

Here's some exciting news about the OpenBB open-source product suite.

blog hero

Introduction

In February, we shared a hackathon project that was closely related to the OpenBB Terminal and the OpenBB Platform: Building a CLI using the OpenBB Platform. That blog post exposed some thoughts, considerations, and tweaks around the architecture and eventual future development of a CLI built on top of the OpenBB Platform.

Later, in March, we announced the Sunsetting of the OpenBB Terminal. In a very nostalgic blog post, Didier discusses some of the landmarks and cooler features the OpenBB team, alongside our fantastic contributors (over 200!), put together in the last two years. It also opened the book on why the team decided to replace the OpenBB Terminal with the OpenBB Platform CLI and, most importantly, how we planned to move forward.

The OpenBB Platform CLI

The OpenBB Platform CLI should provide users with a similar look and feel and be familiar enough for anyone using the Terminal today.

Although the Platform CLI doesn’t have (yet) some features that we were used to see on the Terminal (like reports, dashboards, portfolio, and brokerage interface, among others), it is important to note that it is expected to integrate seamlessly with the Platform extensions.

What do we mean by that?

The OpenBB Platform currently has around 40 extensions officially maintained by the OpenBB team (between providers, data retrieval, data processing, and charting) — check them out on the OpenBB Documentation or PyPI.

What is an extension?

An individual package that extends the functionality of the OpenBB Platform.

The OpenBB Platform is built on top of an extension framework that allows individual packages to be installed and removed seamlessly within the environment. It uses only the desired data and toolkit extensions, keeping the application as light and manageable as possible.

There are two kinds of extensions:

  • Data extensions will expand the breadth and coverage of the data available.
  • Toolkit extensions will add functions for manipulating data and preparing it for display.

This means that the CLI will also be extensible and modular to meet your specific needs, meaning that as the extension ecosystem grows, so will the CLI capabilities.

-

What if the data you want to use is not on the OpenBB Platform?

Unfortunately, it is impossible to cover every user’s needs. However, you can easily develop any extension to address your needs. We welcome all contributions and are here to help. If this interests you, please refer to our how-to guides.

But don’t worry.

Some functionalities still resemble the former Terminal. You’ll still be able to set up your own CLI style, create complex workflows with routines, export results into spreadsheets, create custom charts, perform data processing such as technical or quantitative, or simply analyze data within the interactive tables.

Let’s take a look inside the CLI

-

As you can see, we have a few sections. Let’s dive into each of them:

Configure your CLI

This is where you’ll find what should be considered local configurations: using interactive tables, console style, rich panel, flair, etc. Note that these configurations will only live on your device and will not be kept on the OpenBB Hub.

Routines

As said above, we kept the routines' functionality, which means you’ll still be able to record and execute your new workflows, save them to the OpenBB Hub, and/or share them using the public URL!

A big part of why the OpenBB routines are so cool is that you can leverage multiple commands in a single run. With the OpenBB Platform CLI, you can still pile up commands and use previous results on the following commands thanks to the OBBject registry (if you’re unsure what this means, keep reading until the cached results (OBBjects) section)!

Platform CLI Structure

data menus/commands

This section is dedicated to data retrieval. We leverage the Platform’s stability, expandability, and standardization to provide an easy way of accessing an incredibly large amount of data, ranging from equity, crypto, or ETFs to news and economy data (don’t forget that this can always be extended through the extensions' ecosystem!).

data processing menus/commands

As the name says, in this section you’ll be able to further process any data you’ve obtained in previous steps, namely in the data acquisition process.

configuration

The OpenBB Platform has some available configuration on its own, namely the ability to manage your Hub account (managing API keeps, for example) as well as some other user-centric preferences, such as defining preferred data providers or setting your preferred export directory.

These configurations can be managed on your Hub account directly, and they will be available once you login (on the account menu).

cached results (OBBjects)

The OBBject is an abstraction created by the OpenBB team to easily work with the results of a command execution (which might be just the data but also a chart or metadata). As the Platform follows the REST principles, it is a stateless application. This means that the client should be the one handling its state. The CLI implements an OBBject registry so that its users can then manipulate the data obtained in previous steps. This means that if, for example, you’ve obtained historical data for an equity in your last command, that result will be cached so you can use it later, let’s say, to perform a moving average. Here is a practical example:

(🦋) / $ /equity/price/historical --symbol aapl --start_date 2022-01-01 --end_date 2024-05-01
(🦋) / $ /technical/ema --data 0 --length 50

All the data processing menus (in the image above, technical and quantitative) have a set of commands that expect the argument data. This special argument will autocomplete with the cached results. The cached results work as a stack (for easy automation), i.e., after the execution of ema on the example above, the indexes would increase by one. Here’s a visual representation:

-

The OpenBB Platform CLI is LIVE!

As they say, one image is worth one thousand words. This is what the CLI looks like today:

This is a workflow example of how to perform a relative rotation graph to visually compare the performance and momentum of securities and asset classes against a benchmark.

You can start using it today. Check out the OpenBB Platform CLI documentation to learn how.

Explore the
Terminal Pro


We use cookies

This website uses cookies to meausure and improve your user experience.