thelapyae
v0.5.0
Published
Personal CLI of La Pyae – mental models, stoicism, clear thinking
Readme
thelapyae
The personal CLI of La Pyae (@thelapyae) – a collection of mental models for clear thinking, decision making, and problem solving, powered by AI.
_ _ _
| |_| |__ ___| | __ _ _ __ _ _ __ _ ___
| __| '_ \ / _ \ |/ _` | '_ \| | | |/ _` |/ _ \
| |_| | | | __/ | (_| | |_) | |_| | (_| | __/
\__|_| |_|\___|_|\__,_| .__/ \__, |\__,_|\___|
|_| |___/ 🚀 Introduction
thelapyae is a command-line tool designed to help you think better. It provides instant access to a curated library of 98 mental models (like Inversion, First Principles, Circle of Competence).
It features a Think-with-AI mode where it acts as a consultant, analyzing your specific life or work problems using these mental models to provide actionable advice. Even without AI, it provides powerful offline synthesis combining multiple perspectives.
✨ What's New in v0.5.0
- 🎨 Unified TUI Experience: Entirely redesigned terminal interface with consistent branding (#f3c12b).
- ⌨️ Slash Command Power: New
/newand/exitcommands for better session management. - 🔍 Integrated CLI-to-TUI: Run
thelapyae "question"to jump directly into a TUI consultation. - 📑 Inline Views: Help, Configuration, and Sessions now display inline for a smoother workflow.
- ⌨️ Esc to Back: Standardized Esc key navigation to return to the welcome screen from anywhere.
- 🎯 Fixed Input: Resolved double-character and Vim mode issues for a fluid typing experience.
Previous Updates (v0.2.0-v0.3.0)
- 🔐 Secure Storage: API keys now stored in OS keychain (not plain text)
- 🔍 Better Search: Fuzzy matching with typo tolerance
- 🧠 Offline Mode: Multi-model synthesis without requiring API key
- 🎨 Beautiful Output: Colors, spinners, and better formatting
- 🛡️ Error Handling: Helpful error messages with suggestions
- ✅ Tested: 34 unit tests ensuring quality
- 📝 More Commands: Comprehensive CLI with flags and options
📦 Installation
You don't need to install anything if you just want to run it once:
npx thelapyae "I feel overwhelmed"To install it globally for faster access:
npm install -g thelapyae💡 Usage
TUI Mode (Recommended) 🎨
The new rich terminal interface provides a beautiful, interactive experience:
$ thelapyae
# You'll see a stunning centralized interface:
# - Header: Brand logo and version
# - Content: Consultations, Help, or History
# - Bottom: Responsive input box
# Commands:
# /help - Show interactive help
# /new - Start a new session
# /exit - Cleanly quit
# /random - Get a random model
# /list - List all models
# /sessions - View past sessions
# /config - Setup API key
# Navigation:
# Enter - Submit question/command
# Esc - Back to Welcome / Clear input
# Ctrl+C - Force QuitFeatures:
- 🎨 Beautiful interface with brand colors
- ⌨️ Intuitive slash commands
- 🔍 Live autocomplete as you type
/ - 💬 Interactive AI consultations
- 📚 Browse session history inline
- 🎯 Zero mouse required
Interactive Mode (Classic)
Just run thelapyae to enter an immersive interactive session:
$ thelapyae
╭ thelapyae v0.3.0 ──────────────────────────────╮
│ │
│ Welcome! Ask me anything about thinking, │
│ decisions, or life. │
│ │
│ 💡 Tips │
│ Just type your question and press Enter │
│ Commands: /random /list /sessions /help │
│ │
╰─────────────────────────────────────────────────╯
> Should I quit my job?
[Interactive consultation with reflection questions...]
> /random
[Shows random mental model...]
> /exitIn interactive mode:
- Just type your question and press Enter
- Use
/helpto see available commands - Use
/random,/list,/sessions,/config - Use
/exitto quit
Quick Commands
You can also use thelapyae directly from the command line:
# Get AI-powered advice
thelapyae "I feel overwhelmed"
# Get offline advice (no API key needed)
thelapyae consult "I feel anxious" --no-ai
# Get a random mental model
thelapyae random
# Search for models
thelapyae search "decision making"
# List all models
thelapyae list
# List by category
thelapyae list --category "Economics"
# View history
thelapyae sessions
# Setup AI (one-time)
thelapyae configCommands
thelapyae consult <query>
Get AI-powered or offline advice using mental models.
# AI mode (requires API key)
thelapyae "I'm feeling overwhelmed with too many projects"
# Offline mode (no API key needed)
thelapyae consult "Should I take this job?" --no-ai
# Use more models
thelapyae consult "How do I prioritize?" --model-count 5thelapyae search <query>
Search for mental models with fuzzy matching.
# Find models about thinking
thelapyae search "thinking"
# Limit results
thelapyae search "decision" --limit 3
# Search handles typos
thelapyae search "invertion" # Finds "inversion"thelapyae list
List all mental models or filter by category.
# List all
thelapyae list
# Filter by category
thelapyae list --category "General Thinking"
# Table format
thelapyae list --format table
# JSON format
thelapyae list --format jsonthelapyae random
Get a random mental model for daily inspiration.
thelapyae randomthelapyae config
Manage your API key and preferences.
# Interactive setup
thelapyae config
# Show current config
thelapyae config --show
# Test API key
thelapyae config --test
# Reset (delete API key)
thelapyae config --resetGlobal Options
--help, -h Show help
--version, -v Show version
--no-color Disable colored output
--verbose Show detailed output🔑 Configuration (AI Setup)
To enable the AI consulting feature, you need a Google Gemini API Key.
- Get your free key from Google AI Studio.
- Run the config command:
thelapyae config- Paste your API key when prompted. It will be saved securely in your OS keychain.
Note: Your API key is stored securely in:
- macOS: Keychain
- Windows: Credential Manager
- Linux: Secret Service
Old plain-text keys are automatically migrated on first run.
🧠 Mental Models
This CLI includes 98 models from various disciplines:
- General Thinking Tools (Inversion, Second-Order Thinking, First Principles)
- Stoicism (Circle of Control, Premeditatio Malorum)
- Decision Making (Opportunity Cost, Regret Minimization)
- Economics (Sunk Cost, Compound Interest, Supply and Demand)
- Human Nature (Confirmation Bias, Social Proof, Incentives)
- Systems Thinking (Feedback Loops, Leverage Points)
- And many more...
🧪 Development
# Install dependencies
npm install
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch📝 Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
📄 License
MIT © La Pyae
🙏 Acknowledgments
- Mental models curated from various sources
- Powered by Google Gemini AI
- Built with Node.js, Commander.js, Chalk, Ora, Fuse.js, and more
