Skip to content

A professional, unified Python interface for interacting with multiple OpenAI models including GPT-4.1, GPT-4.1-mini, and GPT-4.1-nano

Notifications You must be signed in to change notification settings

simonpierreboucher02/gpt41-cli-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 OpenAI GPT-4.1 Unified Agent System

👨‍💻 Author: Simon-Pierre Boucher

Python
OpenAI
License
Version

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⚙️ Installation🚀 Quick Start💬 Chat Commands📊 Usage Examples🏗️ Architecture🔧 Advanced Usage🔒 Security🐛 Troubleshooting📄 License🤝 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:

git clone https://github.com/simonpierreboucher02/gpt41-cli-agent.git
cd gpt41-cli-agent

Create and activate a virtual environment (recommended):

python -m venv venv
source venv/bin/activate

Install dependencies:

pip install -r requirements.txt

Set your OpenAI API key:

export OPENAI_API_KEY=your_api_key_here

🚀 Quick Start

Create your first agent

python main.py --create

Start chatting

python main.py --agent-id my-agent

Use a specific model

python main.py --agent-id my-agent --model gpt-4.1-mini

List all agents

python main.py --list

Show available models

python main.py --models

Export a conversation

python main.py --agent-id my-agent --export html

💬 Chat Commands

Command Description
help Show all commands
history [n] Show last n messages
search <term> Search conversation history
stats Show statistics
config Show current configuration
export <format> Export chat (json/txt/md/html)
clear Clear history
files List files
model Show current model
switch <model> Switch to another model
quit Exit chat

📊 Usage Examples

  • 🧑‍💻 Basic:

    python main.py --agent-id coding --model gpt-4.1
  • 📁 File inclusion:

    You: Please review {app.py}
    Assistant: Reviewing app.py...
    
  • 📤 Export:

    python main.py --agent-id my-agent --export html
    python main.py --agent-id my-agent --export json
  • ⚙️ Config:

    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

About

A professional, unified Python interface for interacting with multiple OpenAI models including GPT-4.1, GPT-4.1-mini, and GPT-4.1-nano

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published