orchat


Nameorchat JSON
Version 1.4.0 PyPI version JSON
download
home_pagehttps://github.com/oop7/OrChat
SummaryA powerful CLI for chatting with AI models through OpenRouter
upload_time2025-09-06 11:28:39
maintainerNone
docs_urlNone
authoroop7
requires_python>=3.9
licenseMIT
keywords ai chat cli openrouter chatbot
VCS
bugtrack_url
requirements requests tiktoken rich python-dotenv colorama packaging pyfzf cryptography prompt_toolkit
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">

# 🤖 OrChat

<img src="https://github.com/user-attachments/assets/df20dccc-8971-414e-9281-74260f05bf44" width="800" alt="OrChat Interface"/>

[![PyPI version](https://img.shields.io/pypi/v/orchat?color=86efac&style=for-the-badge&logo=pypi&logoColor=black)](https://badge.fury.io/py/orchat)
[![License: MIT](https://img.shields.io/badge/License-MIT-10b981?style=for-the-badge&logo=opensource&logoColor=white)](https://opensource.org/licenses/MIT)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-10b981?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/downloads/)
[![Downloads](https://img.shields.io/pepy/dt/orchat?color=1f2937&style=for-the-badge&logo=download&logoColor=white)](https://pepy.tech/project/orchat)
[![GitHub Stars](https://img.shields.io/github/stars/oop7/OrChat?color=86efac&style=for-the-badge&logo=github&logoColor=black)](https://github.com/oop7/OrChat/stargazers)

[🚀 Installation](#installation) • [✨ Features](#features) • [💬 Chat Commands](#chat-commands) • [🗂️ Conversation Management](#conversation-management) • [📁 File Attachment](#file-attachment) • [🧠 Thinking Mode](#thinking-mode) • [⚙️ Configuration](#configuration) • [🔍 Troubleshooting](#troubleshooting) • [🤝 Contributing](#contributing)

A powerful CLI for chatting with AI models through OpenRouter with streaming responses, token tracking, auto-update checking, multi-line input, conversation management with AI-generated summaries, and extensive customization options.

</div>


<a id="features"></a>
## ✨ Features

<details>
<summary><strong>🔗 Core Features</strong></summary>

- **Universal Model Access**: Connect to any AI model available on OpenRouter with dynamic model retrieval
- **Interactive Chat**: Enjoy a smooth conversation experience with real-time streaming responses
- **Rich Markdown Rendering**: View formatted text, code blocks, tables and more directly in your terminal
- **Performance Analytics**: Track token usage, response times, and total cost for efficiency monitoring (now with accurate API-based token counting)
- **Command Auto-completion**: Enhanced user experience with intelligent command suggestions and prompt history navigation
- **Prompt History Navigation**: Use ↑/↓ arrow keys to navigate through previous prompts and Ctrl+R for history search
- **Pricing Display**: Real-time pricing information displayed during active chat sessions
- **Auto-Update System**: Automatic update checking at startup with pip integration
- **Multi-line Input Support**: Compose multi-paragraph messages with `Esc+Enter` and visual feedback
- **Conversation Management**: Save, list, and resume conversations with AI-generated topic summaries
- **Smart Summarization**: Automatically generates meaningful names for saved sessions (e.g., "python_coding", "travel_advice")
- **Session Persistence**: Resume conversations exactly where you left off with full context

</details>

<details>
<summary><strong>📎 File & Media Support</strong></summary>

- **Smart File Picker**: Attach files anywhere in your message using `#` (e.g., `analyze #myfile.py`)
- **Interactive File Browser**: Browse files with icons, sizes, and directory navigation in a popup interface
- **Multimodal Support**: Share images and various file types with compatible AI models
- **Enhanced File Processing**: Improved file attachment with better error handling and path support

</details>

<details>
<summary><strong>🧠 Advanced Features</strong></summary>

- **Smart Thinking Mode**: See the AI's reasoning process with compatible models
- **Multiple Export Formats**: Save conversations as Markdown, HTML, JSON, TXT, or PDF
- **Smart Context Management**: Automatically manages conversation history to stay within token limits
- **Conversation Management**: Save, list, and resume conversations with AI-generated summaries
- **Customizable Themes**: Choose from different visual themes for your terminal

</details>

<details>
<summary><strong>⌨️ Interactive Input Features</strong></summary>

- **Multi-line Input**: Use `Esc+Enter` to toggle multi-line mode, with status indicator and seamless toggling
- **Command History Navigation**: Press ↑/↓ arrow keys to cycle through previous prompts and commands
- **History Search**: Use Ctrl+R to search through your prompt history with keywords
- **Automatic Command Completion**: Start typing "/" and command suggestions appear instantly - no Tab key needed!
- **Auto-Suggest from History**: Previous commands and prompts appear as grey suggestions as you type
- **Intelligent File Picker**: Use `#` anywhere in your message for file selection with auto-completion and browser popup
- **Double Ctrl+C Exit**: Press Ctrl+C twice within 2 seconds to gracefully exit the chat session

**💡 How Auto-Completion Works:**
- Type `/` → All available commands appear automatically
- Type `/c` → Filters to commands starting with 'c' (clear, cls, clear-screen, etc.)
- Type `/temp` → Shows `/temperature` command
- Type `/think` → Shows `/thinking` and `/thinking-mode` commands
- No Tab key required - completions appear as you type!

**💡 How File Picker Works:**
- Type `#` anywhere in your message to open the file picker
- Choose files interactively (with icons for file types)
- Insert filenames naturally into your prompt, e.g., `examine #test.py and check for errors`
- File picker works anywhere in your message, not just at the beginning

**💡 How to Exit:**
- Press **Ctrl+C** once → Shows "Press Ctrl+C again to exit" message
- Press **Ctrl+C** again within 2 seconds → Gracefully exits the chat
- This prevents accidental exits while allowing quick termination when needed

</details>

<a id="installation"></a>
## 🚀 Installation

<summary><strong>📦 Installation Methods</strong></summary>

### From PyPI (Recommended)

```bash
pip install orchat
```
```bash
# Run the application
orchat
```

### From Source

```bash
git clone https://github.com/oop7/OrChat.git
pip install -r requirements.txt
python main.py
```

</details>

</details>

<details>
<summary><strong>📋 Prerequisites</strong></summary>

- Python 3.7 or higher
- An OpenRouter API key (get one at [OpenRouter.ai](https://openrouter.ai))
- Required packages: in `requirements.txt`

</details>

<details>
<summary><strong>🏁 Getting Started</strong></summary>

1. Install OrChat using one of the methods above
2. Run the setup wizard
   - if you follow from source PyPI:
     ```bash
     orchat --setup
     ```
   - if you follow from source method:
     ```bash
     python main.py --setup
     ```
3. Enter your OpenRouter API key when prompted
4. Select your preferred AI model and configure settings
5. Start chatting!

</details>

<details>
<summary><strong>🪛 Add-Ons</strong></summary>

### FZF fuzzy search (Enhanced Model Selection)

1. Install fzf and pyfzf

   - Install pyfzf
     ```bash
     pip install pyfzf
     ```
   - Fzf can be downloaded from https://github.com/junegunn/fzf?tab=readme-ov-file#installation

2. Ensure fzf is in your path
3. From now on, the model selection will use fzf for powerful fuzzy search and filtering capabilities!

**Note**: If fzf is not installed, OrChat will automatically fall back to standard model selection.

</details>

<a id="configuration"></a>
## ⚙️ Configuration

<details>
<summary><strong>🔧 Configuration Methods</strong></summary>

OrChat can be configured in multiple ways:

1. **Setup Wizard**: Run `python main.py --setup` for interactive configuration
2. **Config File**: Edit the `config.ini` file in the application directory
3. **Environment Variables**: Create a `.env` file with your configuration
4. **System Environment Variables**: Set environment variables directly in your system (recommended for security)

**Enhanced Environment Support**: OrChat now supports system/user environment variables, removing the strict requirement for `.env` files.

</details>

<details>
<summary><strong>📄 Configuration Examples</strong></summary>

Example `.env` file:

```
OPENROUTER_API_KEY=your_api_key_here
```

Example `config.ini` structure:

```ini
[API]
OPENROUTER_API_KEY = your_api_key_here

[SETTINGS]
MODEL = anthropic/claude-3-opus
TEMPERATURE = 0.7
SYSTEM_INSTRUCTIONS = You are a helpful AI assistant.
THEME = default
MAX_TOKENS = 8000
AUTOSAVE_INTERVAL = 300
STREAMING = True
THINKING_MODE = False
```

</details>

<details>
<summary><strong>🖥️ Command-Line Options</strong></summary>

- `--setup`: Run the setup wizard
- `--model MODEL`: Specify the model to use (e.g., `--model "anthropic/claude-3-opus"`)
- `--task {creative,coding,analysis,chat}`: Optimize for a specific task type
- `--image PATH`: Analyze an image file

</details>

<a id="chat-commands"></a>
## 💬 Chat Commands

| Command                   | Description                                           |
| ------------------------- | ----------------------------------------------------- |
| `/help`                   | Show available commands                               |
| `/new`                    | Start a new conversation                              |
| `/clear`                  | Clear conversation history                            |
| `/cls` or `/clear-screen` | Clear the terminal screen                             |
| `/save [format]`          | Save conversation (formats: md, html, json, txt, pdf) |
| `/chat list`              | List saved conversations with human-readable summaries |
| `/chat save`              | Save current conversation with auto-generated summary  |
| `/chat resume <session>`  | Resume a saved conversation by name or ID              |
| `/model`                  | Change the AI model                                   |
| `/temperature <0.0-2.0>`  | Adjust temperature setting                            |
| `/system`                 | View or change system instructions                    |
| `/tokens`                 | Show token usage statistics (now API-accurate)        |
| `/speed`                  | Show response time statistics                         |
| `/theme <theme>`          | Change the color theme (default, dark, light, hacker) |
| `/thinking`               | Show last AI thinking process                         |
| `/thinking-mode`          | Toggle thinking mode on/off                           |
| `/about`                  | Show information about OrChat                         |
| `/update`                 | Check for updates                                     |
| `/settings`               | View current settings                                 |
| **Ctrl+C** (twice)        | **Exit the chat (press twice within 2 seconds)**     |

<a id="conversation-management"></a>
## 💾 Conversation Management

<details>
<summary><strong>📋 Session Management</strong></summary>

OrChat provides powerful conversation management with human-readable session summaries:

**Commands:**
- `/chat list` - View all saved conversations with meaningful names
- `/chat save` - Save current conversation with auto-generated topic summary
- `/chat resume <session>` - Resume any saved conversation by name or ID

**Features:**
- **Smart Summarization**: Uses AI to generate 2-4 word topic summaries (e.g., "python_coding", "travel_advice", "cooking_tips")
- **Fallback Detection**: Automatically detects topics like coding, travel, cooking, career advice
- **Dual Storage**: Saves both human-readable summaries and original timestamp IDs
- **Easy Resume**: Resume conversations using either the summary name or original ID

**Example Session List:**
```
Saved sessions:
general_chat (20250906_141133)
python_coding (20250906_140945)
travel_advice (20250906_140812)
cooking_tips (20250906_140734)
```

</details>

<a id="file-attachment"></a>
## 📁 File Attachment

<details>
<summary><strong>📎 Basic Usage</strong></summary>

Attach files naturally in your messages using the smart file picker:

```
analyze #path/to/your/file.ext for issues
examine #script.py and explain its logic
```
- Use `#` anywhere in your message to open the file picker popup

</details>

<details>
<summary><strong>✨ Enhanced Features</strong></summary>

- **Intelligent File Picker**: Auto-completion, icons, file sizes, and directory navigation
- **Quoted Path Support**: Handles file paths with spaces using quotes
- **Better Error Handling**: Improved error messages and usage examples
- **File Preview**: Shows file metadata and preview before processing
- **Security Validation**: Built-in file size and type validation (10MB limit)

</details>

<details>
<summary><strong>📋 Supported File Types</strong></summary>

- **Images**: JPG, PNG, GIF, WEBP, BMP (displayed visually with multimodal models)
- **Code Files**: Python, JavaScript, Java, C++, TypeScript, Swift, etc. (with syntax highlighting)
- **Text Documents**: TXT, MD, CSV (full content displayed)
- **Data Files**: JSON, XML (displayed with formatting)
- **Web Files**: HTML, CSS (formatted display)
- **Archives**: ZIP, TAR, GZ, RAR (basic metadata support)

</details>

<a id="thinking-mode"></a>
## 🧠 Thinking Mode

<details>
<summary><strong>🎯 Basic Usage</strong></summary>

OrChat can display the AI's reasoning process with enhanced thinking mode:

```
/thinking-mode       # Toggle thinking mode on/off
/thinking            # Show the most recent thinking process
```

This 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.

</details>

<details>
<summary><strong>✨ Enhanced Features</strong></summary>

- **Improved Detection**: Better extraction of thinking content from model responses
- **Model Compatibility**: Automatic handling of models that don't support thinking mode
- **Visual Indicators**: Clear status indicators showing if thinking mode is enabled
- **Flexible Setup**: Option to enable/disable during model selection

</details>

## 🎨 Themes

<details>
<summary><strong>🎨 Available Themes</strong></summary>

Change the visual appearance with the `/theme` command:

- **default**: Blue user, green assistant
- **dark**: Cyan user, magenta assistant
- **light**: Blue user, green assistant with lighter colors
- **hacker**: Matrix-inspired green text on black

</details>

## 📊 Token Management

<details>
<summary><strong>📊 Smart Context Management</strong></summary>

OrChat intelligently manages conversation context to keep within token limits:

- Automatically trims old messages when approaching limits
- Displays comprehensive token usage statistics including total tokens and cost tracking
- Shows real-time pricing information during active sessions
- Displays total cost tracking across conversations
- Allows manual clearing of context with `/clear`

</details>

## 🔄 Updates

<details>
<summary><strong>🔄 Version Management</strong></summary>

Check for updates with the `/update` command to see if a newer version is available.

</details>



<a id="troubleshooting"></a>
## 🔍 Troubleshooting

<details>
<summary><strong>🔍 Common Issues & Solutions</strong></summary>

- **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
- **Insufficient Account Credit**: If you receive a 402 error, check your OpenRouter account balance and add funds as needed
- **File Path Problems**: When using `/attach` or `/upload`, use quotes for paths with spaces and ensure correct path format for your OS
- **Model Compatibility**: Some features like thinking mode only work with specific models
- **Conversation Management**: Use `/chat list` to see saved conversations, `/chat save` to save current session, and `/chat resume <name>` to continue previous conversations
- **Command Usage**: Remember that `/upload` and `/attach` can be used anywhere in your message for flexibility

</details>

## 📝 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

<a id="contributing"></a>
## 🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

## 🙏 Acknowledgments

<details>
<summary><strong>🙏 Special Thanks</strong></summary>

- [OpenRouter](https://openrouter.ai/) for providing unified API access to AI models
- [Rich](https://github.com/Textualize/rich) for the beautiful terminal interface
- All contributors and users who provide feedback and help improve OrChat

</details>


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/oop7/OrChat",
    "name": "orchat",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "ai, chat, cli, openrouter, chatbot",
    "author": "oop7",
    "author_email": "oop7 <oop7_support@proton.me>",
    "download_url": "https://files.pythonhosted.org/packages/27/11/8dd1cf29ce8cefc680de840a1f8ed7935a9b4c1674f5ccfd603b9a6d9573/orchat-1.4.0.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n# \ud83e\udd16 OrChat\n\n<img src=\"https://github.com/user-attachments/assets/df20dccc-8971-414e-9281-74260f05bf44\" width=\"800\" alt=\"OrChat Interface\"/>\n\n[![PyPI version](https://img.shields.io/pypi/v/orchat?color=86efac&style=for-the-badge&logo=pypi&logoColor=black)](https://badge.fury.io/py/orchat)\n[![License: MIT](https://img.shields.io/badge/License-MIT-10b981?style=for-the-badge&logo=opensource&logoColor=white)](https://opensource.org/licenses/MIT)\n[![Python 3.9+](https://img.shields.io/badge/python-3.9+-10b981?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/downloads/)\n[![Downloads](https://img.shields.io/pepy/dt/orchat?color=1f2937&style=for-the-badge&logo=download&logoColor=white)](https://pepy.tech/project/orchat)\n[![GitHub Stars](https://img.shields.io/github/stars/oop7/OrChat?color=86efac&style=for-the-badge&logo=github&logoColor=black)](https://github.com/oop7/OrChat/stargazers)\n\n[\ud83d\ude80 Installation](#installation) \u2022 [\u2728 Features](#features) \u2022 [\ud83d\udcac Chat Commands](#chat-commands) \u2022 [\ud83d\uddc2\ufe0f Conversation Management](#conversation-management) \u2022 [\ud83d\udcc1 File Attachment](#file-attachment) \u2022 [\ud83e\udde0 Thinking Mode](#thinking-mode) \u2022 [\u2699\ufe0f Configuration](#configuration) \u2022 [\ud83d\udd0d Troubleshooting](#troubleshooting) \u2022 [\ud83e\udd1d Contributing](#contributing)\n\nA powerful CLI for chatting with AI models through OpenRouter with streaming responses, token tracking, auto-update checking, multi-line input, conversation management with AI-generated summaries, and extensive customization options.\n\n</div>\n\n\n<a id=\"features\"></a>\n## \u2728 Features\n\n<details>\n<summary><strong>\ud83d\udd17 Core Features</strong></summary>\n\n- **Universal Model Access**: Connect to any AI model available on OpenRouter with dynamic model retrieval\n- **Interactive Chat**: Enjoy a smooth conversation experience with real-time streaming responses\n- **Rich Markdown Rendering**: View formatted text, code blocks, tables and more directly in your terminal\n- **Performance Analytics**: Track token usage, response times, and total cost for efficiency monitoring (now with accurate API-based token counting)\n- **Command Auto-completion**: Enhanced user experience with intelligent command suggestions and prompt history navigation\n- **Prompt History Navigation**: Use \u2191/\u2193 arrow keys to navigate through previous prompts and Ctrl+R for history search\n- **Pricing Display**: Real-time pricing information displayed during active chat sessions\n- **Auto-Update System**: Automatic update checking at startup with pip integration\n- **Multi-line Input Support**: Compose multi-paragraph messages with `Esc+Enter` and visual feedback\n- **Conversation Management**: Save, list, and resume conversations with AI-generated topic summaries\n- **Smart Summarization**: Automatically generates meaningful names for saved sessions (e.g., \"python_coding\", \"travel_advice\")\n- **Session Persistence**: Resume conversations exactly where you left off with full context\n\n</details>\n\n<details>\n<summary><strong>\ud83d\udcce File & Media Support</strong></summary>\n\n- **Smart File Picker**: Attach files anywhere in your message using `#` (e.g., `analyze #myfile.py`)\n- **Interactive File Browser**: Browse files with icons, sizes, and directory navigation in a popup interface\n- **Multimodal Support**: Share images and various file types with compatible AI models\n- **Enhanced File Processing**: Improved file attachment with better error handling and path support\n\n</details>\n\n<details>\n<summary><strong>\ud83e\udde0 Advanced Features</strong></summary>\n\n- **Smart Thinking Mode**: See the AI's reasoning process with compatible models\n- **Multiple Export Formats**: Save conversations as Markdown, HTML, JSON, TXT, or PDF\n- **Smart Context Management**: Automatically manages conversation history to stay within token limits\n- **Conversation Management**: Save, list, and resume conversations with AI-generated summaries\n- **Customizable Themes**: Choose from different visual themes for your terminal\n\n</details>\n\n<details>\n<summary><strong>\u2328\ufe0f Interactive Input Features</strong></summary>\n\n- **Multi-line Input**: Use `Esc+Enter` to toggle multi-line mode, with status indicator and seamless toggling\n- **Command History Navigation**: Press \u2191/\u2193 arrow keys to cycle through previous prompts and commands\n- **History Search**: Use Ctrl+R to search through your prompt history with keywords\n- **Automatic Command Completion**: Start typing \"/\" and command suggestions appear instantly - no Tab key needed!\n- **Auto-Suggest from History**: Previous commands and prompts appear as grey suggestions as you type\n- **Intelligent File Picker**: Use `#` anywhere in your message for file selection with auto-completion and browser popup\n- **Double Ctrl+C Exit**: Press Ctrl+C twice within 2 seconds to gracefully exit the chat session\n\n**\ud83d\udca1 How Auto-Completion Works:**\n- Type `/` \u2192 All available commands appear automatically\n- Type `/c` \u2192 Filters to commands starting with 'c' (clear, cls, clear-screen, etc.)\n- Type `/temp` \u2192 Shows `/temperature` command\n- Type `/think` \u2192 Shows `/thinking` and `/thinking-mode` commands\n- No Tab key required - completions appear as you type!\n\n**\ud83d\udca1 How File Picker Works:**\n- Type `#` anywhere in your message to open the file picker\n- Choose files interactively (with icons for file types)\n- Insert filenames naturally into your prompt, e.g., `examine #test.py and check for errors`\n- File picker works anywhere in your message, not just at the beginning\n\n**\ud83d\udca1 How to Exit:**\n- Press **Ctrl+C** once \u2192 Shows \"Press Ctrl+C again to exit\" message\n- Press **Ctrl+C** again within 2 seconds \u2192 Gracefully exits the chat\n- This prevents accidental exits while allowing quick termination when needed\n\n</details>\n\n<a id=\"installation\"></a>\n## \ud83d\ude80 Installation\n\n<summary><strong>\ud83d\udce6 Installation Methods</strong></summary>\n\n### From PyPI (Recommended)\n\n```bash\npip install orchat\n```\n```bash\n# Run the application\norchat\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/oop7/OrChat.git\npip install -r requirements.txt\npython main.py\n```\n\n</details>\n\n</details>\n\n<details>\n<summary><strong>\ud83d\udccb Prerequisites</strong></summary>\n\n- Python 3.7 or higher\n- An OpenRouter API key (get one at [OpenRouter.ai](https://openrouter.ai))\n- Required packages: in `requirements.txt`\n\n</details>\n\n<details>\n<summary><strong>\ud83c\udfc1 Getting Started</strong></summary>\n\n1. Install OrChat using one of the methods above\n2. Run the setup wizard\n   - if you follow from source PyPI:\n     ```bash\n     orchat --setup\n     ```\n   - if you follow from source method:\n     ```bash\n     python main.py --setup\n     ```\n3. Enter your OpenRouter API key when prompted\n4. Select your preferred AI model and configure settings\n5. Start chatting!\n\n</details>\n\n<details>\n<summary><strong>\ud83e\ude9b Add-Ons</strong></summary>\n\n### FZF fuzzy search (Enhanced Model Selection)\n\n1. Install fzf and pyfzf\n\n   - Install pyfzf\n     ```bash\n     pip install pyfzf\n     ```\n   - Fzf can be downloaded from https://github.com/junegunn/fzf?tab=readme-ov-file#installation\n\n2. Ensure fzf is in your path\n3. From now on, the model selection will use fzf for powerful fuzzy search and filtering capabilities!\n\n**Note**: If fzf is not installed, OrChat will automatically fall back to standard model selection.\n\n</details>\n\n<a id=\"configuration\"></a>\n## \u2699\ufe0f Configuration\n\n<details>\n<summary><strong>\ud83d\udd27 Configuration Methods</strong></summary>\n\nOrChat can be configured in multiple ways:\n\n1. **Setup Wizard**: Run `python main.py --setup` for interactive configuration\n2. **Config File**: Edit the `config.ini` file in the application directory\n3. **Environment Variables**: Create a `.env` file with your configuration\n4. **System Environment Variables**: Set environment variables directly in your system (recommended for security)\n\n**Enhanced Environment Support**: OrChat now supports system/user environment variables, removing the strict requirement for `.env` files.\n\n</details>\n\n<details>\n<summary><strong>\ud83d\udcc4 Configuration Examples</strong></summary>\n\nExample `.env` file:\n\n```\nOPENROUTER_API_KEY=your_api_key_here\n```\n\nExample `config.ini` structure:\n\n```ini\n[API]\nOPENROUTER_API_KEY = your_api_key_here\n\n[SETTINGS]\nMODEL = anthropic/claude-3-opus\nTEMPERATURE = 0.7\nSYSTEM_INSTRUCTIONS = You are a helpful AI assistant.\nTHEME = default\nMAX_TOKENS = 8000\nAUTOSAVE_INTERVAL = 300\nSTREAMING = True\nTHINKING_MODE = False\n```\n\n</details>\n\n<details>\n<summary><strong>\ud83d\udda5\ufe0f Command-Line Options</strong></summary>\n\n- `--setup`: Run the setup wizard\n- `--model MODEL`: Specify the model to use (e.g., `--model \"anthropic/claude-3-opus\"`)\n- `--task {creative,coding,analysis,chat}`: Optimize for a specific task type\n- `--image PATH`: Analyze an image file\n\n</details>\n\n<a id=\"chat-commands\"></a>\n## \ud83d\udcac Chat Commands\n\n| Command                   | Description                                           |\n| ------------------------- | ----------------------------------------------------- |\n| `/help`                   | Show available commands                               |\n| `/new`                    | Start a new conversation                              |\n| `/clear`                  | Clear conversation history                            |\n| `/cls` or `/clear-screen` | Clear the terminal screen                             |\n| `/save [format]`          | Save conversation (formats: md, html, json, txt, pdf) |\n| `/chat list`              | List saved conversations with human-readable summaries |\n| `/chat save`              | Save current conversation with auto-generated summary  |\n| `/chat resume <session>`  | Resume a saved conversation by name or ID              |\n| `/model`                  | Change the AI model                                   |\n| `/temperature <0.0-2.0>`  | Adjust temperature setting                            |\n| `/system`                 | View or change system instructions                    |\n| `/tokens`                 | Show token usage statistics (now API-accurate)        |\n| `/speed`                  | Show response time statistics                         |\n| `/theme <theme>`          | Change the color theme (default, dark, light, hacker) |\n| `/thinking`               | Show last AI thinking process                         |\n| `/thinking-mode`          | Toggle thinking mode on/off                           |\n| `/about`                  | Show information about OrChat                         |\n| `/update`                 | Check for updates                                     |\n| `/settings`               | View current settings                                 |\n| **Ctrl+C** (twice)        | **Exit the chat (press twice within 2 seconds)**     |\n\n<a id=\"conversation-management\"></a>\n## \ud83d\udcbe Conversation Management\n\n<details>\n<summary><strong>\ud83d\udccb Session Management</strong></summary>\n\nOrChat provides powerful conversation management with human-readable session summaries:\n\n**Commands:**\n- `/chat list` - View all saved conversations with meaningful names\n- `/chat save` - Save current conversation with auto-generated topic summary\n- `/chat resume <session>` - Resume any saved conversation by name or ID\n\n**Features:**\n- **Smart Summarization**: Uses AI to generate 2-4 word topic summaries (e.g., \"python_coding\", \"travel_advice\", \"cooking_tips\")\n- **Fallback Detection**: Automatically detects topics like coding, travel, cooking, career advice\n- **Dual Storage**: Saves both human-readable summaries and original timestamp IDs\n- **Easy Resume**: Resume conversations using either the summary name or original ID\n\n**Example Session List:**\n```\nSaved sessions:\ngeneral_chat (20250906_141133)\npython_coding (20250906_140945)\ntravel_advice (20250906_140812)\ncooking_tips (20250906_140734)\n```\n\n</details>\n\n<a id=\"file-attachment\"></a>\n## \ud83d\udcc1 File Attachment\n\n<details>\n<summary><strong>\ud83d\udcce Basic Usage</strong></summary>\n\nAttach files naturally in your messages using the smart file picker:\n\n```\nanalyze #path/to/your/file.ext for issues\nexamine #script.py and explain its logic\n```\n- Use `#` anywhere in your message to open the file picker popup\n\n</details>\n\n<details>\n<summary><strong>\u2728 Enhanced Features</strong></summary>\n\n- **Intelligent File Picker**: Auto-completion, icons, file sizes, and directory navigation\n- **Quoted Path Support**: Handles file paths with spaces using quotes\n- **Better Error Handling**: Improved error messages and usage examples\n- **File Preview**: Shows file metadata and preview before processing\n- **Security Validation**: Built-in file size and type validation (10MB limit)\n\n</details>\n\n<details>\n<summary><strong>\ud83d\udccb Supported File Types</strong></summary>\n\n- **Images**: JPG, PNG, GIF, WEBP, BMP (displayed visually with multimodal models)\n- **Code Files**: Python, JavaScript, Java, C++, TypeScript, Swift, etc. (with syntax highlighting)\n- **Text Documents**: TXT, MD, CSV (full content displayed)\n- **Data Files**: JSON, XML (displayed with formatting)\n- **Web Files**: HTML, CSS (formatted display)\n- **Archives**: ZIP, TAR, GZ, RAR (basic metadata support)\n\n</details>\n\n<a id=\"thinking-mode\"></a>\n## \ud83e\udde0 Thinking Mode\n\n<details>\n<summary><strong>\ud83c\udfaf Basic Usage</strong></summary>\n\nOrChat can display the AI's reasoning process with enhanced thinking mode:\n\n```\n/thinking-mode       # Toggle thinking mode on/off\n/thinking            # Show the most recent thinking process\n```\n\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.\n\n</details>\n\n<details>\n<summary><strong>\u2728 Enhanced Features</strong></summary>\n\n- **Improved Detection**: Better extraction of thinking content from model responses\n- **Model Compatibility**: Automatic handling of models that don't support thinking mode\n- **Visual Indicators**: Clear status indicators showing if thinking mode is enabled\n- **Flexible Setup**: Option to enable/disable during model selection\n\n</details>\n\n## \ud83c\udfa8 Themes\n\n<details>\n<summary><strong>\ud83c\udfa8 Available Themes</strong></summary>\n\nChange the visual appearance with the `/theme` command:\n\n- **default**: Blue user, green assistant\n- **dark**: Cyan user, magenta assistant\n- **light**: Blue user, green assistant with lighter colors\n- **hacker**: Matrix-inspired green text on black\n\n</details>\n\n## \ud83d\udcca Token Management\n\n<details>\n<summary><strong>\ud83d\udcca Smart Context Management</strong></summary>\n\nOrChat intelligently manages conversation context to keep within token limits:\n\n- Automatically trims old messages when approaching limits\n- Displays comprehensive token usage statistics including total tokens and cost tracking\n- Shows real-time pricing information during active sessions\n- Displays total cost tracking across conversations\n- Allows manual clearing of context with `/clear`\n\n</details>\n\n## \ud83d\udd04 Updates\n\n<details>\n<summary><strong>\ud83d\udd04 Version Management</strong></summary>\n\nCheck for updates with the `/update` command to see if a newer version is available.\n\n</details>\n\n\n\n<a id=\"troubleshooting\"></a>\n## \ud83d\udd0d Troubleshooting\n\n<details>\n<summary><strong>\ud83d\udd0d Common Issues & Solutions</strong></summary>\n\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\n- **Insufficient Account Credit**: If you receive a 402 error, check your OpenRouter account balance and add funds as needed\n- **File Path Problems**: When using `/attach` or `/upload`, use quotes for paths with spaces and ensure correct path format for your OS\n- **Model Compatibility**: Some features like thinking mode only work with specific models\n- **Conversation Management**: Use `/chat list` to see saved conversations, `/chat save` to save current session, and `/chat resume <name>` to continue previous conversations\n- **Command Usage**: Remember that `/upload` and `/attach` can be used anywhere in your message for flexibility\n\n</details>\n\n## \ud83d\udcdd License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n<a id=\"contributing\"></a>\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Feel free to open issues or submit pull requests.\n\n## \ud83d\ude4f Acknowledgments\n\n<details>\n<summary><strong>\ud83d\ude4f Special Thanks</strong></summary>\n\n- [OpenRouter](https://openrouter.ai/) for providing unified API access to AI models\n- [Rich](https://github.com/Textualize/rich) for the beautiful terminal interface\n- All contributors and users who provide feedback and help improve OrChat\n\n</details>\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A powerful CLI for chatting with AI models through OpenRouter",
    "version": "1.4.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/oop7/OrChat/issues",
        "Homepage": "https://github.com/oop7/OrChat",
        "Reddit": "https://www.reddit.com/r/NO-N_A_M_E/",
        "Repository": "https://github.com/oop7/OrChat"
    },
    "split_keywords": [
        "ai",
        " chat",
        " cli",
        " openrouter",
        " chatbot"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3cc4e1c748307c7b48bc0b9bfb08e56341ec6eb5dfc7f8227af3c07e0546de8a",
                "md5": "e62ac04958fed7e910a18d5fa48f4370",
                "sha256": "5024907b4bfd4c75cf0dd63aab021363f331ddd2f078ec483b7fed532a077486"
            },
            "downloads": -1,
            "filename": "orchat-1.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e62ac04958fed7e910a18d5fa48f4370",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 39910,
            "upload_time": "2025-09-06T11:28:37",
            "upload_time_iso_8601": "2025-09-06T11:28:37.793813Z",
            "url": "https://files.pythonhosted.org/packages/3c/c4/e1c748307c7b48bc0b9bfb08e56341ec6eb5dfc7f8227af3c07e0546de8a/orchat-1.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "27118dd1cf29ce8cefc680de840a1f8ed7935a9b4c1674f5ccfd603b9a6d9573",
                "md5": "776b969bd6f38df3f69c5778c408d54a",
                "sha256": "eae614c1b69c455891fd77d4c14b8a11dfbd0d954c4d63bbae83e88b3681ab94"
            },
            "downloads": -1,
            "filename": "orchat-1.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "776b969bd6f38df3f69c5778c408d54a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 46376,
            "upload_time": "2025-09-06T11:28:39",
            "upload_time_iso_8601": "2025-09-06T11:28:39.042305Z",
            "url": "https://files.pythonhosted.org/packages/27/11/8dd1cf29ce8cefc680de840a1f8ed7935a9b4c1674f5ccfd603b9a6d9573/orchat-1.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-06 11:28:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "oop7",
    "github_project": "OrChat",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "tiktoken",
            "specs": []
        },
        {
            "name": "rich",
            "specs": []
        },
        {
            "name": "python-dotenv",
            "specs": []
        },
        {
            "name": "colorama",
            "specs": []
        },
        {
            "name": "packaging",
            "specs": []
        },
        {
            "name": "pyfzf",
            "specs": []
        },
        {
            "name": "cryptography",
            "specs": []
        },
        {
            "name": "prompt_toolkit",
            "specs": []
        }
    ],
    "lcname": "orchat"
}
        
Elapsed time: 0.87218s