Skip to content

AutumnsGrove/TerminalQuotes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Stoic Terminal

A context-aware terminal tool that displays philosophical quotes with ASCII art based on your current environment - time of day, weather conditions, and git activity.

🌟 Features

  • Context-Aware Quote Selection: Uses semantic search with embeddings to match quotes to your current situation
  • Beautiful ASCII Art: Hand-curated ASCII art that adapts to terminal width (40/60/80/120 columns)
  • Zero API Keys Required: Works immediately with no configuration (uses Open-Meteo weather API)
  • Git Activity Analysis: Optional integration that analyzes recent commits to provide relevant wisdom
  • Lightning Fast: <500ms startup, <100ms quote display
  • 250+ Curated Quotes: High-quality quotes from stoic philosophers, military strategists, and wisdom traditions

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/yourusername/stoic-terminal.git
cd stoic-terminal

# Install with UV (recommended)
uv tool install .

# Or install with pip
pip install -e .

Basic Usage

# Display context-aware quote
stoic-terminal

# Display random quote
stoic-terminal --random

# Force specific theme
stoic-terminal --theme meditation

# Configure location for weather
stoic-terminal --config-location "Atlanta, GA"

# Run on terminal startup (add to .bashrc or .zshrc)
echo "stoic-terminal" >> ~/.bashrc

πŸ“‹ Project Status

Currently following the 7-day implementation plan. See TODOS.md for current progress.

Implementation Roadmap

  • Day 1: Database setup + 250 quote collection ⏳
  • Day 2: ASCII art curation (30 pieces)
  • Day 3: Semantic search with embeddings
  • Day 4: Context detection (time/weather/git)
  • Day 5: CLI + display rendering
  • Day 6: Configuration + error handling
  • Day 7: Testing + documentation

πŸ› οΈ Tech Stack

  • Language: Python 3.10+
  • Package Manager: UV
  • Database: SQLite (embedded)
  • Key Libraries:
    • sentence-transformers - Semantic search (all-MiniLM-L6-v2 model)
    • requests - Weather API integration
    • pyfiglet - ASCII text rendering
    • pyyaml - Configuration management
    • numpy - Embedding operations

πŸ—οΈ Architecture

Hybrid Search System

  1. Tag-based filtering - Narrow down quotes by relevant themes
  2. Semantic search - Find the most contextually relevant quote using embeddings
  3. ASCII art selection - Match art to quote theme and terminal width

Context Detection Flow

Time Detection β†’ Weather API β†’ Git Analysis β†’ Tag Extraction β†’ Semantic Search β†’ Display

Performance Targets

  • βœ… Startup time: <500ms
  • βœ… Quote display: <100ms
  • βœ… Memory usage: <150MB

πŸ“ Project Structure

StoicTerminal/
β”œβ”€β”€ CLAUDE.md                   # Project instructions for Claude Code
β”œβ”€β”€ README.md                   # This file
β”œβ”€β”€ TODOS.md                    # Current task list
β”œβ”€β”€ pyproject.toml              # UV configuration
β”œβ”€β”€ secrets_template.json       # Template for API keys (none needed!)
β”œβ”€β”€ .gitignore                  # Git ignore patterns
β”‚
β”œβ”€β”€ src/
β”‚   └── stoic_terminal/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ cli.py              # Command-line interface
β”‚       β”œβ”€β”€ database.py         # SQLite abstraction
β”‚       β”œβ”€β”€ embeddings.py       # Semantic search
β”‚       β”œβ”€β”€ context.py          # Context detection
β”‚       β”œβ”€β”€ git_analyzer.py     # Git activity analysis
β”‚       β”œβ”€β”€ ascii_art.py        # ASCII art loading
β”‚       └── display.py          # Display orchestration
β”‚
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ quotes_v1.db            # Quote database
β”‚   β”œβ”€β”€ git_sessions.db         # Git history (user-specific)
β”‚   └── ascii_art/              # Curated ASCII art
β”‚       β”œβ”€β”€ metadata.yaml
β”‚       β”œβ”€β”€ meditation/
β”‚       β”œβ”€β”€ adversity/
β”‚       β”œβ”€β”€ exploration/
β”‚       β”œβ”€β”€ nature/
β”‚       β”œβ”€β”€ wisdom/
β”‚       └── general/
β”‚
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ test_database.py
β”‚   β”œβ”€β”€ test_embeddings.py
β”‚   β”œβ”€β”€ test_context.py
β”‚   └── test_ascii_art.py
β”‚
└── ClaudeUsage/                # Development workflow guides
    β”œβ”€β”€ README.md
    β”œβ”€β”€ git_workflow.md
    β”œβ”€β”€ secrets_management.md
    β”œβ”€β”€ uv_usage.md
    └── ... (18 comprehensive guides)

