2. The terminal and your workspace

Gloom from your shell (the CLI)

The functions you open in panes also run from your computer's command line, printing a table or JSON and CSV for scripts and spreadsheets.

  • 4 min
  • 3 questions
  • Lesson 8 of 9

Why you would care

Can you get this number without opening the app? You want last year's daily prices for five stocks in a spreadsheet. Or a script that checks a yield every morning. Clicking and copying is slow and error-prone. The CLI gives you the same data as the panes, as text you can save, sort and reuse.

The idea from scratch

A CLI (command-line interface) is a program you run by typing in a shell: the text window of your computer (Terminal on a Mac, PowerShell on Windows). You type a command, press Enter, and it prints the answer.

Gloom's program is called gloomberb.

  • gloomberb alone opens the terminal app.
  • gloomberb <command> ... runs one command, prints the result, and exits.

The one command to know: fn

gloomberb fn <FUNCTION> <argument> runs a function the way its pane would, and prints its report.

gloomberb fn HP AAPL            # price history table
gloomberb fn CBR --json          # central bank rates as JSON
gloomberb fn OVME --spot 100 --strike 100 --days 30 --volatility 25

Options after the argument are the function's own settings. gloomberb catalog <FUNCTION> lists them, with examples.

Output formats

FlagYou getGood for
(none)A readable table that fits your windowReading
--jsonStructured data with every fieldScripts, AI tools
--csvComma-separated rowsSpreadsheets
--ndjsonOne JSON object per lineStreams of rows

Other handy commands

CommandWhat it does
gloomberb quote AAPL NVDA SPYCurrent quotes
gloomberb search vodafoneFind tickers and their listings
gloomberb helpEvery command, grouped
gloomberb catalog --allEvery function, with its argument
gloomberb shot TAS AAPL --output tape.pngSave a picture of a pane
gloomberb portfolio / watchlistManage your lists
Diagram: Your shell leads to Gloom runs the HP function (gloomberb fn HP AAPL --csv); Gloom runs the HP function leads to Table text; Gloom runs the HP function leads to CSV for a spreadsheet; Gloom runs the HP function leads to JSON for a script.
Wide diagram: scroll sideways to see all of it.

See it in Gloom

This is what gloomberb quote AAPL NVDA SPY printed on 2026-10-06, before the US open (historical example):

Symbol  Name                                 Last     Chg%    Session  Cur  Source   Updated
AAPL    Apple Inc.                           $332.74  -0.05%  PRE-MKT  USD  delayed  2026-10-06 14:40
NVDA    NVIDIA Corporation                   $241.46  +1.07%  PRE-MKT  USD  delayed  2026-10-06 14:41
SPY     State Street SPDR S&P 500 ETF Trust  $777.67  +0.37%  PRE-MKT  USD  delayed  2026-10-06 14:41

Read it like a pane:

  1. Last and Chg%: the price and the change since the previous close.
  2. Session PRE-MKT: the US market had not opened yet; this is premarket trading.
  3. Source delayed: this machine was signed out, so prices were about 15 minutes behind.
  4. Updated: the time of the quote, in the computer's time zone.

The CLI uses the same account and plan as the app on that computer: signed in with Pro, the same command prints real-time prices.

Practice and recap

Try it3 tasks
  1. Write the command that saves Microsoft's price history as a CSV file. (gloomberb fn HP MSFT --csv > msft.csv; the > sends the output into a file.)
  2. Which flag would you use to feed a script? (--json.)
  3. How do you find the settings a function accepts? (gloomberb catalog <FUNCTION>.)
Common mistakes4 mistakes
  • Forgetting the fn word: gloomberb HP AAPL is not a command; gloomberb fn HP AAPL is.
  • Reading a delayed CLI quote as live. Check the Source column.
  • Expecting every pane to print everything: a report contains what the pane shows; very wide tables can be cut in the readable view. Use --json for every field.
  • Running the app and a script with different accounts and comparing numbers.
Check yourself3 questions
  1. What does gloomberb with no words after it do?
  2. What is the difference between --csv and --json?
  3. What does Source delayed tell you?
Answers
  1. It opens the terminal app.
  2. CSV is rows for a spreadsheet; JSON is structured data with every field, for scripts.
  3. The quote is from the delayed feed, about 15 minutes behind for US stocks.
Words in this lesson5 words
CLI
Command-line interface: a program you run by typing commands.
shell
Your computer's text window where you type commands.
flag
An option added to a command, starting with --, like --json.
JSON
A structured text format that programs read easily.
CSV
Comma-separated values: rows of text that spreadsheets open.

Educational material about reading market data, not investment advice.