Skip to content
/ tai Public

A powerful CLI companion that helps you remember terminal commands, powered by Google's Gemini 2.0 Flash model.

Notifications You must be signed in to change notification settings

ubranch/tai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tai (Terminal AI) πŸš€

A powerful CLI companion that helps you remember terminal commands, powered by Google's Gemini 2.0 Flash model.

Python Version License Conventional Commits Package Version

✨ Features

  • 🧠 Smart command suggestions based on natural language queries
  • 🎯 Platform-specific command recommendations
  • πŸ”„ Automatic retry with exponential backoff
  • 🎨 Rich terminal output with colored feedback
  • πŸ“ Detailed command explanations
  • πŸ“‹ Clipboard integration
  • ⚑ Powered by Gemini 2.0 Flash for superior speed and accuracy
  • πŸ›‘οΈ Graceful error handling and signal management
  • πŸ”Œ Easy to extend with modular architecture

πŸ”§ Requirements

  • Python 3.8 or higher
  • GEMINI_API_KEY environment variable (get it from Google AI Studio)

πŸ“¦ Installation

Using pip (global)

pwsh -Command "git clone https://github.com/ubranch/tai.git"
pwsh -Command "cd tai && pip install ."

For development:

# Clone the repository
pwsh -Command "git clone https://github.com/ubranch/tai.git"
pwsh -Command "cd tai"

# Install dependencies
pwsh -Command "uv venv --python 3.10"
pwsh -Command "uv activate"
pwsh -Command "uv pip install -r requirements.txt"

πŸ”‘ Setup

# Set your Gemini API key
pwsh -Command "$env:GEMINI_API_KEY='your_api_key_here'"

For permanent setup, add the above line to your PowerShell profile:

pwsh -Command "if (!(Test-Path -Path $PROFILE)) { New-Item -ItemType File -Path $PROFILE -Force }; Add-Content -Path $PROFILE -Value '$env:GEMINI_API_KEY=''your_api_key_here''''"

πŸš€ Usage

> tai "download youtube video as mp3"
yt-dlp -x --audio-format mp3 <youtube_video_url>
Downloads a YouTube video and converts it to an MP3 file using yt-dlp. Replace <youtube_video_url> with the actual URL.
Copy to clipboard? [y/n] (n): y
copied to clipboard!

πŸ“ Version History

5.4.1

  • fix: model name to use correct version identifier (gemini-2.0-flash)
  • docs: update documentation to reflect correct model information

5.4.0

  • feat: upgrade to Gemini 2.0 Flash model for superior speed and accuracy
  • perf: optimize model parameters for better command suggestions
  • feat: increase token limit for more detailed responses
  • tune: fine-tune temperature and top_p settings for improved stability

5.3.0

  • feat: update to use Gemini 1.5 Pro model for improved reliability
  • feat: add retry mechanism with exponential backoff
  • enhance: error handling and feedback
  • feat: add command explanations
  • improve: platform-specific command detection

πŸ”§ Development

Project Structure

tai/
β”œβ”€β”€ core/           # Core functionality
β”œβ”€β”€ utils/          # Utility functions
β”œβ”€β”€ cli.py          # Command-line interface
β”œβ”€β”€ config.py       # Configuration management
β”œβ”€β”€ prompt.md       # Prompt templates
└── __init__.py     # Package initialization

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes using conventional commits
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Commit Convention

We follow Conventional Commits. Examples:

  • feat: add new feature
  • fix: resolve bug
  • docs: update documentation
  • style: format code
  • refactor: restructure code
  • test: add tests
  • chore: update dependencies

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Google's Gemini team for providing the powerful AI model
  • The Python community for excellent libraries
  • All contributors who help make this project better

About

A powerful CLI companion that helps you remember terminal commands, powered by Google's Gemini 2.0 Flash model.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages