{"id":49802341,"url":"https://github.com/attajak/termux-ai","last_synced_at":"2026-05-12T15:37:56.904Z","repository":{"id":351772899,"uuid":"1212395278","full_name":"attajak/termux-ai","owner":"attajak","description":"A lightweight CLI tool for AI integration in your terminal. Souce code: https://github.com/estiaksoyeb/termai.git","archived":false,"fork":false,"pushed_at":"2026-05-09T16:54:34.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-09T18:36:47.942Z","etag":null,"topics":["ai","cli","gemini","openai","termux","termux-ai"],"latest_commit_sha":null,"homepage":"https://pypi.org/p/termux-ai","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/attajak.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"attajak","patreon":"attajak","open_collective":"attajak","ko_fi":"attajak","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"attajak","thanks_dev":"attajak","custom":["https://paypal.me/attajak"]}},"created_at":"2026-04-16T10:36:26.000Z","updated_at":"2026-05-09T16:54:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/attajak/termux-ai","commit_stats":null,"previous_names":["attajak/termux-ai"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/attajak/termux-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attajak%2Ftermux-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attajak%2Ftermux-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attajak%2Ftermux-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attajak%2Ftermux-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/attajak","download_url":"https://codeload.github.com/attajak/termux-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/attajak%2Ftermux-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32946146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T09:19:52.626Z","status":"ssl_error","status_checked_at":"2026-05-12T09:17:33.438Z","response_time":102,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","cli","gemini","openai","termux","termux-ai"],"created_at":"2026-05-12T15:37:51.528Z","updated_at":"2026-05-12T15:37:56.899Z","avatar_url":"https://github.com/attajak.png","language":"Python","funding_links":["https://github.com/sponsors/attajak","https://patreon.com/attajak","https://opencollective.com/attajak","https://ko-fi.com/attajak","https://buymeacoffee.com/attajak","https://thanks.dev/attajak","https://paypal.me/attajak"],"categories":[],"sub_categories":[],"readme":"# Termux-AI\n\n[![Release](https://github.com/attajak/termux-ai/actions/workflows/release.yml/badge.svg)](https://github.com/attajak/termux-ai/actions/workflows/release.yml)\n\nTermux-AI is a lightweight, zero-dependency CLI wrapper for Google's Gemini AI, built for Termux on Android and general Linux environments.\nIt brings the power of Large Language Models (LLMs) directly to your command line, following the Unix philosophy of piping and standard streams.\n\n## ⚡ Features\n * **🚀 Lightweight:** Uses standard Python requests. No heavy SDKs or complex dependencies.\n * **🟢 Unix Compatible:** Supports piping (stdin). Feed logs, code, or text files directly into the AI.\n * **🛠 Configurable:** Built-in JSON configuration system (ai --config) to edit System Prompts, Temperature, and Models.\n * **🛡 Secure:** Restricted file permissions (600) for configuration and header-based API key transmission.\n * **⏳ Robust:** Built-in request timeouts and error handling for unreliable connections.\n * **⚡ Fast:** Defaults to gemini-2.5-flash for instant responses.\n * **🎨 Clean UI:** Minimalist output with syntax-highlighted green text.\n * **🧹 Auto-Cleanup:** The installer sets everything up and deletes the repository to save space.\n\n## 📥 Installation\n### Method 1: Global Install (Recommended)\nYou can install Termux-AI directly using `pip` or `pipx`:\n```bash\n# Using pip\npip install termux-ai\n# Using pipx (isolated environment)\npipx install termux-ai\n```\nThis will make the `ai` command available globally.\n\n### Method 2: Manual Setup (for Development)\nIf you want to contribute or run Termux-AI in a development environment:\n```bash\ngit clone https://github.com/attajak/termux-ai.git\ncd termux-ai\npython -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n````\n\n## 🔑 Setup\nOn the very first run, Termai will ask for your Google Gemini API Key.\n * Get a free API key here: Google AI Studio\n * Run the command:\n ```bash\n   ai \"hello\"\n   ```\n\n * Paste your key when prompted. It will be saved locally.\n## 💻 Usage\n1. Basic Questions\nAsk anything directly from the terminal.\nai \"How do I untar a file in Linux?\"\n\n2. Piping (The Power Move)\nFeed output from other commands into Termux-AI.\nDebug an error log:\n```bash\ncat error.log | ai \"Explain what caused this crash\"\n```\n\nExplain a script:\n```bash\ncat install.sh | ai \"What does this script do?\"\n```\n\nGenerate code and save it:\n```bash\nai \"Write a Python hello world script\" \u003e hello.py\n```\n\n## ⚙️ Configuration\nTermux-AI comes with a built-in configuration editor. You can change the AI provider, model, and personality.\nRun:\n```bash\nai --config\n```\n\nThis opens `config.json` in your preferred editor. The editor is chosen based on the following priority:\n1.  The `$EDITOR` environment variable.\n2.  `vim` (if installed).\n3.  `nano` (as a fallback).\n\nThe configuration file looks like this:\n```json\n{\n    \"provider\": \"gemini\",\n    \"proxy\": \"http://user:pass@127.0.0.1:1080\",\n    \"request_timeout\": 30,\n    \"gemini_config\": {\n        \"api_key\": \"YOUR_GEMINI_KEY\",\n        \"model_name\": \"gemini-2.5-flash\",\n        \"system_instruction\": \"You are a CLI assistant for Termux...\",\n        \"generation_config\": {\n            \"temperature\": 0.7,\n            \"maxOutputTokens\": 1024\n        }\n    },\n    \"openai_config\": {\n        \"api_key\": \"YOUR_OPEN_KEY\",\n        \"model_name\": \"gpt-4o\",\n        \"system_instruction\": \"You are a helpful assistant.\",\n        \"temperature\": 0.7,\n        \"max_tokens\": 1024\n    }\n}\n```\n\n*   **`provider`**: Set to `\"gemini\"` or `\"openai\"` to choose your AI provider.\n*   **`proxy`**: (Optional) Set an HTTP or HTTPS proxy for all requests.\n*   **`request_timeout`**: (Optional) Maximum time in seconds to wait for a response (default: 30).\n*   **`gemini_config`**: Settings for when `provider` is `\"gemini\"`.\n    *   `model_name`: Change to `gemini-2.5-pro` or other available models.\n    *   `system_instruction`: Give the AI a persona.\n    *   `temperature`: Set to `1.0` for creative answers, `0.1` for precise logic.\n*   **`openai_config`**: Settings for when `provider` is `\"openai\"`.\n    *   `model_name`: Change to `gpt-3.5-turbo`, etc.\n    *   `system_instruction`: A different persona for ChatGPT.\n    *   `temperature`: Controls randomness.\n    *   `max_tokens`: The maximum number of tokens to generate.\n\n## 🛠 Development\nIf you want to contribute or run Termai in a development environment:\n\n1.  **Clone and set up a virtual environment:**\n    ```bash\n    git clone https://github.com/attajak/termux-ai.git\n    cd termux-ai\n    python -m venv .venv\n    source .venv/bin/activate\n    ```\n\n2.  **Install runtime dependencies:**\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n3.  **Install development tools (linters \u0026 test runner):**\n    ```bash\n    pip install -r requirements-dev.txt\n    ```\n\n4.  **Install editable package for development:**\n    ```bash\n    pip install -e .\n    # 'ai' will use the local development version\n    ```\n\nTesting \u0026 linting\n\n- Run all tests:\n```bash\npytest\n```\n\n- Run a single test:\n```bash\npytest tests/test_providers.py::test_gemini_success -q\n```\n\n- Run the linter (ruff):\n```bash\nruff check .\n```\n\n## ❓ Help \u0026 Troubleshooting\n**Command List:**\n```bash\nai --help\n```\n\n**Re-configure API Keys:**\n\nTo reset and re-enter your API keys, use the `--reinstall` flag.\n```bash\nai --reinstall\n```\n\n**Debug Mode:**\n\nIf the AI isn't responding or you are getting errors, run:\n```bash\nai --debug \"your question\"\n```\nThis will print the raw server response and error codes.\n\n**Debug Configuration:**\nIf you are having issues with your configuration, you can use the `--debug-config` flag to print the loaded configuration. API keys will be redacted for security.\n```bash\nai --debug-config\n```\n\n## 🗑 Uninstallation\n### If installed via pip/pipx:\n```bash\npip uninstall termux-ai\n# or\npipx uninstall termux-ai\n```\n\n## 📄 License\nThis project is licensed under the MIT License.\nYou are free to use, modify, and distribute this software. See the LICENSE file for more details.\n\u003cp align=\"center\"\u003e\nMade with ❤️ for CLI enthusiasts\n\u003c/p\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003eSource codes\u003c/summary\u003e\nhttps://github.com/estiaksoyeb/termai.git\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fattajak%2Ftermux-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fattajak%2Ftermux-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fattajak%2Ftermux-ai/lists"}