Jarian Cottingham 392bcfa2ef feat: Implement AI agent with multi-turn conversation and tool calling
Major enhancements to Clover CLI:

 New Features:
- AI agent with multi-turn conversation capabilities
- Tool calling system with 11+ tools for file operations, Git, linting, etc.
- Step-by-step AI assistance with play-by-play commentary
- Enhanced interactive mode with better UX

🔧 Core Components Added:
- ai_agent.py: Main AI agent with conversation management
- models/: API client and model management system
- Comprehensive tool system for development tasks

🛠️ Tools Available:
- File operations (create, read, update, delete)
- Command execution with safety checks
- Git operations (status, diff, commit, push)
- Code linting and formatting
- Project structure analysis
- Security scanning and dependency management

💡 User Experience:
- Real-time tool execution summaries
- File creation with full path visibility
- Error handling and retry mechanisms
- Clean conversation flow until task completion

🧹 Repository Cleanup:
- Added comprehensive .gitignore
- Removed __pycache__ directories and build artifacts
- Organized project structure

The AI can now actually create files, run commands, and work through complex
development tasks step-by-step with full transparency.
2026-01-15 01:23:40 -06:00
2026-01-13 00:16:00 -06:00
2026-01-13 00:07:41 -06:00
2026-01-13 02:00:28 -06:00
2026-01-13 02:00:28 -06:00

Clover CLI

Clover is a terminal-based AI assistant that works with various AI models to help build and manage projects. It provides tools for file operations, project structure management, command execution, and repository integration while supporting multiple LLM providers.

Features

  • File Operations: Read, create, update, and delete files
  • Project Management: Generate and maintain project structures
  • Command Execution: Safe execution of system commands with permission prompts
  • Git Integration: Repository status, diff, commit, and push operations
  • Code Quality Tools: Linting (flake8, pylint) and formatting (black, isort)
  • Multiple Model Support: Works with various AI models through an OpenAI-compatible API
  • Configuration Management: Set timeouts and thread limits for operations

Installation

  1. Create a virtual environment:
python -m venv clover_env
  1. Activate the virtual environment:
source clover_env/bin/activate  # On macOS/Linux
# or  
clover_env\Scripts\activate     # On Windows
  1. Install dependencies:
pip install openai requests python-dotenv tqdm GitPython pylint black isort bandit docker pydantic

Running Clover CLI

After installation and activation of virtual environment, run:

source clover_env/bin/activate  # Activate the environment
cd /path/to/clover/project      # Navigate to project directory  
PYTHONPATH=. python main.py     # Run the CLI with proper module path

Interactive Mode

Simply run python main.py without arguments to enter interactive mode:

source clover_env/bin/activate
cd /path/to/clover/project  
PYTHONPATH=. python main.py  # Enter interactive mode

In interactive mode, you can run commands directly without the 'clover' prefix:

  • /init - Initialize project summary file
  • /list - List available models
  • /timeout 300 - Set timeout to 300 seconds
  • /threads 5 - Set thread limit to 5
  • /git_status - Check Git repository status
  • /lint_file main.py - Lint a specific file

Simple Examples

To get help:

PYTHONPATH=. python main.py --help

To initialize a project:

PYTHONPATH=. python main.py /init

To enter interactive mode:

PYTHONPATH=. python main.py

Project Structure

clover/
├── main.py                 # Main entry point
├── cli/                    # CLI module
│   ├── __init__.py
│   ├── commands.py         # Command implementations
│   └── parser.py           # CLI argument parsing
├── tools/                  # Core tool implementations
│   ├── __init__.py
│   ├── file_tools.py       # File operations (read, create, update, delete)
│   ├── project_tools.py    # Project operations (summarize, structure)
│   ├── commandline_tool.py # Command line execution tool
│   ├── git_tools.py        # Git repository operations
│   └── lint_format_tools.py # Linting and formatting tools
├── models/                 # Model interaction modules  
│   ├── __init__.py
│   ├── model_manager.py    # Manage available models
│   └── api_client.py       # API client for different LLM providers
├── config/                 # Configuration management
│   ├── __init__.py
│   └── settings.py         # Settings and configuration handling
└── requirements.txt        # Dependencies list

Development

Running Tests

After activating the virtual environment:

source clover_env/bin/activate  # Activate venv  
cd /path/to/clover/project
PYTHONPATH=. python -m pytest tests/

Adding New Tools

To add new tools, create a new module in the tools/ directory and import it in cli/commands.py. Follow the existing pattern for consistency.

Configuration

Environment variables supported:

  • CLOVER_TIMEOUT - Timeout for operations (default: 300)
  • CLOVER_THREADS - Maximum concurrent threads (default: 5)
  • CLOVER_MODEL - Default AI model to use (default: gpt-4)

Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add some AmazingFeature')
  4. Push branch (git push origin feature/AmazingFeature)
  5. Open pull request

License

MIT License

Description
Terminal-based AI assistant for building and managing projects — file operations, project structure, command execution, and repo integration across multiple LLM providers.
Readme 169 KiB
Languages
Python 96.5%
HTML 1.5%
Roff 1.5%
Dockerfile 0.3%
Shell 0.2%