Skip to main content

Overview

Kapso provides a CLI for running experiments without writing Python code.

Basic Usage

kapso evolve --goal "Your problem description"

Options

Goal Specification

OptionShortDescription
--goal-gGoal/problem description (inline)
--goal-file-fFile containing goal description
# Inline goal
kapso evolve --goal "Build a classifier for Iris dataset"

# From file
kapso evolve --goal-file problem.txt

Basic Options

OptionShortDefaultDescription
--iterations-i10Maximum experiment iterations
--output-oautoOutput directory for solution
kapso evolve --goal "..." --iterations 10 --output ./my_solution

Configuration Options

OptionShortDescription
--mode-mConfiguration mode (GENERIC, MINIMAL)
--coding-agent-aCoding agent (aider, gemini, claude_code, openhands)
kapso evolve --goal "..." --mode GENERIC --coding-agent claude_code

Directory Options

OptionDefaultDescription
--eval-dirNoneDirectory with evaluation files (copied to kapso_evaluation/)
--data-dirNoneDirectory with data files (copied to kapso_datasets/)
--initial-repoNoneInitial repository (local path or GitHub URL)
kapso evolve --goal "..." \
    --eval-dir ./my_evaluation/ \
    --data-dir ./my_data/ \
    --initial-repo https://github.com/owner/repo

List Commands

OptionDescription
--list-agentsList available coding agents
kapso --list-agents

Examples

Simple Usage

kapso evolve \
    --goal "Build a random forest classifier for the Iris dataset"

With Evaluation and Data

kapso evolve \
    --goal "Build a classifier with accuracy > 0.9" \
    --eval-dir ./evaluation/ \
    --data-dir ./data/

Full Options

kapso evolve \
    --goal-file problem.txt \
    --iterations 20 \
    --mode GENERIC \
    --coding-agent claude_code \
    --initial-repo https://github.com/owner/starter-repo \
    --eval-dir ./evaluation/ \
    --data-dir ./data/ \
    --output ./my_solution

Output

============================================================
EVOLVING: Build a random forest classifier for the Iris dataset
============================================================
  Max iterations: 10
  Coding agent: from config

Running experiments...
Experiment 1: Developer agent implementing solution...
Experiment 1: Running evaluation in kapso_evaluation/...
Experiment 1: Feedback generator validating results...
Experiment 1 completed with cumulative cost: $0.125
####################################################################################################
Experiment with score 0.92:
# Solution: Random forest with GridSearchCV hyperparameter tuning...
# Feedback: Good progress! Accuracy 0.92 meets the > 0.9 target. Goal achieved.
####################################################################################################

============================================================
Evolution Complete
============================================================
Solution at: ./my_solution
Experiments run: 1
Total cost: $0.125
Stopped reason: goal_achieved
Goal achieved: True

============================================================
COMPLETED
============================================================
Solution: ./my_solution
Goal achieved: True
Final score: 0.92
Cost: $0.125
Stopped reason: goal_achieved

Environment Variables

The CLI loads environment variables from .env:
OPENAI_API_KEY=your-openai-api-key
GOOGLE_API_KEY=your-google-api-key
ANTHROPIC_API_KEY=your-anthropic-api-key

Available Coding Agents

$ kapso --list-agents

Available Coding Agents:
==================================================
  aider: Git-centric pair programming with diff-based editing
  gemini: Google Gemini SDK for code generation
  claude_code: Anthropic Claude Code CLI for complex refactoring
  openhands: OpenHands agent with sandboxed execution

Exit Codes

CodeMeaning
0Success
1Error (missing arguments, failed experiment)

Tips

Use kapso --list-agents to discover available coding agents.
API keys are required. Set them in .env or as environment variables.