https://github.com/simonpierreboucher02/gpt41-cli-agent
A professional, unified Python interface for interacting with multiple OpenAI models including GPT-4.1, GPT-4.1-mini, and GPT-4.1-nano
https://github.com/simonpierreboucher02/gpt41-cli-agent
agent-ai cli gpt-41 gpt-41-mini gpt-41-nano openai
Last synced: about 1 month ago
JSON representation
A professional, unified Python interface for interacting with multiple OpenAI models including GPT-4.1, GPT-4.1-mini, and GPT-4.1-nano
- Host: GitHub
- URL: https://github.com/simonpierreboucher02/gpt41-cli-agent
- Owner: simonpierreboucher02
- Created: 2025-08-29T06:23:23.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-08-29T12:28:04.000Z (about 1 month ago)
- Last Synced: 2025-08-29T15:41:52.253Z (about 1 month ago)
- Topics: agent-ai, cli, gpt-41, gpt-41-mini, gpt-41-nano, openai
- Language: Python
- Homepage:
- Size: 83 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π€ OpenAI GPT-4.1 Unified Agent System
**π¨βπ» Author: Simon-Pierre Boucher**



**A professional, unified Python CLI agent for OpenAI GPT-4.1 models**
*Supports GPT-4.1, GPT-4.1 Mini, and GPT-4.1 Nano with advanced conversation management and exports*[β¨ Features](#-features) β’ [βοΈ Installation](#-installation) β’ [π Quick Start](#-quick-start) β’ [π¬ Chat Commands](#-chat-commands) β’ [π Usage Examples](#-usage-examples) β’ [ποΈ Architecture](#-architecture) β’ [π§ Advanced Usage](#-advanced-usage) β’ [π Security](#-security) β’ [π Troubleshooting](#-troubleshooting) β’ [π License](#-license) β’ [π€ Contributing](#-contributing)
---
## β¨ Features
- πΉ **All GPT-4.1 Models**: GPT-4.1, GPT-4.1 Mini, GPT-4.1 Nano
- π¨ **Beautiful CLI**: Colorful interface, intuitive commands
- π **File Inclusion**: `{filename}` syntax
- π€ **Multi-format Export**: JSON, TXT, Markdown, HTML
- π¬ **Persistent History**: Storage with search & backup
- βοΈ **Interactive Configuration**
- π‘οΈ **Error Handling & Logging**---
## βοΈ Installation
Clone the repository:
```bash
git clone https://github.com/simonpierreboucher02/gpt41-cli-agent.git
cd gpt41-cli-agent
```Create and activate a virtual environment (recommended):
```bash
python -m venv venv
source venv/bin/activate
```Install dependencies:
```bash
pip install -r requirements.txt
```Set your OpenAI API key:
```bash
export OPENAI_API_KEY=your_api_key_here
```---
## π Quick Start
### Create your first agent
```bash
python main.py --create
```### Start chatting
```bash
python main.py --agent-id my-agent
```### Use a specific model
```bash
python main.py --agent-id my-agent --model gpt-4.1-mini
```### List all agents
```bash
python main.py --list
```### Show available models
```bash
python main.py --models
```### Export a conversation
```bash
python main.py --agent-id my-agent --export html
```---
## π¬ Chat Commands
| Command | Description |
|---------|-------------|
| `help` | Show all commands |
| `history [n]` | Show last n messages |
| `search ` | Search conversation history |
| `stats` | Show statistics |
| `config` | Show current configuration |
| `export ` | Export chat (json/txt/md/html) |
| `clear` | Clear history |
| `files` | List files |
| `model` | Show current model |
| `switch ` | Switch to another model |
| `quit` | Exit chat |---
## π Usage Examples
- π§βπ» Basic:
```bash
python main.py --agent-id coding --model gpt-4.1
```- π File inclusion:
```
You: Please review {app.py}
Assistant: Reviewing app.py...
```- π€ Export:
```bash
python main.py --agent-id my-agent --export html
python main.py --agent-id my-agent --export json
```- βοΈ Config:
```bash
python main.py --agent-id my-agent --config
python main.py --agent-id my-agent --temperature 0.7
```---
## ποΈ Architecture
```
gpt41-cli-agent/
βββ main.py
βββ agent.py
βββ config.py
βββ utils.py
βββ export.py
βββ requirements.txt
βββ agents/
βββ {agent-id}/
βββ config.yaml
βββ history.json
βββ secrets.json
βββ backups/
βββ logs/
βββ exports/
```---
## π§ Advanced Usage
- π Environment vars: `OPENAI_API_KEY=...`
- βοΈ Options: temperature, max tokens, system prompt, streaming
- π Error handling: retries, logs---
## π Security
- π Secure key storage
- π« Sensitive data excluded from logs/exports
- β Auto `.gitignore` support---
## π Troubleshooting
- β Import errors β `pip install -r requirements.txt`
- π API key errors β `export OPENAI_API_KEY=...`
- π Permission errors β check directories---
## π License
MIT License β professional & educational use.
---
## π€ Contributing
Contributions welcome!
---
**2025-08-29**
*UniversitΓ© Laval*