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.
gloomberbalone 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 25Options after the argument are the function's own settings. gloomberb catalog <FUNCTION> lists them, with examples.
Output formats
| Flag | You get | Good for |
|---|---|---|
| (none) | A readable table that fits your window | Reading |
--json | Structured data with every field | Scripts, AI tools |
--csv | Comma-separated rows | Spreadsheets |
--ndjson | One JSON object per line | Streams of rows |
Other handy commands
| Command | What it does |
|---|---|
gloomberb quote AAPL NVDA SPY | Current quotes |
gloomberb search vodafone | Find tickers and their listings |
gloomberb help | Every command, grouped |
gloomberb catalog --all | Every function, with its argument |
gloomberb shot TAS AAPL --output tape.png | Save a picture of a pane |
gloomberb portfolio / watchlist | Manage your lists |
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:41Read it like a pane:
LastandChg%: the price and the change since the previous close.Session PRE-MKT: the US market had not opened yet; this is premarket trading.Source delayed: this machine was signed out, so prices were about 15 minutes behind.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
- 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.) - Which flag would you use to feed a script? (
--json.) - How do you find the settings a function accepts? (
gloomberb catalog <FUNCTION>.)
Common mistakes4 mistakes
- Forgetting the
fnword:gloomberb HP AAPLis not a command;gloomberb fn HP AAPLis. - 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
--jsonfor every field. - Running the app and a script with different accounts and comparing numbers.
Check yourself3 questions
- What does
gloomberbwith no words after it do? - What is the difference between
--csvand--json? - What does
Source delayedtell you?
Answers
- It opens the terminal app.
- CSV is rows for a spreadsheet; JSON is structured data with every field, for scripts.
- 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.