No description
Find a file
2025-05-06 22:10:34 +02:00
src/yolo_agent Load .yolohints content into system prompt on start 2025-05-04 15:20:20 +02:00
.gitignore Introduce code linting 2025-04-29 01:03:27 +02:00
.python-version initial version 2025-04-27 00:34:11 +02:00
.yolohints Add yolo hints 2025-05-06 22:10:34 +02:00
pyproject.toml Custom system prompt 2025-04-27 22:38:46 +02:00
README.md Support for saving .yolohints 2025-05-04 14:49:20 +02:00
tox.ini Introduce code linting 2025-04-29 01:03:27 +02:00
uv.lock Custom system prompt 2025-04-27 22:38:46 +02:00

Yolo Agent

Project Overview

Yolo Agent is an interactive Python application providing a conversational interface that can be powered by various LLMs, including OpenAI's models. It is designed to assist developers by dynamically executing Python code, performing file operations (reading, writing, replacing), and executing shell commands within project directories with user supervision.

The project emphasizes a safe and user-friendly interactive shell interface enhanced with prompt_toolkit and Rich for improved input editing, multiline input, command history, syntax-highlighted outputs, and autocompletion features including file name suggestions and direct file content referencing.

Key Features

  • Interactive conversational shell interface for developer assistance.
  • Dynamic Python code execution with immediate, syntax-highlighted output.
  • File operations including reading, writing, and content replacement within the project environment.
  • Shell command execution in specified directories with explicit user approval and approval options (Yes, No, Always).
  • Enhanced input experience using prompt_toolkit for multiline editing, command history, and autocompletion.
  • Output formatting improvements using Rich library for clearer, colorful display.
  • File name autocomplete triggered by '@' in input prompt, with automatic file content attachment for context.
  • Safety mechanisms requiring pre-approval before tool execution with flexible approval scopes.
  • Modular architecture supporting easy extension of tools and functionalities.

MCP Agents

Yolo Agent can interface with various MCP agents, including:

Getting Started

Prerequisites

  • Python 3.x installed on your system.
  • Access to OpenAI API key set as an environment variable (e.g., OPENROUTE_KEY).

Installation Steps

  1. Clone the repository:

    git clone https://github.com/yourusername/yolo-agent.git
    cd yolo-agent
    
  2. (Optional but recommended) Create and activate a virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .\.venv\\Scripts\\activate
    
  3. Install the required dependencies, including prompt_toolkit and rich:

    pip install -r requirements.txt
    
  4. Ensure your OpenAI API key is set in your environment.

Usage

Run the application to enter the enhanced interactive shell mode:

python src/main.py
  • Enter your queries or commands at the shell prompt supporting multiline input and command history.
  • Use '@' followed by file names to autocomplete and attach file contents inline for richer context.
  • The agent processes your inputs dynamically and displays formatted outputs.
  • Upon tool command requests, you will be prompted for execution approval with options: Yes, No, or Always.
  • Exit the shell gracefully by pressing Ctrl+C or Ctrl+D.

Development & Contribution

Contributions are welcome! Feel free to fork the repository and submit pull requests for new features, improvements, or bug fixes. For issues or feature requests, please open an issue on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.