An open API service indexing awesome lists of open source software.

https://github.com/horacehylee/pico-agent

โšกA pico-sized coding agent used for experiment and testing agent harness with different LLM models
https://github.com/horacehylee/pico-agent

Last synced: 7 days ago
JSON representation

โšกA pico-sized coding agent used for experiment and testing agent harness with different LLM models

Awesome Lists containing this project

README

          

# ๐Ÿค– Pico Agent

> โšก A pico-sized coding agent used for experiment and testing agent harness with different LLM models.

Pico Agent is a minimal, single-file coding agent that connects to LLM providers via the OpenAI-compatible chat completions API. It ships with file reading, editing, searching, and shell execution tools โ€” giving the model everything it needs to assist with real coding tasks, all in under 150 lines of Python.

## โœจ Features

- ๐Ÿ“„ **File operations** โ€” read, create, and edit files
- ๐Ÿ“ **Directory listing** โ€” browse project structure
- ๐Ÿ” **Regex search** โ€” find patterns across files recursively
- ๐Ÿš **Shell execution** โ€” run arbitrary commands (30s timeout)
- ๐Ÿ”„ **Agentic loop** โ€” multi-turn tool calling until the task is done
- ๐Ÿ”Œ **Multiple providers** โ€” pluggable provider config for experimenting with different LLMs

## ๐Ÿš€ Quick Start

```bash
# Clone the repo
git clone https://github.com/horacehylee/pico-agent.git
cd pico-agent

# Install uv (if not already installed)
pip install uv

# Create virtual environment and install dependencies
uv sync

# Configure your API key
cp .env.example .env
# Edit .env and add your API key

# Run
uv run python agent.py
```

## ๐Ÿงช Running Tests

```bash
# Install dev dependencies and run tests
uv run pytest test_agent.py -v
```

## ๐ŸŒ System-wide Installation

To use `pico` from any directory:

```bash
# Add pico to your PATH (pick one option)

# Option 1: Link to ~/.local/bin (recommended)
mkdir -p ~/.local/bin
ln -s "$(pwd)/pico" ~/.local/bin/pico

# Option 2: Link to /usr/local/bin (requires sudo)
sudo ln -s "$(pwd)/pico" /usr/local/bin/pico

# Make sure ~/.local/bin is in your PATH (add to ~/.bashrc or ~/.zshrc)
export PATH="$HOME/.local/bin:$PATH"

# Now you can run from anywhere!
pico
```

The `pico` command will:
- ๐Ÿ“ Stay in your current working directory
- ๐Ÿงช Use the installed virtual environment
- โ–ถ๏ธ Run agent.py from the repo

## โš™๏ธ Configuration

Environment variables are loaded from a `.env` file:

| Variable | Description | Default |
| -------------- | -------------------------- | -------- |
| `BASE_URL` | Base URL for the API | `https://openrouter.ai/api/v1` |
| `MODEL` | Model to use | `minimax/minimax-m2.5:free`|
| `API_KEY` | API key for the provider | โ€” |

## ๐Ÿ“‚ Project Structure

```
pico-agent/
โ”œโ”€โ”€ agent.py # The entire agent (entry point)
โ”œโ”€โ”€ test_agent.py # Unit tests
โ”œโ”€โ”€ .env.example # Template for environment variables
โ””โ”€โ”€ README.md
```

## ๐Ÿ“ License

MIT ยฉ [Horace Lee](https://github.com/horacehylee)