@bloomai/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -0
- package/SKILL.md +120 -0
- package/dist/index.js +805 -0
- package/package.json +24 -0
- package/src/api.ts +67 -0
- package/src/auth.ts +83 -0
- package/src/commands/auth.ts +45 -0
- package/src/commands/catalysts.ts +18 -0
- package/src/commands/collections.ts +20 -0
- package/src/commands/earnings.ts +18 -0
- package/src/commands/financials.ts +30 -0
- package/src/commands/info.ts +79 -0
- package/src/commands/market.ts +22 -0
- package/src/commands/news.ts +48 -0
- package/src/commands/options.ts +35 -0
- package/src/commands/portfolio.ts +28 -0
- package/src/commands/position.ts +44 -0
- package/src/commands/price.ts +76 -0
- package/src/commands/screen.ts +77 -0
- package/src/commands/sentiment.ts +51 -0
- package/src/commands/technicals.ts +25 -0
- package/src/commands/trades.ts +41 -0
- package/src/commands/transcript.ts +69 -0
- package/src/format.ts +179 -0
- package/src/global-opts.ts +9 -0
- package/src/index.ts +49 -0
- package/tsconfig.json +15 -0
- package/tsup.config.ts +12 -0
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Bloom CLI
|
|
2
|
+
|
|
3
|
+
A command-line tool for accessing Bloom financial data. Designed for coding agents that need to download data to files and use bash tools (jq, grep, awk) to extract what they need, instead of loading everything into LLM context.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
cd cli
|
|
9
|
+
npm install
|
|
10
|
+
npm run build
|
|
11
|
+
export BLOOM_API_KEY=<your-key>
|
|
12
|
+
node dist/index.js --help
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Company fundamentals
|
|
19
|
+
bloom info AAPL MSFT
|
|
20
|
+
|
|
21
|
+
# Download to file for analysis
|
|
22
|
+
bloom info AAPL -o /tmp/aapl.json
|
|
23
|
+
jq '.symbols[0].basic_metadata | {name, latest_price, pe_ratio}' /tmp/aapl.json
|
|
24
|
+
|
|
25
|
+
# Market data
|
|
26
|
+
bloom sentiment
|
|
27
|
+
bloom market --type top_movers
|
|
28
|
+
bloom news AAPL --limit 5
|
|
29
|
+
|
|
30
|
+
# Screening
|
|
31
|
+
bloom screen "market_cap > 100B" "pe_ratio < 25"
|
|
32
|
+
|
|
33
|
+
# Analysis
|
|
34
|
+
bloom earnings AAPL
|
|
35
|
+
bloom technicals AAPL
|
|
36
|
+
bloom catalysts AAPL
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
See [SKILL.md](./SKILL.md) for complete workflow patterns for coding agents.
|
|
40
|
+
|
|
41
|
+
## Commands
|
|
42
|
+
|
|
43
|
+
| Command | Description |
|
|
44
|
+
|---------|-------------|
|
|
45
|
+
| `info` | Company fundamentals, ratings, peers |
|
|
46
|
+
| `news` | Recent news headlines |
|
|
47
|
+
| `price` | Historical price data |
|
|
48
|
+
| `financials` | Revenue, margins, cash flow |
|
|
49
|
+
| `sentiment` | Market mood (AAII, Fear&Greed, VIX) |
|
|
50
|
+
| `market` | Market map, sectors, movers |
|
|
51
|
+
| `collections` | Curated stock lists |
|
|
52
|
+
| `screen` | Filter stocks by metrics |
|
|
53
|
+
| `earnings` | Earnings history & estimates |
|
|
54
|
+
| `technicals` | RSI, MAs, patterns, options |
|
|
55
|
+
| `options-history` | Options sentiment over time |
|
|
56
|
+
| `portfolio` | Portfolio risk analysis |
|
|
57
|
+
| `trades` | AI trade evaluation |
|
|
58
|
+
| `catalysts` | Forward-looking value drivers |
|
|
59
|
+
| `position-size` | Kelly criterion sizing |
|
|
60
|
+
| `transcript` | Search earnings call transcripts |
|
|
61
|
+
|
|
62
|
+
## Global Flags
|
|
63
|
+
|
|
64
|
+
- `-o, --output <file>` — write to file
|
|
65
|
+
- `-f, --format json|csv|table` — output format
|
|
66
|
+
- `-q, --quiet` — data only
|
|
67
|
+
- `--raw` — raw API response
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Bloom CLI
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
export BLOOM_API_KEY=<your-key>
|
|
9
|
+
# Or: bloom auth login
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Quick Research Workflow
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# 1. Find what you need
|
|
16
|
+
bloom info AAPL # fundamentals, ratings, peers
|
|
17
|
+
bloom info AAPL --fields basic_metadata,bottom_line_ratings # specific sections only
|
|
18
|
+
|
|
19
|
+
# 2. Download to files for analysis
|
|
20
|
+
bloom info AAPL -o /tmp/bloom/aapl-info.json
|
|
21
|
+
bloom news AAPL --limit 10 -o /tmp/bloom/aapl-news.json
|
|
22
|
+
bloom price AAPL --timeframes 1m,1y -o /tmp/bloom/aapl-price.json
|
|
23
|
+
bloom financials AAPL --type revenue -o /tmp/bloom/aapl-revenue.json
|
|
24
|
+
|
|
25
|
+
# 3. Use bash to extract what matters
|
|
26
|
+
jq '.symbols[0].basic_metadata | {name, latest_price, sector, pe_ratio}' /tmp/bloom/aapl-info.json
|
|
27
|
+
jq '.articles[] | .headline' /tmp/bloom/aapl-news.json
|
|
28
|
+
jq '.data[] | select(.revenue_growth > 0.1)' /tmp/bloom/aapl-revenue.json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Commands
|
|
32
|
+
|
|
33
|
+
| Command | What it does | Example |
|
|
34
|
+
|---------|-------------|---------|
|
|
35
|
+
| `info` | Company fundamentals, ratings, peers | `bloom info AAPL MSFT` |
|
|
36
|
+
| `news` | Recent news headlines | `bloom news AAPL --limit 5` |
|
|
37
|
+
| `price` | Historical price data | `bloom price AAPL --timeframes 1d,1m,1y` |
|
|
38
|
+
| `financials` | Revenue, margins, cash flow | `bloom financials AAPL --type revenue` |
|
|
39
|
+
| `sentiment` | Market mood (AAII, Fear&Greed, VIX) | `bloom sentiment` |
|
|
40
|
+
| `market` | Market map, sectors, movers | `bloom market --type top_movers` |
|
|
41
|
+
| `collections` | Curated stock lists by theme | `bloom collections --section VALUE` |
|
|
42
|
+
| `screen` | Filter stocks by metrics | `bloom screen "market_cap > 100B" "pe < 25"` |
|
|
43
|
+
| `earnings` | Earnings history & estimates | `bloom earnings AAPL` |
|
|
44
|
+
| `technicals` | RSI, MAs, patterns, options flow | `bloom technicals AAPL` |
|
|
45
|
+
| `options-history` | Options sentiment over time | `bloom options-history AAPL --days 30` |
|
|
46
|
+
| `portfolio` | Portfolio risk analysis | `bloom portfolio '{"AAPL":0.5,"MSFT":0.5}'` |
|
|
47
|
+
| `trades` | AI trade evaluation | `bloom trades "Buy AAPL: strong AI catalysts"` |
|
|
48
|
+
| `catalysts` | Forward-looking value drivers | `bloom catalysts AAPL MSFT` |
|
|
49
|
+
| `position-size` | Kelly criterion sizing | `bloom position-size --bull 0.6 --bear -0.15 --conviction 8 --value 100000` |
|
|
50
|
+
| `transcript` | Search earnings call transcripts | `bloom transcript AAPL "AI" "services"` |
|
|
51
|
+
|
|
52
|
+
## Global Flags
|
|
53
|
+
|
|
54
|
+
Every command supports:
|
|
55
|
+
- `-o, --output <file>` — write to file instead of stdout
|
|
56
|
+
- `-f, --format json|csv|table` — output format (default: json)
|
|
57
|
+
- `-q, --quiet` — suppress headers, data only
|
|
58
|
+
- `--raw` — raw API response
|
|
59
|
+
|
|
60
|
+
## Common Patterns
|
|
61
|
+
|
|
62
|
+
### Compare Multiple Stocks
|
|
63
|
+
```bash
|
|
64
|
+
mkdir -p /tmp/bloom/compare
|
|
65
|
+
for ticker in AAPL MSFT GOOG AMZN; do
|
|
66
|
+
bloom info $ticker -o /tmp/bloom/compare/$ticker.json
|
|
67
|
+
done
|
|
68
|
+
# Extract key metrics
|
|
69
|
+
for f in /tmp/bloom/compare/*.json; do
|
|
70
|
+
ticker=$(basename $f .json)
|
|
71
|
+
pe=$(jq -r '.symbols[0].basic_metadata.pe_ratio // "N/A"' $f)
|
|
72
|
+
price=$(jq -r '.symbols[0].basic_metadata.latest_price' $f)
|
|
73
|
+
echo "$ticker: \$$price (P/E: $pe)"
|
|
74
|
+
done
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Screen → Deep Dive
|
|
78
|
+
```bash
|
|
79
|
+
# Find cheap large-caps
|
|
80
|
+
bloom screen "market_cap > 50B" "pe_ratio < 20" "dividend_yield > 2" -o /tmp/bloom/screened.json
|
|
81
|
+
|
|
82
|
+
# Get the tickers
|
|
83
|
+
tickers=$(jq -r '.results[].symbol' /tmp/bloom/screened.json | head -5 | tr '\n' ' ')
|
|
84
|
+
|
|
85
|
+
# Deep dive on each
|
|
86
|
+
for t in $tickers; do
|
|
87
|
+
bloom earnings $t -o /tmp/bloom/earnings-$t.json
|
|
88
|
+
bloom catalysts $t -o /tmp/bloom/catalysts-$t.json
|
|
89
|
+
done
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Market Check
|
|
93
|
+
```bash
|
|
94
|
+
bloom sentiment -o /tmp/bloom/sentiment.json
|
|
95
|
+
bloom market --type major_indexes -o /tmp/bloom/indexes.json
|
|
96
|
+
bloom market --type top_movers --limit 10 -o /tmp/bloom/movers.json
|
|
97
|
+
|
|
98
|
+
# Quick summary
|
|
99
|
+
jq '{fear_greed: .cnn_fear_greed.index_value, level: .cnn_fear_greed.level, vix: .volatility_analysis.assessment}' /tmp/bloom/sentiment.json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Portfolio Review
|
|
103
|
+
```bash
|
|
104
|
+
bloom portfolio '{"AAPL":0.3,"MSFT":0.25,"GOOG":0.25,"AMZN":0.2}' --strategy "tech growth" -o /tmp/bloom/portfolio.json
|
|
105
|
+
jq '.risk_metrics' /tmp/bloom/portfolio.json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Earnings Research
|
|
109
|
+
```bash
|
|
110
|
+
bloom transcript AAPL "AI" "services" "margins" --max-results 20 -o /tmp/bloom/transcript.json
|
|
111
|
+
jq '.matches[] | {speaker, text}' /tmp/bloom/transcript.json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Tips
|
|
115
|
+
|
|
116
|
+
- Use `-o` to download data to files, then `jq` to extract. Saves context tokens.
|
|
117
|
+
- Batch multiple tickers: `bloom info AAPL MSFT GOOG` (up to 10).
|
|
118
|
+
- Use `bloom screen` first to narrow your universe, then deep-dive with other commands.
|
|
119
|
+
- `--fields` on `bloom info` reduces response size when you only need specific sections.
|
|
120
|
+
- Pipe to `jq -r '.field'` for clean values usable in scripts.
|