Termux-AI is a lightweight, zero-dependency CLI wrapper for AI models (Gemini, OpenAI, Groq, Mistral), built for Termux on Android and general Linux environments. It brings the power of LLMs directly to your command line, following the Unix philosophy of piping and standard streams.
- 🚀 Lightweight: Uses standard Python requests. No heavy SDKs.
- 🟢 Unix Compatible: Supports piping (stdin).
- 🛠 Configurable: JSON configuration system (
ai -c) for Prompts, Temperature, and Models. - 🛡 Secure: Restricted file permissions (600) for configuration.
- ⏳ Robust: Built-in request timeouts and error handling.
- 💬 Chat Mode: Keeps conversation context using
--chatflag. - ⚡ Streaming: Real-time response streaming for a better experience.
- 🔑 Env Support: Supports
GEMINI_API_KEY,OPENAI_API_KEY,GROQ_API_KEY, andMISTRAL_API_KEYenvironment variables.
pip install termux-ai
# or
pipx install termux-aiOn the very first run, Termux-AI will ask for your AI provider and API Key.
- Your configuration and history will be saved at
~/.local/share/termux-ai/.
ai "How do I untar a file in Linux?"cat error.log | ai "Explain what caused this crash"ai --chat "I want to learn Python."
# Next query...
ai --chat "What was the first thing I asked you?"Run ai -c to open your configuration in your default editor.
See GEMINI.md for development workflows, testing, and contribution guidelines.
MIT License.