| src/yolo_agent | ||
| .gitignore | ||
| .python-version | ||
| .yolohints | ||
| pyproject.toml | ||
| README.md | ||
| tox.ini | ||
| uv.lock | ||
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:
- Filesystem: Provides file system operations and commands. GitHub Repository
- Web Search: Facilitates web searching capabilities. GitHub Repository
- Fetch Websites Contents: Allows fetching contents from websites. GitHub Repository 1, GitHub Repository 2
- Shell: Enables executing shell commands directly within specified directories. GitHub Repository
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
-
Clone the repository:
git clone https://github.com/yourusername/yolo-agent.git cd yolo-agent -
(Optional but recommended) Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .\.venv\\Scripts\\activate -
Install the required dependencies, including prompt_toolkit and rich:
pip install -r requirements.txt -
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.