{"id":30474664,"url":"https://github.com/oop7/OrChat","last_synced_at":"2025-08-24T10:05:27.754Z","repository":{"id":283239037,"uuid":"950580200","full_name":"oop7/OrChat","owner":"oop7","description":"A powerful, feature-rich command-line interface for interacting with AI models through OpenRouter.","archived":false,"fork":false,"pushed_at":"2025-08-22T23:43:53.000Z","size":129,"stargazers_count":35,"open_issues_count":4,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-23T01:31:00.184Z","etag":null,"topics":["ai","chatbot","cli","llm","openrouter","terminal"],"latest_commit_sha":null,"homepage":"","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/oop7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2025-03-18T11:32:44.000Z","updated_at":"2025-08-22T23:43:37.000Z","dependencies_parsed_at":"2025-05-11T19:25:02.482Z","dependency_job_id":"56f37d21-da41-427b-85ae-415769b25b46","html_url":"https://github.com/oop7/OrChat","commit_stats":null,"previous_names":["oop7/orchat"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/oop7/OrChat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oop7%2FOrChat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oop7%2FOrChat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oop7%2FOrChat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oop7%2FOrChat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oop7","download_url":"https://codeload.github.com/oop7/OrChat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oop7%2FOrChat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271841856,"owners_count":24832255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","chatbot","cli","llm","openrouter","terminal"],"created_at":"2025-08-24T10:01:36.123Z","updated_at":"2025-08-24T10:05:27.745Z","avatar_url":"https://github.com/oop7.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\r\n\r\n# 🤖 OrChat\r\n\r\n\u003cimg src=\"https://github.com/user-attachments/assets/df20dccc-8971-414e-9281-74260f05bf44\" width=\"800\" alt=\"OrChat Interface\"/\u003e\r\n\r\n[![PyPI version](https://img.shields.io/pypi/v/orchat?color=86efac\u0026style=for-the-badge\u0026logo=pypi\u0026logoColor=black)](https://badge.fury.io/py/orchat)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-10b981?style=for-the-badge\u0026logo=opensource\u0026logoColor=white)](https://opensource.org/licenses/MIT)\r\n[![Python 3.9+](https://img.shields.io/badge/python-3.9+-10b981?style=for-the-badge\u0026logo=python\u0026logoColor=white)](https://www.python.org/downloads/)\r\n[![Downloads](https://img.shields.io/pepy/dt/orchat?color=1f2937\u0026style=for-the-badge\u0026logo=download\u0026logoColor=white)](https://pepy.tech/project/orchat)\r\n[![GitHub Stars](https://img.shields.io/github/stars/oop7/OrChat?color=86efac\u0026style=for-the-badge\u0026logo=github\u0026logoColor=black)](https://github.com/oop7/OrChat/stargazers)\r\n\r\n[🚀 Installation](#installation) • [✨ Features](#features) • [💬 Chat Commands](#chat-commands) • [📁 File Attachment](#file-attachment) • [🧠 Thinking Mode](#thinking-mode) • [⚙️ Configuration](#configuration) • [🔍 Troubleshooting](#troubleshooting) • [🤝 Contributing](#contributing)\r\n\r\nA powerful CLI for chatting with AI models through OpenRouter with streaming responses, token tracking, auto-update checking, multi-line input, and extensive customization options.\r\n\r\n\u003c/div\u003e\r\n\r\n\r\n\u003ca id=\"features\"\u003e\u003c/a\u003e\r\n## ✨ Features\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e🔗 Core Features\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n- **Universal Model Access**: Connect to any AI model available on OpenRouter with dynamic model retrieval\r\n- **Interactive Chat**: Enjoy a smooth conversation experience with real-time streaming responses\r\n- **Rich Markdown Rendering**: View formatted text, code blocks, tables and more directly in your terminal\r\n- **Performance Analytics**: Track token usage, response times, and total cost for efficiency monitoring (now with accurate API-based token counting)\r\n- **Command Auto-completion**: Enhanced user experience with intelligent command suggestions and prompt history navigation\r\n- **Prompt History Navigation**: Use ↑/↓ arrow keys to navigate through previous prompts and Ctrl+R for history search\r\n- **Pricing Display**: Real-time pricing information displayed during active chat sessions\r\n- **Auto-Update System**: Automatic update checking at startup with pip integration\r\n- **Multi-line Input Support**: Compose multi-paragraph messages with `Esc+Enter` and visual feedback\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e📎 File \u0026 Media Support\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n- **Smart File Picker**: Attach files anywhere in your message using `#` (e.g., `analyze #myfile.py`)\r\n- **Interactive File Browser**: Browse files with icons, sizes, and directory navigation in a popup interface\r\n- **Multimodal Support**: Share images and various file types with compatible AI models\r\n- **Enhanced File Processing**: Improved file attachment with better error handling and path support\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e🧠 Advanced Features\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n- **Smart Thinking Mode**: See the AI's reasoning process with compatible models\r\n- **Multiple Export Formats**: Save conversations as Markdown, HTML, JSON, TXT, or PDF\r\n- **Smart Context Management**: Automatically manages conversation history to stay within token limits\r\n- **Customizable Themes**: Choose from different visual themes for your terminal\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e⌨️ Interactive Input Features\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n- **Multi-line Input**: Use `Esc+Enter` to toggle multi-line mode, with status indicator and seamless toggling\r\n- **Command History Navigation**: Press ↑/↓ arrow keys to cycle through previous prompts and commands\r\n- **History Search**: Use Ctrl+R to search through your prompt history with keywords\r\n- **Automatic Command Completion**: Start typing \"/\" and command suggestions appear instantly - no Tab key needed!\r\n- **Auto-Suggest from History**: Previous commands and prompts appear as grey suggestions as you type\r\n- **Intelligent File Picker**: Use `#` anywhere in your message for file selection with auto-completion and browser popup\r\n\r\n**💡 How Auto-Completion Works:**\r\n- Type `/` → All available commands appear automatically\r\n- Type `/c` → Filters to commands starting with 'c' (clear, cls, clear-screen, etc.)\r\n- Type `/temp` → Shows `/temperature` command\r\n- Type `/think` → Shows `/thinking` and `/thinking-mode` commands\r\n- No Tab key required - completions appear as you type!\r\n\r\n**💡 How File Picker Works:**\r\n- Type `#` anywhere in your message to open the file picker\r\n- Choose files interactively (with icons for file types)\r\n- Insert filenames naturally into your prompt, e.g., `examine #test.py and check for errors`\r\n- File picker works anywhere in your message, not just at the beginning\r\n\r\n\u003c/details\u003e\r\n\r\n\u003ca id=\"installation\"\u003e\u003c/a\u003e\r\n## 🚀 Installation\r\n\r\n\u003csummary\u003e\u003cstrong\u003e📦 Installation Methods\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n### From PyPI (Recommended)\r\n\r\n```bash\r\npip install orchat\r\n```\r\n```bash\r\n# Run the application\r\norchat\r\n```\r\n\r\n### From Source\r\n\r\n```bash\r\ngit clone https://github.com/oop7/OrChat.git\r\npip install -r requirements.txt\r\npython main.py\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e📋 Prerequisites\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n- Python 3.7 or higher\r\n- An OpenRouter API key (get one at [OpenRouter.ai](https://openrouter.ai))\r\n- Required packages: in `requirements.txt`\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e🏁 Getting Started\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n1. Install OrChat using one of the methods above\r\n2. Run the setup wizard\r\n   - if you follow from source PyPI:\r\n     ```bash\r\n     orchat --setup\r\n     ```\r\n   - if you follow from source method:\r\n     ```bash\r\n     python main.py --setup\r\n     ```\r\n3. Enter your OpenRouter API key when prompted\r\n4. Select your preferred AI model and configure settings\r\n5. Start chatting!\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e🪛 Add-Ons\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n### FZF fuzzy search (Enhanced Model Selection)\r\n\r\n1. Install fzf and pyfzf\r\n\r\n   - Install pyfzf\r\n     ```bash\r\n     pip install pyfzf\r\n     ```\r\n   - Fzf can be downloaded from https://github.com/junegunn/fzf?tab=readme-ov-file#installation\r\n\r\n2. Ensure fzf is in your path\r\n3. From now on, the model selection will use fzf for powerful fuzzy search and filtering capabilities!\r\n\r\n**Note**: If fzf is not installed, OrChat will automatically fall back to standard model selection.\r\n\r\n\u003c/details\u003e\r\n\r\n\u003ca id=\"configuration\"\u003e\u003c/a\u003e\r\n## ⚙️ Configuration\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e🔧 Configuration Methods\u003c/strong\u003e\u003c/summary\u003e\r\n\r\nOrChat can be configured in multiple ways:\r\n\r\n1. **Setup Wizard**: Run `python main.py --setup` for interactive configuration\r\n2. **Config File**: Edit the `config.ini` file in the application directory\r\n3. **Environment Variables**: Create a `.env` file with your configuration\r\n4. **System Environment Variables**: Set environment variables directly in your system (recommended for security)\r\n\r\n**Enhanced Environment Support**: OrChat now supports system/user environment variables, removing the strict requirement for `.env` files.\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e📄 Configuration Examples\u003c/strong\u003e\u003c/summary\u003e\r\n\r\nExample `.env` file:\r\n\r\n```\r\nOPENROUTER_API_KEY=your_api_key_here\r\n```\r\n\r\nExample `config.ini` structure:\r\n\r\n```ini\r\n[API]\r\nOPENROUTER_API_KEY = your_api_key_here\r\n\r\n[SETTINGS]\r\nMODEL = anthropic/claude-3-opus\r\nTEMPERATURE = 0.7\r\nSYSTEM_INSTRUCTIONS = You are a helpful AI assistant.\r\nTHEME = default\r\nMAX_TOKENS = 8000\r\nAUTOSAVE_INTERVAL = 300\r\nSTREAMING = True\r\nTHINKING_MODE = False\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e🖥️ Command-Line Options\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n- `--setup`: Run the setup wizard\r\n- `--model MODEL`: Specify the model to use (e.g., `--model \"anthropic/claude-3-opus\"`)\r\n- `--task {creative,coding,analysis,chat}`: Optimize for a specific task type\r\n- `--image PATH`: Analyze an image file\r\n\r\n\u003c/details\u003e\r\n\r\n\u003ca id=\"chat-commands\"\u003e\u003c/a\u003e\r\n## 💬 Chat Commands\r\n\r\n| Command                   | Description                                           |\r\n| ------------------------- | ----------------------------------------------------- |\r\n| `/help`                   | Show available commands                               |\r\n| `/exit`                   | Exit the chat                                         |\r\n| `/quit`                   | Exit the chat                                         |\r\n| `/new`                    | Start a new conversation                              |\r\n| `/clear`                  | Clear conversation history                            |\r\n| `/cls` or `/clear-screen` | Clear the terminal screen                             |\r\n| `/save [format]`          | Save conversation (formats: md, html, json, txt, pdf) |\r\n| `/model`                  | Change the AI model                                   |\r\n| `/temperature \u003c0.0-2.0\u003e`  | Adjust temperature setting                            |\r\n| `/system`                 | View or change system instructions                    |\r\n| `/tokens`                 | Show token usage statistics (now API-accurate)        |\r\n| `/speed`                  | Show response time statistics                         |\r\n| `/theme \u003ctheme\u003e`          | Change the color theme (default, dark, light, hacker) |\r\n| `/thinking`               | Show last AI thinking process                         |\r\n| `/thinking-mode`          | Toggle thinking mode on/off                           |\r\n| `/about`                  | Show information about OrChat                         |\r\n| `/update`                 | Check for updates                                     |\r\n| `/settings`               | View current settings                                 |\r\n\r\n\u003ca id=\"file-attachment\"\u003e\u003c/a\u003e\r\n## 📁 File Attachment\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e📎 Basic Usage\u003c/strong\u003e\u003c/summary\u003e\r\n\r\nAttach files naturally in your messages using the smart file picker:\r\n\r\n```\r\nanalyze #path/to/your/file.ext for issues\r\nexamine #script.py and explain its logic\r\n```\r\n- Use `#` anywhere in your message to open the file picker popup\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e✨ Enhanced Features\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n- **Intelligent File Picker**: Auto-completion, icons, file sizes, and directory navigation\r\n- **Quoted Path Support**: Handles file paths with spaces using quotes\r\n- **Better Error Handling**: Improved error messages and usage examples\r\n- **File Preview**: Shows file metadata and preview before processing\r\n- **Security Validation**: Built-in file size and type validation (10MB limit)\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e📋 Supported File Types\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n- **Images**: JPG, PNG, GIF, WEBP, BMP (displayed visually with multimodal models)\r\n- **Code Files**: Python, JavaScript, Java, C++, TypeScript, Swift, etc. (with syntax highlighting)\r\n- **Text Documents**: TXT, MD, CSV (full content displayed)\r\n- **Data Files**: JSON, XML (displayed with formatting)\r\n- **Web Files**: HTML, CSS (formatted display)\r\n- **Archives**: ZIP, TAR, GZ, RAR (basic metadata support)\r\n\r\n\u003c/details\u003e\r\n\r\n\u003ca id=\"thinking-mode\"\u003e\u003c/a\u003e\r\n## 🧠 Thinking Mode\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e🎯 Basic Usage\u003c/strong\u003e\u003c/summary\u003e\r\n\r\nOrChat can display the AI's reasoning process with enhanced thinking mode:\r\n\r\n```\r\n/thinking-mode       # Toggle thinking mode on/off\r\n/thinking            # Show the most recent thinking process\r\n```\r\n\r\nThis feature allows you to see how the AI approached your question before giving its final answer. **Auto Thinking Mode** automatically enables this feature when you select models with reasoning support.\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e✨ Enhanced Features\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n- **Improved Detection**: Better extraction of thinking content from model responses\r\n- **Model Compatibility**: Automatic handling of models that don't support thinking mode\r\n- **Visual Indicators**: Clear status indicators showing if thinking mode is enabled\r\n- **Flexible Setup**: Option to enable/disable during model selection\r\n\r\n\u003c/details\u003e\r\n\r\n## 🎨 Themes\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e🎨 Available Themes\u003c/strong\u003e\u003c/summary\u003e\r\n\r\nChange the visual appearance with the `/theme` command:\r\n\r\n- **default**: Blue user, green assistant\r\n- **dark**: Cyan user, magenta assistant\r\n- **light**: Blue user, green assistant with lighter colors\r\n- **hacker**: Matrix-inspired green text on black\r\n\r\n\u003c/details\u003e\r\n\r\n## 📊 Token Management\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e📊 Smart Context Management\u003c/strong\u003e\u003c/summary\u003e\r\n\r\nOrChat intelligently manages conversation context to keep within token limits:\r\n\r\n- Automatically trims old messages when approaching limits\r\n- Displays comprehensive token usage statistics including total tokens and cost tracking\r\n- Shows real-time pricing information during active sessions\r\n- Displays total cost tracking across conversations\r\n- Allows manual clearing of context with `/clear`\r\n\r\n\u003c/details\u003e\r\n\r\n## 🔄 Updates\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e🔄 Version Management\u003c/strong\u003e\u003c/summary\u003e\r\n\r\nCheck for updates with the `/update` command to see if a newer version is available.\r\n\r\n\u003c/details\u003e\r\n\r\n\r\n\r\n\u003ca id=\"troubleshooting\"\u003e\u003c/a\u003e\r\n## 🔍 Troubleshooting\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e🔍 Common Issues \u0026 Solutions\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n- **API Key Issues**: Ensure your OpenRouter API key is correctly set in config.ini, .env file, or system environment variables. OrChat will prompt for re-entry if an incorrect key is detected\r\n- **Insufficient Account Credit**: If you receive a 402 error, check your OpenRouter account balance and add funds as needed\r\n- **File Path Problems**: When using `/attach` or `/upload`, use quotes for paths with spaces and ensure correct path format for your OS\r\n- **Model Compatibility**: Some features like thinking mode only work with specific models\r\n- **Command Usage**: Remember that `/upload` and `/attach` can be used anywhere in your message for flexibility\r\n\r\n\u003c/details\u003e\r\n\r\n## 📝 License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n\u003ca id=\"contributing\"\u003e\u003c/a\u003e\r\n## 🤝 Contributing\r\n\r\nContributions are welcome! Feel free to open issues or submit pull requests.\r\n\r\n## 🙏 Acknowledgments\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cstrong\u003e🙏 Special Thanks\u003c/strong\u003e\u003c/summary\u003e\r\n\r\n- [OpenRouter](https://openrouter.ai/) for providing unified API access to AI models\r\n- [Rich](https://github.com/Textualize/rich) for the beautiful terminal interface\r\n- All contributors and users who provide feedback and help improve OrChat\r\n\r\n\u003c/details\u003e\r\n\r\n","funding_links":[],"categories":["\u003ca name=\"ai\"\u003e\u003c/a\u003eAI / ChatGPT"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foop7%2FOrChat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foop7%2FOrChat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foop7%2FOrChat/lists"}