Python

smol

A tiny coding agent for the terminal. Dependency-free Python, and the whole loop fits in one file.

Files1The whole agent loop, in one file.
Dependencies0Plain Python, nothing to install.
ModelsAnyAny OpenAI-compatible endpoint.

What it does

smol is a coding agent you can read in one sitting.

You give it a task, the model replies with a shell command, smol runs it and feeds the output back, and the loop keeps going until the job is done.

Try it withsmol "find the failing test and explain the likely cause"smol "add a --json flag to cli.py"smol "why is this script slow"/new to start over, /exit to leave
Example run
smol
smol "find the failing test and explain the likely cause"$ python3 -m pytest -q1 failed, 23 passed test_parse_date$ sed -n 40,60p parser.py return datetime.strptime(s, "%d/%m/%Y")The test passes 2024-03-01 but the parser expects day/month/year.
  1. 01

    Log in

    smol login saves a base URL, key and model. Any OpenAI compatible endpoint works, local or hosted.

  2. 02

    Give a task

    Run smol "task" for a one shot job, or plain smol for an interactive session.

  3. 03

    Loop

    The model answers with a command, smol prints it, runs it and sends the output back.

  4. 04

    Finish

    It stops when the model answers without a command, or after 40 steps.

Why smol

Shows every command

Each shell command is printed as it runs, with its output right under it.

Bring any model

Point it at any OpenAI-compatible API, local or hosted.

Readable

Small enough to read in one sitting and change in five minutes.

$ git clone https://github.com/morriszdweck/smol
$ cd smol && python3 smol.py login