Start
Install the tool, then run four commands in a project folder. You do not need a GPU.
You need
- Python 3.11 or newer, on macOS, Linux or Windows. Check with
python3 --version. macOS/usr/bin/python3is often 3.9 and cannot install this package - A folder to point at — yours, or the sample below
- Ollama later, for
askand dailyrun(about 5 GB).briefand the NameError sample do not need it
1. Install
Usual path — PyPI. The command is py-harness. The package name is
py-harness-cli because py-harness collides with another project.
Do not pip install py-harness or pip install pyharness.
python3 -m venv .venv && source .venv/bin/activate
pip install py-harness-cli
Activate that virtualenv in every new terminal
(source .venv/bin/activate, or .venv\Scripts\Activate.ps1 on
Windows) or the shell says command not found: py-harness.
From a clone (sample project, editable install, training extras):
git clone https://github.com/YauhenBichel/py-harness.git
cd py-harness
python3 scripts/run/install.py
source .venv/bin/activate
That creates .venv if you are not already in a virtualenv, then
pip install -e .. Already in a virtualenv: pip install -e . is
the same install.
2. Check it works
No model yet. Your own project, from that folder:
py-harness brief
Or py-harness brief ~/app. A missing folder is refused. The sample
needs a clone — pip install does not download demo/orders. Do not
brief the repository root.
git clone https://github.com/YauhenBichel/py-harness.git
cd py-harness/demo/orders
py-harness brief
py-harness run "find the NameError and fix it"
You should see about 10 files, then the subtotl typo bound. From a
clone root, without cd: py-harness brief demo/orders.
3. Download the model (once)
ollama pull llama3.1:8b
4. Use it
Still in demo/orders, with the virtualenv active:
py-harness ask "what does compute_total return?"
py-harness run "write tests for apply_discount"
py-harness run "find the NameError and fix it"
py-harness run "add a function total_lines and a test"
ask does not change a file. run writes, then runs the tests. A
failing traceback is sent back to the model once. The NameError and
total_lines samples on demo/orders do not call a model. run only
touches that folder and keeps a .bak of each file it edits.
py-harness with no arguments reprints this list.
On a large project: py-harness run --scope src "write tests for apply_discount".
To try a change without writing: add --dry-run.
Every flag: Commands. What those four commands did on one laptop: What you type. A recorded session: Live. Measured scores: Results.
Later
- Last recorded turns:
py-harness last - Add to VS Code —
py-harness editors vscode - Add to Cursor —
py-harness editors cursor --allow-writes - Folders — what each directory is
- Tests for this repository:
python -m unittest discover -s tests -q