Stock Tracker CLI is a powerful command-line tool that enables easy management of your stock portfolio while providing AI-powered investment analysis. With features like real-time stock data, intelligent insights, and automated email reports, it streamlines investment tracking and helps make informed decisions.
Stock Tracker CLI
A powerful command-line tool designed for comprehensive stock portfolio management, equipped with AI-driven investment analysis. This CLI interface simplifies tracking stock positions and provides real-time insights to enhance investment strategies.
Features
- š Portfolio Management: Easily add and remove stock positions along with purchase prices to maintain an updated portfolio.
- š¹ Real-time Data Access: Retrieve current stock prices through the Alpha Vantage API ensuring timely data.
- š¤ AI-Driven Insights: Leverage the intelligence of Groq's LLM (llama-3.3-70b-versatile) for sophisticated analysis of market trends.
- š§ Email Reports: Generate and send HTML-formatted reports containing AI insights directly to your email.
- ā” Smart Caching Mechanism: Utilizes a 15-minute cache to minimize unnecessary API calls, improving efficiency.
- š³ Docker Support: Deploy effortlessly with Docker, allowing for automated scheduled reports in a reliable containerized environment.
Quick Start
Configuration of API Keys
Begin by configuring the necessary API keys to ensure seamless data retrieval and analysis:
# Configure Groq API key for AI analysis
stock-tracker setup-ai
# Configure Alpha Vantage API key for stock data
stock-tracker setup-alpha-vantage
# Configure email settings (optional for sending reports)
stock-tracker setup-email
Obtain Free API Keys:
- Groq: Groq Console
- Alpha Vantage: Alpha Vantage Support
Managing Stock Positions
Add stock positions with ease:
# Add stock positions
stock-tracker add AAPL 10 150.00
stock-tracker add MSFT 5 300.00
stock-tracker add GOOGL 3 2800.00
Generating Reports
Quickly generate reports to assess portfolio performance:
# View the portfolio report in the terminal
stock-tracker report
# Obtain AI-powered analysis
stock-tracker ai-report
# Send AI report via email
stock-tracker ai-report --email recipient@example.com
Example Output
Here is a sample report generated by the Stock Tracker CLI:
Stock Portfolio Report
Generated on: 2025-11-09 10:30:00
āāāāāāāāāā¦āāāāāāāāāāā¦āāāāāāāāāāāāāāāāā¦āāāāāāāāāāāāāāāā¦āāāāāāāāāāāāā¦āāāāāāāāāāāāāāāāāā
ā Symbol ā Quantity ā Purchase Price ā Current Price ā Value ā Gain/Loss (%) ā
ā āāāāāāāāā¬āāāāāāāāāāā¬āāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāā¬āāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāā£
ā AAPL ā 10.0 ā $150.00 ā $178.50 ā $1,785.00 ā +$285.00 (+19%) ā
ā MSFT ā 5.0 ā $300.00 ā $385.20 ā $1,926.00 ā +$426.00 (+28%) ā
ā GOOGL ā 3.0 ā $2,800.00 ā $2,950.00 ā $8,850.00 ā +$450.00 (+5%) ā
āāāāāāāāāā©āāāāāāāāāāā©āāāāāāāāāāāāāāāāā©āāāāāāāāāāāāāāāā©āāāāāāāāāāāāā©āāāāāāāāāāāāāāāāāā
Portfolio Summary:
Total Value: $12,561.00
Total Gain/Loss: +$1,161.00 (+10.2%)
Docker Deployment
For those preferring containerized solutions, utilize Docker for easy creation and execution:
# Build the image
docker-compose build
# Run one-time report
docker-compose run stock-tracker stock-tracker report
# Schedule reports (daily at 4:30 PM UTC on weekdays)
docker-compose up -d cron
Environment Variables
Set up essential variables within a .env file:
GROQ_API_KEY=your_groq_api_key
ALPHA_VANTAGE_API_KEY=your_alpha_vantage_key
EMAIL_SMTP_SERVER=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USERNAME=your_email@gmail.com
EMAIL_PASSWORD=your_app_password
EMAIL_RECIPIENT=recipient@example.com
Requirements
- Python 3.8 or higher
- Active internet connection for API access
- Valid API keys for Groq and Alpha Vantage
- SMTP server access is needed for email functionality (optional)
Dependencies
Utilizes various Python packages for enhanced functionality, including click for CLI operations and pandas for data manipulation.
Contribution and Support
Contributions are encouraged and can be made via Pull Requests. For any issues encountered, kindly report them on the GitHub Issues page.
Stock Tracker CLI provides a streamlined method for managing stock investments while accessing AI-powered market insights, making it an essential tool for investors looking to optimize their portfolios.
No comments yet.
Sign in to be the first to comment.