English | 한국어
A Node.js CLI tool for real-time monitoring of major U.S. economic indicators. Provides the latest economic data through the FRED (Federal Reserve Economic Data) API.
- 📈 Real-time Economic Indicators: Monitor major indicators like GDP, CPI, PPI, employment, and Fed rates
- 📊 Historical Data: Query historical data for any indicator with customizable limits
- 🔄 Live Monitoring Mode: Continuous data updates with --live option
- 🎯 Wall Street Estimates: Compare actual values with institutional forecasts for single indicators
- ⚡ Automatic Caching: 60-second cache for fast response times
- 🔒 Rate Limiting: Automatic API call management
- 🎨 Beautiful Output: Clean data display with colors and tables
| Code | Indicator | Description |
|---|---|---|
gdp |
GDP Growth Rate | Real Gross Domestic Product (Quarterly, Annualized) |
nonfarm |
Nonfarm Payrolls | Total Nonfarm Employment (Thousands) |
cpi |
Consumer Price Index (CPI) | Year-over-Year % Change in Urban Consumer Price Index |
ppi |
Producer Price Index (PPI) | Year-over-Year % Change in Producer Price Index for All Commodities |
corePce |
Core PCE Price Index | Year-over-Year % Change in PCE excluding Food and Energy |
fedRate |
Federal Funds Rate | Effective Federal Funds Rate (Daily) |
- Node.js 18.0.0 or higher
- npm or yarn
- FRED API Key (Get it here)
# Clone the repository
git clone https://github.com/yourusername/economy-cli.git
cd economy-cli
# Install dependencies
npm install --registry https://registry.npmjs.org/
# Build TypeScript
npm run build
# Global installation (optional)
npm link- Visit FRED website
- Create an account or sign in
- Request and obtain API key
Create a .env file in the project root:
FRED_API_KEY=your_api_key_here
CLI_LANG=en # Language setting (en/ko, default: en)
REFRESH_INTERVAL=30 # Refresh interval for --live option in seconds (default: 30)# Linux/Mac
export FRED_API_KEY=your_api_key_here
# Windows (PowerShell)
$env:FRED_API_KEY="your_api_key_here"
# Windows (CMD)
set FRED_API_KEY=your_api_key_here# Query all major economic indicators
economy --all
economy -a
# Query specific indicator
economy --indicator gdp
economy -i fedRate
# Query historical data
economy --indicator cpi --history 20
economy -i cpi -H 20
# List available indicators
economy --list
economy -l
# Live monitoring mode
economy --live # Monitor all indicators
economy --live gdp,cpi,fedRate # Monitor specific indicators
economy --live cpi --estimates # Monitor CPI with Wall Street estimates
# Show help
economy --help
economy -h$ economy --all
📊 U.S. Major Economic Indicators
┌─────────────────────┬──────────────────────┬──────────┬─────────────┐
│ Indicator │ Value │ Unit │ Date │
├─────────────────────┼──────────────────────┼──────────┼─────────────┤
│ GDP Growth Rate │ 25,460 (Billions) │ Billions │ Jan 2024 │
│ Nonfarm Payrolls │ 157,000 (Thousands) │ Thousands│ Jan 2024 │
│ CPI │ 2.94% │ % │ Jan 2024 │
│ PPI │ 2.73% │ % │ Jan 2024 │
│ Core PCE │ 2.91% │ % │ Jan 2024 │
│ Fed Rate │ 5.33% │ % │ Jan 2024 │
└─────────────────────┴──────────────────────┴──────────┴─────────────┘
ℹ️ Last updated: 2024-01-15 15:30:00$ economy --indicator fedRate --history 5
📊 Federal Funds Rate - Last 5 Data Points
Effective Federal Funds Rate (Daily)
┌─────────────────┬────────┐
│ Date │ Value │
├─────────────────┼────────┤
│ Jan 15, 2024 │ 5.33% │
│ Jan 14, 2024 │ 5.33% │
│ Jan 13, 2024 │ 5.33% │
│ Jan 12, 2024 │ 5.33% │
│ Jan 11, 2024 │ 5.33% │
└─────────────────┴────────┘$ economy --live gdp,cpi,fedRate
🔄 Real-time Economic Indicator Monitoring
Update interval: 30s | Exit: Ctrl+C
Current time: 2024-01-15 15:30:00
Update count: 1
┌─────────────────────┬──────────────────────┬──────────┬─────────────┐
│ Indicator │ Value │ Unit │ Date │
├─────────────────────┼──────────────────────┼──────────┼─────────────┤
│ GDP Growth Rate │ 25,460 (Billions) │ Billions │ Jan 2024 │
│ CPI │ 2.94% │ % │ Jan 2024 │
│ Fed Rate │ 5.33% │ % │ Jan 2024 │
└─────────────────────┴──────────────────────┴──────────┴─────────────┘
Next update in 30 seconds...$ economy --live cpi --estimates
🔄 Real-time Economic Indicator Monitoring
Update interval: 30s | Exit: Ctrl+C
Current time: 2024-01-15 15:30:00
Update count: 1
┌─────────────────────┬──────────────┬──────────┬─────────────┐
│ Indicator │ Value │ Unit │ Date │
├─────────────────────┼──────────────┼──────────┼─────────────┤
│ CPI │ 2.94% │ % │ Jan 2024 │
└─────────────────────┴──────────────┴──────────┴─────────────┘
📊 Wall Street Estimates vs Actual
Actual: 2.94%
Consensus: 2.80%
Difference: +0.14 (+5.00%) 📈
Estimate Range: 2.50% ~ 3.10%
Median: 2.80%
Number of Estimates: 15
Top Institutional Estimates:
┌─────────────────┬──────────┬───────────┬─────────────┐
│ Institution │ Estimate │ Confidence │ Date │
├─────────────────┼──────────┼───────────┼─────────────┤
│ Goldman Sachs │ 2.85% │ High │ Jan 10, 2024│
│ JP Morgan │ 2.80% │ High │ Jan 11, 2024│
│ Bank of America │ 2.75% │ High │ Jan 9, 2024 │
│ Morgan Stanley │ 3.10% │ Medium │ Jan 12, 2024│
│ Citi │ 2.50% │ Medium │ Jan 8, 2024 │
└─────────────────┴──────────┴───────────┴─────────────┘
Next Release Date: Jan 15, 2024# Run TypeScript files directly (development)
npm run dev
# Run tests
npm test
# Check test coverage
npm run test:coverage
# Run linter
npm run lint
# Format code
npm run formateconomy-cli/
├── src/
│ ├── api/
│ │ └── fredClient.ts # FRED API client
│ ├── commands/
│ │ └── indicators.ts # CLI command implementation
│ ├── types/
│ │ └── index.ts # TypeScript type definitions
│ ├── utils/
│ │ ├── config.ts # Configuration and constants
│ │ ├── formatter.ts # Output formatter
│ │ └── rateLimiter.ts # API rate limit management
│ ├── __tests__/ # Test files
│ └── index.ts # CLI entry point
├── .env.example # Environment variables example
├── package.json
├── tsconfig.json
├── vitest.config.ts
└── README.md
| Variable | Description | Default | Example |
|---|---|---|---|
FRED_API_KEY |
FRED API Key (Required) | None | your_api_key_here |
CLI_LANG |
Language setting | en |
ko or en |
REFRESH_INTERVAL |
Refresh interval for --live option (seconds) | 30 |
60 |
en: English (Default)ko: Korean
- Rate Limit: 120 requests per minute (FRED API default limit)
- Automatic Management: Rate limiter automatically adjusts request intervals
- Caching: 60-second cache to prevent unnecessary API calls
❌ Error: FRED_API_KEY environment variable is not set.
Solution:
- Add
FRED_API_KEY=your_keyto.envfile - Or set environment variable directly
❌ Error: API request limit exceeded. Please try again later.
Solution:
- Try again after 1-2 minutes
- Verify cache is enabled
❌ Error: FRED API Error: Network Error
Solution:
- Check internet connection
- Verify FRED API server status
- Check proxy settings
To contribute to this project:
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
MIT License - See LICENSE file for details.
- Federal Reserve Bank of St. Louis for providing the FRED API
- All contributors to the open source community