πŸ” Security & Privacy

  • No API keys required for basic functionality
  • Optional features can be disabled (weather, git analysis)
  • Local-only data - No telemetry or external tracking
  • Open source - Full transparency

πŸ§ͺ Development

Running Tests

# Run all tests
uv run pytest

# Run with coverage
uv run pytest --cov=stoic_terminal

# Run specific test file
uv run pytest tests/test_database.py

Running Day 1 Starter Code

# Collect initial 250 quotes
uv run python day1_starter_code.py

πŸ“š Quote Sources

All quotes are properly attributed and sourced from:

  • Quotable API - MIT licensed, public domain quotes
  • Project Gutenberg - Classic texts (Marcus Aurelius, Seneca, Sun Tzu, Epictetus)
  • Curated Collections - Hand-selected for quality and relevance

Legal Safety

  • Pre-1930 published works (public domain)
  • Proper attribution for all quotes
  • Translator credits where applicable
  • Copyright status tracked in database

🎨 ASCII Art Sources

🀝 Contributing

Contributions welcome! Please read ClaudeUsage/documentation_standards.md for guidelines.

Adding Quotes

  1. Follow the quote schema in database.py
  2. Include proper attribution (author, source, year, translator)
  3. Add 3-5 relevant theme tags
  4. Verify copyright status (prefer public domain)

Adding ASCII Art

  1. Place in appropriate theme directory
  2. Update metadata.yaml
  3. Create size variants for different terminal widths
  4. Include artist attribution if known

πŸ”§ Configuration

Optional configuration file: ~/.config/stoic-terminal/config.toml

[location]
city = "Atlanta, GA"
# or use coordinates
latitude = 33.7490
longitude = -84.3880

[features]
weather_enabled = true
git_analysis_enabled = true

[display]
default_theme = "random"  # or: meditation, adversity, exploration, etc.
terminal_width = "auto"   # or: 40, 60, 80, 120

πŸ“– Documentation

πŸ› Troubleshooting

"Model download too slow"

The sentence-transformers model (~90MB) is downloaded on first run. Subsequent runs are instant.

"ASCII art looks weird"

Check terminal encoding: echo $LANG (should be UTF-8). Use --text-only flag if issues persist.

"Weather not updating"

Weather data is cached for 60 minutes. Use --force-refresh to update immediately.

"Quotes feel repetitive"

Increase the quote database size or adjust tag diversity. See CONTRIBUTING.md for adding more quotes.

πŸ“ License

MIT License - See LICENSE for details

πŸ™ Acknowledgments

  • Quotable API - Luke Peavey (quotable.io)
  • Open-Meteo - Free weather API with no key required
  • sentence-transformers - Hugging Face semantic search library
  • Project Gutenberg - Public domain classics
  • asweigart - ASCII Art JSON Database

🎯 What's Next?

  1. Complete Day 1 - Run day1_starter_code.py to populate the database
  2. Follow Implementation Plan - See stoic-terminal-implementation-plan.md
  3. Track Progress - Update TODOS.md as you build
  4. Ship v1.0 - 250 quotes, 30 art pieces, full context awareness

Last updated: 2025-10-20 Status: In Development (Day 1) Target Release: v1.0 (7 days from start)

About

Context-aware terminal quotes with ASCII art

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors