---
title: "llm-coding-agent 0.1a0 发布：基于LLM的简单编码代理"
source: "Simon Willison 博客（Atom）"
source_tier: "t2"
url: "https://simonwillison.net/2026/Jul/2/llm-coding-agent/#atom-everything"
permalink: "https://feed.astralor.com/items/itm_304f4fc74033b4d43b6f7973"
published: "2026-07-02T19:33:12.000Z"
score: 68
channel: "ai"
tags: ["LLM","llm-coding-agent","Python","编码代理"]
---

# llm-coding-agent 0.1a0 发布：基于LLM的简单编码代理

## 速览

Simon Willison 发布了 llm-coding-agent 0.1a0，这是一个基于其 LLM 库演化为代理框架后的实验性编码代理。该工具实现了类似 Claude Code 的功能，包含文件编辑、命令执行、文件搜索等工具，并采用 TDD 方式构建。目前已在 PyPI 上发布，用户可通过 uvx 命令直接使用。项目支持多种操作模式，如 --yolo 和 --allow 参数，并提供了 Python API 供集成。

## 关键点

- 基于 LLM 库演化的代理框架，实现简单的编码代理
- 包含 6 个工具：编辑文件、执行命令、列出文件、读取文件、搜索文件、写入文件
- 支持 --yolo 和 --allow 等参数，以及 Python API
- 采用红绿 TDD 方式构建，已提交到 PyPI

## 全文

Release: llm-coding-agent 0.1a0 Another Fable 5 experiment. Now that my LLM library has evolved into more of an agent framework it's time to see what a simple coding agent would look like built on it. I started a new Python library using my python-lib-template-repository GitHub template repository, then ran these two prompts (here's the Claude Code for web transcript): Write a spec.md for this project - it will depend on the latest “llm” alpha from PyPI and implement a Claude code style coding agent complete with tools for reading and editing files and executing commands Then: Commit the spec, then build it using red/green TDD in a series of sensible commits (each with passing tests and updated docs) - occasionally manually test it using the OpenAI API key in your environment Here's the resulting README file and the sequence of commits. I've shipped a slop-alpha to PyPI, so you can run the new agent like this: uvx --prerelease=allow --with llm-coding-agent llm code It's pretty good for a first attempt! Here's the (Fable-authored) README, which lists recipes like llm code --yolo and llm code --allow "pytest*" --allow "git diff*". It also presents a Python API based around a CodingAgent(model="gpt-5.5", root="/path", approve=True).run("Fix the failing test in tests/test_parser.py") class which I didn't ask for but I'm delighted to see implemented. Here's the suite of tools it implemented, listed using uvx ... llm tools: CodingTools_edit_file(path: str, old_string: str, new_string: str, replace_all: bool = False) -> str Replace an exact string in a file. old_string must match the file contents exactly (including whitespace) and must identify a unique location unless replace_all is true. Returns a diff of the change so it can be verified. CodingTools_execute_command(command: str, timeout: int = 120) -> str Run a shell command in the session root directory. Returns combined stdout and stderr followed by an Exit code line. timeout is in seconds (maximum 600); on timeout the whole process tree is killed. CodingTools_list_files(pattern: str = '**/*', path: str = '.') -> str List files matching a glob pattern, newest first. Skips hidden directories, node_modules, __pycache__ and (in a git repository) anything covered by .gitignore. Returns at most 200 paths relative to the searched directory. CodingTools_read_file(path: str, offset: int = 0, limit: int = 2000) -> str Read a text file, returning numbered lines like cat -n. Paths are relative to the session root. Use offset (0-based first line) and limit (max lines) to page through files too large to read in one call. CodingTools_search_files(pattern: str, path: str = '.', glob: str = None, max_results: int = 100) -> str Search file contents for a regular expression. Returns matches as path:line_number:line, capped at max_results. Use glob (e.g. "*.py") to restrict which files are searched. CodingTools_write_file(path: str, content: str) -> str Create or overwrite a file with the given content. Parent directories are created as needed. Prefer edit_file for modifying existing files. Tags: projects, ai, generative-ai, llm, llm-tool-use, coding-agents, claude-code, claude-mythos

---

引用前请核对原文;本文由星际流动整理:https://feed.astralor.com/items/itm_304f4fc74033b4d43b6f7973
