@bloomai/cli
v0.1.6
Published
CLI tool for Bloom financial data - download market data to files for analysis
Maintainers
Readme
Bloom CLI
Financial data CLI for coding agents. Downloads data to files so you can use bash (jq, grep, awk) to extract what you need instead of loading everything into context.
Setup
npx @bloomai/cli --help
# Or install globally:
npm install -g @bloomai/cli
export BLOOM_API_KEY=<your-key>
# Or: bloom auth loginQuick Research Workflow
# 1. Find what you need
bloom info AAPL # fundamentals, ratings, peers
bloom info AAPL --fields basic_metadata,bottom_line_ratings # specific sections only
# 2. Download to files for analysis
bloom info AAPL -o /tmp/bloom/aapl-info.json
bloom news AAPL --limit 10 -o /tmp/bloom/aapl-news.json
bloom price AAPL --timeframes 1m,1y -o /tmp/bloom/aapl-price.json
bloom financials AAPL --type revenue -o /tmp/bloom/aapl-revenue.json
# 3. Use bash to extract what matters
jq '.symbols[0].basic_metadata | {name, latest_price, sector, pe_ratio}' /tmp/bloom/aapl-info.json
jq '.articles[] | .headline' /tmp/bloom/aapl-news.json
jq '.data[] | select(.revenue_growth > 0.1)' /tmp/bloom/aapl-revenue.jsonCommands
Core Research
| Command | What it does | Example |
|---------|-------------|---------|
| info | Company fundamentals, ratings, peers | bloom info AAPL MSFT |
| news | Recent news headlines | bloom news AAPL --limit 5 |
| price | Historical price data | bloom price AAPL --timeframes 1d,1m,1y |
| financials | Revenue, margins, cash flow | bloom financials AAPL --type revenue |
| earnings | Earnings history & estimates | bloom earnings AAPL |
| earnings-calendar | Upcoming earnings dates | bloom earnings-calendar --days 7 |
| technicals | RSI, MAs, patterns, options flow | bloom technicals AAPL |
| ma | Raw moving average data (SMA/EMA) | bloom ma AAPL --sma 50,100,200 --ema 20 |
| options-history | Options sentiment evolution over time | bloom options-history AAPL |
| transcript | Search earnings call transcripts | bloom transcript AAPL "AI" "services" |
| compare | Side-by-side stock comparison | bloom compare AAPL MSFT GOOG |
Valuation & Risk
| Command | What it does | Example |
|---------|-------------|---------|
| dcf | Discounted cash flow valuation | bloom dcf AAPL |
| risk | Risk factors from SEC 10-K filings | bloom risk AAPL |
| ratings | Analyst grades & price targets | bloom ratings AAPL |
| short-interest | Short interest history | bloom short-interest AAPL |
| holders | Institutional & mutual fund holders | bloom holders AAPL |
| insider | SEC Form 4 insider trading | bloom insider AAPL |
Portfolio & Strategy
| Command | What it does | Example |
|---------|-------------|---------|
| portfolio | Portfolio risk analysis | bloom portfolio '{"AAPL":0.5,"MSFT":0.5}' |
| backtest | Portfolio backtest against benchmark | bloom backtest --symbols AAPL,MSFT --allocations 0.5,0.5 |
| correlation | Correlation matrix for symbols | bloom correlation AAPL MSFT GOOG |
| drawdown | Portfolio drawdown analysis | bloom drawdown --symbols AAPL,MSFT --allocations 0.5,0.5 |
| position-size | Kelly criterion position sizing | bloom position-size --bull 0.6 --bear -0.15 --conviction 8 --value 100000 |
| trades | AI trade evaluation | bloom trades "Buy AAPL: strong AI catalysts" |
| catalysts | Forward-looking value drivers | bloom catalysts AAPL MSFT |
Market & Macro
| Command | What it does | Example |
|---------|-------------|---------|
| sentiment | Market mood (AAII, Fear&Greed, VIX) | bloom sentiment |
| market | Market map, sectors, movers | bloom market --type top_movers |
| macro | GDP, CPI, unemployment, fed funds, treasury yields | bloom macro --indicators GDP,CPI |
| sectors | Sector performance across time periods | bloom sectors |
| screen | Filter stocks by metrics | bloom screen "market_cap > 100B" "pe_ratio < 25" |
| collections | Curated stock lists by theme | bloom collections --section VALUE |
Corporate Events
| Command | What it does | Example |
|---------|-------------|---------|
| dividends | Dividend history | bloom dividends AAPL |
| splits | Stock split history | bloom splits AAPL |
| ipo | Upcoming and recent IPOs | bloom ipo --from 2026-05-01 |
AI Arena
| Command | What it does | Example |
|---------|-------------|---------|
| ai-trades | Recent AI model trade decisions | bloom ai-trades --model claude --limit 5 |
| ai-portfolio | AI model portfolio positions & performance | bloom ai-portfolio --model openai |
Environment Variables
| Variable | Required for | Description |
|----------|-------------|-------------|
| BLOOM_API_KEY | All commands | Bloom API key (bloom auth login) |
Global Flags
Every command supports:
-o, --output <file>— write to file instead of stdout-f, --format json|csv|table— output format (default: json)-q, --quiet— suppress headers, data only--raw— raw API response
Common Patterns
Compare Multiple Stocks
mkdir -p /tmp/bloom/compare
for ticker in AAPL MSFT GOOG AMZN; do
bloom info $ticker -o /tmp/bloom/compare/$ticker.json
done
# Extract key metrics
for f in /tmp/bloom/compare/*.json; do
ticker=$(basename $f .json)
pe=$(jq -r '.symbols[0].basic_metadata.pe_ratio // "N/A"' $f)
price=$(jq -r '.symbols[0].basic_metadata.latest_price' $f)
echo "$ticker: \$$price (P/E: $pe)"
doneScreen → Deep Dive
# Find cheap large-caps
bloom screen "market_cap > 50B" "pe_ratio < 20" "dividend_yield > 2" -o /tmp/bloom/screened.json
# Get the tickers
tickers=$(jq -r '.results[].symbol' /tmp/bloom/screened.json | head -5 | tr '\n' ' ')
# Deep dive on each
for t in $tickers; do
bloom earnings $t -o /tmp/bloom/earnings-$t.json
bloom catalysts $t -o /tmp/bloom/catalysts-$t.json
doneMarket Check
bloom sentiment -o /tmp/bloom/sentiment.json
bloom market --type major_indexes -o /tmp/bloom/indexes.json
bloom market --type top_movers --limit 10 -o /tmp/bloom/movers.json
# Quick summary
jq '{fear_greed: .cnn_fear_greed.index_value, level: .cnn_fear_greed.level, vix: .volatility_analysis.assessment}' /tmp/bloom/sentiment.jsonPortfolio Review
bloom portfolio '{"AAPL":0.3,"MSFT":0.25,"GOOG":0.25,"AMZN":0.2}' --strategy "tech growth" -o /tmp/bloom/portfolio.json
jq '.risk_metrics' /tmp/bloom/portfolio.jsonEarnings Research
bloom transcript AAPL "AI" "services" "margins" --max 20 -o /tmp/bloom/transcript.json
jq '.matches[] | {speaker, text}' /tmp/bloom/transcript.jsonMoving Averages
# Default: 100-day SMA + 100-day EMA
bloom ma AAPL
# Custom periods
bloom ma AAPL --sma 50,100,200 --ema 20,100
# Last 50 data points, save to file
bloom ma AAPL --sma 200 --limit 50 -o /tmp/bloom/aapl-ma.json
# Extract latest values
jq '.indicators | to_entries[] | {(.key): .value | to_entries | last | .value}' /tmp/bloom/aapl-ma.jsonAI Arena (InvestingArena — 3 AIs with real money)
# All AI models' recent trades
bloom ai-trades -o /tmp/bloom/ai-trades.json
# Claude's last 5 trades
bloom ai-trades --model claude --limit 5
# All trades on NVDA across all models
bloom ai-trades --symbol NVDA -o /tmp/bloom/nvda-ai-trades.json
# Full portfolio snapshot for all 3 models
bloom ai-portfolio -o /tmp/bloom/ai-portfolio.json
# Just Gemini's portfolio
bloom ai-portfolio --model gemini
# Extract model returns
jq '[.[] | {model: .ai_model, return_pct, account_value}]' /tmp/bloom/ai-portfolio.jsonValuation & Risk Research
# DCF valuation
bloom dcf AAPL -o /tmp/bloom/aapl-dcf.json
# Risk factors from 10-K filing
bloom risk AAPL -o /tmp/bloom/aapl-risks.json
# Analyst ratings and price targets
bloom ratings AAPL
# Who owns this stock?
bloom holders AAPL --limit 10
bloom insider AAPL
# Short interest
bloom short-interest AAPLPortfolio Analytics
# Backtest a portfolio
bloom backtest --symbols AAPL,MSFT,GOOG --allocations 0.4,0.3,0.3 -o /tmp/bloom/backtest.json
# Correlation matrix
bloom correlation AAPL MSFT GOOG AMZN
# Drawdown analysis
bloom drawdown --symbols AAPL,MSFT --allocations 0.5,0.5
# Macro overview
bloom macro --indicators GDP,CPI,UNEMPLOYMENT
bloom sectorsTips
- Every command has
--helpwith examples. Runbloom <command> --helpto see usage patterns, available options, and practical examples. - Use
-oto download data to files, thenjqto extract. Saves context tokens. - Batch multiple tickers:
bloom info AAPL MSFT GOOG(up to 10). - Use
bloom screenfirst to narrow your universe, then deep-dive with other commands. --fieldsonbloom inforeduces response size when you only need specific sections.- Pipe to
jq -r '.field'for clean values usable in scripts.
