Cherno is a command line assistant that turns natural-language requests into concrete edits inside your workspace. It talks to OpenAI's Responses API, plans the changes it should make, shows you the resulting diff, and only writes to disk (and Git) after you confirm.
- Install Python 3.10+ and create a virtual environment if desired.
- Install dependencies and the CLI in editable mode:
pip install -e . - Provide credentials. Set
OPENAI_API_KEY(and optionallyMODEL) in your shell or in a.envfile at the project root.MODELdefaults togpt-5-codex. - Launch the interactive REPL:
cherno - Or run a one-off instruction without the REPL:
python main.py "Add unit tests for planner.plan_from_intent"
- Intent parsing - Cherno sends the conversation history plus your latest request to the model and validates the structured intent it gets back.
- Planning & synthesis - the intent is expanded into concrete steps (read files, synthesize a patch, show a diff, run a command).
- Confirmation & execution - you preview the diff before approving. Once confirmed, Cherno writes the file, commits the change, and optionally runs planned commands.
If the repository is not already initialized, Cherno runs git init and creates an initial commit so subsequent writes can be captured.
:help- show all commands.:dry on|off- toggle dry-run mode (synthesizes changes but skips writes and commits).:debug on|off- print the raw model response for debugging.:rollback- revert the most recent commit viagit reset --hard HEAD~1.:clear- refresh the terminal banner.:exitor:quit- leave the REPL.
Each natural-language prompt in the REPL invokes the same pipeline as a direct python main.py run, with your choices persisted in .agent/.repl_history.
main.pyorchestrates the run: loads chat memory, builds LLM requests, prints the plan, handles confirmation, and writes files or runs commands.llm.pyloads environment variables (viapython-dotenv) and constructs the OpenAI client.intents.pydefines the structured intent schema (edit_file,create_file,run_command) and validates payloads returned by the model.planner.pyconverts an intent into a sequence of step dictionaries the CLI executes.patcher.pysends instructions plus the original file to the model and returns the synthesized full file content.fs_ops.pyperforms safe file reads/writes and builds unified diffs for previews.memory.pypersists the ongoing conversation in.agent/session.jsonso follow-up prompts retain context.sandbox.pypicks a sandbox provider; local execution is default, with an E2B integration available.providers/local_sandbox.pyruns allowlisted commands locally under a configurable timeout.providers/e2b_sandbox.pyconnects to the E2B cloud sandbox (requiresE2B_API_KEY).executor.pyenforces the allowlist defined in.agent/policy.jsonbefore running commands.git_ops.pyhandles repository bootstrapping, add/commit flows, and rollbacks.src/cherno/cli.pyimplements the REPL experience, ASCII banner, and command toggles.
Supporting files under .agent/ hold runtime configuration:
policy.json- command allowlist and timeout. Created on first run; edit it to authorize additional binaries.sandbox.json- selects the sandbox provider (localore2b). Bootstrapped automatically when missing..repl_history- prompt history for the REPL.
- Create files - "Create
.github/workflows/tests.ymlthat runs pytest on push." The plan shows the file before writing. - Edit files - "Update
planner.pysoshow_diffcomes beforewrite_file." Cherno reads the file, synthesizes a replacement, and asks you to confirm the diff. - Run commands - "Run tests with pytest." Commands must be allowlisted; otherwise Cherno explains the restriction.
- Iterate - Conversational memory means you can give short follow-ups. Delete
.agent/session.jsonto restart from a clean slate. - Stay dry - Toggle dry-run in the REPL to preview diffs without touching disk or Git.
Approved changes are written to disk and committed with messages such as feat(agent): update <path>. You can amend afterwards if you need custom commit text.
- Add new intent types by updating
intents.pyandplanner.py. - Adjust the sandbox policy by editing
.agent/policy.json(allowlist or timeout). - Introduce new sandbox providers under
providers/and switch via.agent/sandbox.json. - Customize synthesis strategies by modifying
patcher.pyor adding new helper modules. - Package new REPL commands within
src/cherno/cli.py.
- Missing dependencies - install the project with
pip install -e .. If you prefer pinned versions, add arequirements.txtor use a lockfile. - Command blocked - add the binary to the
allowlistin.agent/policy.jsonand rerun. - E2B provider errors - ensure
E2B_API_KEYis set and thee2b(ore2b_code_interpreter) package is installed. - Stale memory - delete
.agent/session.jsonto forget previous conversations. Remove.agent/.repl_historyto clear REPL history. - Unexpected Git state - use
:rollbackin the REPL or runpython main.py --rollbackto revert the latest commit.
With these pieces in place, you control every change Cherno proposes while steering it entirely through natural language.