coder-agent 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. coder_agent-0.1.0/LICENSE.md +21 -0
  2. coder_agent-0.1.0/PKG-INFO +262 -0
  3. coder_agent-0.1.0/README.md +177 -0
  4. coder_agent-0.1.0/pyproject.toml +298 -0
  5. coder_agent-0.1.0/setup.cfg +4 -0
  6. coder_agent-0.1.0/src/coder_agent.egg-info/PKG-INFO +262 -0
  7. coder_agent-0.1.0/src/coder_agent.egg-info/SOURCES.txt +166 -0
  8. coder_agent-0.1.0/src/coder_agent.egg-info/dependency_links.txt +1 -0
  9. coder_agent-0.1.0/src/coder_agent.egg-info/entry_points.txt +2 -0
  10. coder_agent-0.1.0/src/coder_agent.egg-info/requires.txt +48 -0
  11. coder_agent-0.1.0/src/coder_agent.egg-info/top_level.txt +1 -0
  12. coder_agent-0.1.0/src/coderagent/__init__.py +20 -0
  13. coder_agent-0.1.0/src/coderagent/compat/__init__.py +27 -0
  14. coder_agent-0.1.0/src/coderagent/compat/cache_control.py +69 -0
  15. coder_agent-0.1.0/src/coderagent/compat/config_spec.py +60 -0
  16. coder_agent-0.1.0/src/coderagent/compat/exceptions.py +20 -0
  17. coder_agent-0.1.0/src/coderagent/compat/retry.py +27 -0
  18. coder_agent-0.1.0/src/coderagent/compat/serialize.py +31 -0
  19. coder_agent-0.1.0/src/coderagent/config/__init__.py +1 -0
  20. coder_agent-0.1.0/src/coderagent/config/defaults.yaml +103 -0
  21. coder_agent-0.1.0/src/coderagent/config/loader.py +264 -0
  22. coder_agent-0.1.0/src/coderagent/config/schema.py +548 -0
  23. coder_agent-0.1.0/src/coderagent/config/writer.py +218 -0
  24. coder_agent-0.1.0/src/coderagent/core/__init__.py +1 -0
  25. coder_agent-0.1.0/src/coderagent/core/budget.py +47 -0
  26. coder_agent-0.1.0/src/coderagent/core/capabilities.py +136 -0
  27. coder_agent-0.1.0/src/coderagent/core/checkpoint.py +164 -0
  28. coder_agent-0.1.0/src/coderagent/core/content.py +156 -0
  29. coder_agent-0.1.0/src/coderagent/core/context.py +618 -0
  30. coder_agent-0.1.0/src/coderagent/core/events.py +83 -0
  31. coder_agent-0.1.0/src/coderagent/core/history.py +56 -0
  32. coder_agent-0.1.0/src/coderagent/core/instructions.py +99 -0
  33. coder_agent-0.1.0/src/coderagent/core/loop.py +702 -0
  34. coder_agent-0.1.0/src/coderagent/core/memory.py +56 -0
  35. coder_agent-0.1.0/src/coderagent/core/mentions.py +81 -0
  36. coder_agent-0.1.0/src/coderagent/core/os_sandbox.py +191 -0
  37. coder_agent-0.1.0/src/coderagent/core/otel.py +214 -0
  38. coder_agent-0.1.0/src/coderagent/core/protocols.py +38 -0
  39. coder_agent-0.1.0/src/coderagent/core/redact.py +49 -0
  40. coder_agent-0.1.0/src/coderagent/core/sandbox.py +82 -0
  41. coder_agent-0.1.0/src/coderagent/core/schema.py +107 -0
  42. coder_agent-0.1.0/src/coderagent/core/session.py +344 -0
  43. coder_agent-0.1.0/src/coderagent/core/shell_env.py +74 -0
  44. coder_agent-0.1.0/src/coderagent/core/subagent.py +474 -0
  45. coder_agent-0.1.0/src/coderagent/core/summarize.py +312 -0
  46. coder_agent-0.1.0/src/coderagent/core/telemetry.py +209 -0
  47. coder_agent-0.1.0/src/coderagent/core/tokens.py +132 -0
  48. coder_agent-0.1.0/src/coderagent/core/trust.py +301 -0
  49. coder_agent-0.1.0/src/coderagent/environments/__init__.py +11 -0
  50. coder_agent-0.1.0/src/coderagent/environments/bubblewrap.py +150 -0
  51. coder_agent-0.1.0/src/coderagent/environments/contree.py +146 -0
  52. coder_agent-0.1.0/src/coderagent/environments/docker.py +160 -0
  53. coder_agent-0.1.0/src/coderagent/environments/local.py +110 -0
  54. coder_agent-0.1.0/src/coderagent/environments/singularity.py +138 -0
  55. coder_agent-0.1.0/src/coderagent/environments/swerex_docker.py +79 -0
  56. coder_agent-0.1.0/src/coderagent/environments/swerex_modal.py +123 -0
  57. coder_agent-0.1.0/src/coderagent/eval/__init__.py +1 -0
  58. coder_agent-0.1.0/src/coderagent/eval/compare.py +190 -0
  59. coder_agent-0.1.0/src/coderagent/eval/report.py +141 -0
  60. coder_agent-0.1.0/src/coderagent/eval/runner.py +368 -0
  61. coder_agent-0.1.0/src/coderagent/eval/task.py +194 -0
  62. coder_agent-0.1.0/src/coderagent/extensions/__init__.py +1 -0
  63. coder_agent-0.1.0/src/coderagent/extensions/hooks.py +121 -0
  64. coder_agent-0.1.0/src/coderagent/extensions/plugins.py +217 -0
  65. coder_agent-0.1.0/src/coderagent/extensions/reflect.py +342 -0
  66. coder_agent-0.1.0/src/coderagent/models/__init__.py +33 -0
  67. coder_agent-0.1.0/src/coderagent/models/backends.py +218 -0
  68. coder_agent-0.1.0/src/coderagent/models/call.py +18 -0
  69. coder_agent-0.1.0/src/coderagent/models/check.py +139 -0
  70. coder_agent-0.1.0/src/coderagent/models/gateway.py +60 -0
  71. coder_agent-0.1.0/src/coderagent/models/litellm_config.py +70 -0
  72. coder_agent-0.1.0/src/coderagent/models/provider.py +98 -0
  73. coder_agent-0.1.0/src/coderagent/models/reasoning.py +28 -0
  74. coder_agent-0.1.0/src/coderagent/models/router.py +136 -0
  75. coder_agent-0.1.0/src/coderagent/models/settings.py +172 -0
  76. coder_agent-0.1.0/src/coderagent/models/streaming.py +122 -0
  77. coder_agent-0.1.0/src/coderagent/models/verbosity.py +14 -0
  78. coder_agent-0.1.0/src/coderagent/paths.py +31 -0
  79. coder_agent-0.1.0/src/coderagent/run.py +454 -0
  80. coder_agent-0.1.0/src/coderagent/skills/__init__.py +119 -0
  81. coder_agent-0.1.0/src/coderagent/skills/errors.py +11 -0
  82. coder_agent-0.1.0/src/coderagent/skills/install.py +340 -0
  83. coder_agent-0.1.0/src/coderagent/skills/presets/code-review/SKILL.md +35 -0
  84. coder_agent-0.1.0/src/coderagent/skills/presets/codebase-onboarding/SKILL.md +33 -0
  85. coder_agent-0.1.0/src/coderagent/skills/presets/data-analysis/SKILL.md +35 -0
  86. coder_agent-0.1.0/src/coderagent/skills/presets/deep-research/SKILL.md +38 -0
  87. coder_agent-0.1.0/src/coderagent/skills/presets/frontend-dev/SKILL.md +32 -0
  88. coder_agent-0.1.0/src/coderagent/skills/presets/long-document/SKILL.md +37 -0
  89. coder_agent-0.1.0/src/coderagent/skills/presets/long-document/scripts/pdf_text.py +37 -0
  90. coder_agent-0.1.0/src/coderagent/skills/presets/office-docx/SKILL.md +36 -0
  91. coder_agent-0.1.0/src/coderagent/skills/presets/office-docx/scripts/docx_text.py +36 -0
  92. coder_agent-0.1.0/src/coderagent/skills/presets/office-pptx/SKILL.md +32 -0
  93. coder_agent-0.1.0/src/coderagent/skills/presets/office-xlsx/SKILL.md +34 -0
  94. coder_agent-0.1.0/src/coderagent/skills/presets/office-xlsx/scripts/xlsx_text.py +72 -0
  95. coder_agent-0.1.0/src/coderagent/skills/presets/writing/SKILL.md +31 -0
  96. coder_agent-0.1.0/src/coderagent/skills/sandbox.py +269 -0
  97. coder_agent-0.1.0/src/coderagent/skills/sites.py +177 -0
  98. coder_agent-0.1.0/src/coderagent/skills/source.py +404 -0
  99. coder_agent-0.1.0/src/coderagent/testing/__init__.py +5 -0
  100. coder_agent-0.1.0/src/coderagent/testing/factory.py +59 -0
  101. coder_agent-0.1.0/src/coderagent/testing/scripted_model.py +54 -0
  102. coder_agent-0.1.0/src/coderagent/tools/__init__.py +1 -0
  103. coder_agent-0.1.0/src/coderagent/tools/base.py +54 -0
  104. coder_agent-0.1.0/src/coderagent/tools/bash_policy.py +486 -0
  105. coder_agent-0.1.0/src/coderagent/tools/builtin/__init__.py +35 -0
  106. coder_agent-0.1.0/src/coderagent/tools/builtin/fs.py +283 -0
  107. coder_agent-0.1.0/src/coderagent/tools/builtin/patch.py +279 -0
  108. coder_agent-0.1.0/src/coderagent/tools/builtin/search.py +242 -0
  109. coder_agent-0.1.0/src/coderagent/tools/builtin/shell.py +336 -0
  110. coder_agent-0.1.0/src/coderagent/tools/builtin/skill.py +41 -0
  111. coder_agent-0.1.0/src/coderagent/tools/builtin/task.py +53 -0
  112. coder_agent-0.1.0/src/coderagent/tools/builtin/todo.py +63 -0
  113. coder_agent-0.1.0/src/coderagent/tools/executor.py +243 -0
  114. coder_agent-0.1.0/src/coderagent/tools/mcp.py +317 -0
  115. coder_agent-0.1.0/src/coderagent/tools/permissions.py +472 -0
  116. coder_agent-0.1.0/src/coderagent/tools/registry.py +83 -0
  117. coder_agent-0.1.0/src/coderagent/tools/rules.py +138 -0
  118. coder_agent-0.1.0/src/coderagent/ui/__init__.py +1 -0
  119. coder_agent-0.1.0/src/coderagent/ui/cli.py +498 -0
  120. coder_agent-0.1.0/src/coderagent/ui/commands/__init__.py +109 -0
  121. coder_agent-0.1.0/src/coderagent/ui/commands/builtin.py +778 -0
  122. coder_agent-0.1.0/src/coderagent/ui/commands/compact.py +12 -0
  123. coder_agent-0.1.0/src/coderagent/ui/commands/resume.py +26 -0
  124. coder_agent-0.1.0/src/coderagent/ui/commands/review.py +73 -0
  125. coder_agent-0.1.0/src/coderagent/ui/commands/rewind.py +28 -0
  126. coder_agent-0.1.0/src/coderagent/ui/custom_commands.py +179 -0
  127. coder_agent-0.1.0/src/coderagent/ui/notify.py +46 -0
  128. coder_agent-0.1.0/src/coderagent/ui/open_file.py +48 -0
  129. coder_agent-0.1.0/src/coderagent/ui/render.py +62 -0
  130. coder_agent-0.1.0/src/coderagent/ui/spinner.py +68 -0
  131. coder_agent-0.1.0/src/coderagent/ui/tui.py +610 -0
  132. coder_agent-0.1.0/src/coderagent/ui/widgets/__init__.py +29 -0
  133. coder_agent-0.1.0/src/coderagent/ui/widgets/approval_prompt.py +129 -0
  134. coder_agent-0.1.0/src/coderagent/ui/widgets/diff_view.py +97 -0
  135. coder_agent-0.1.0/src/coderagent/ui/widgets/file_tree.py +105 -0
  136. coder_agent-0.1.0/src/coderagent/ui/widgets/markdown_message.py +44 -0
  137. coder_agent-0.1.0/src/coderagent/ui/widgets/markup.py +10 -0
  138. coder_agent-0.1.0/src/coderagent/ui/widgets/message_block.py +61 -0
  139. coder_agent-0.1.0/src/coderagent/ui/widgets/path_suggester.py +66 -0
  140. coder_agent-0.1.0/src/coderagent/ui/widgets/session_picker.py +49 -0
  141. coder_agent-0.1.0/src/coderagent/ui/widgets/status_bar.py +44 -0
  142. coder_agent-0.1.0/src/coderagent/ui/widgets/todo_panel.py +40 -0
  143. coder_agent-0.1.0/src/coderagent/ui/widgets/tool_card.py +104 -0
  144. coder_agent-0.1.0/src/coderagent/ui/widgets/working_dots.py +26 -0
  145. coder_agent-0.1.0/src/coderagent/version.py +7 -0
  146. coder_agent-0.1.0/src/coderagent/web/__init__.py +5 -0
  147. coder_agent-0.1.0/src/coderagent/web/api.py +449 -0
  148. coder_agent-0.1.0/src/coderagent/web/app.py +113 -0
  149. coder_agent-0.1.0/src/coderagent/web/approver.py +73 -0
  150. coder_agent-0.1.0/src/coderagent/web/config_api.py +53 -0
  151. coder_agent-0.1.0/src/coderagent/web/events.py +159 -0
  152. coder_agent-0.1.0/src/coderagent/web/files.py +115 -0
  153. coder_agent-0.1.0/src/coderagent/web/i18n.py +346 -0
  154. coder_agent-0.1.0/src/coderagent/web/server.py +100 -0
  155. coder_agent-0.1.0/src/coderagent/web/sessions.py +404 -0
  156. coder_agent-0.1.0/src/coderagent/web/skills_api.py +376 -0
  157. coder_agent-0.1.0/src/coderagent/web/static/app.css +283 -0
  158. coder_agent-0.1.0/src/coderagent/web/static/app.js +1466 -0
  159. coder_agent-0.1.0/src/coderagent/web/templates/en/base.html +31 -0
  160. coder_agent-0.1.0/src/coderagent/web/templates/en/chat.html +60 -0
  161. coder_agent-0.1.0/src/coderagent/web/templates/en/macros.html +9 -0
  162. coder_agent-0.1.0/src/coderagent/web/templates/en/settings.html +80 -0
  163. coder_agent-0.1.0/src/coderagent/web/templates/en/skills.html +64 -0
  164. coder_agent-0.1.0/src/coderagent/web/templates/zh/base.html +31 -0
  165. coder_agent-0.1.0/src/coderagent/web/templates/zh/chat.html +60 -0
  166. coder_agent-0.1.0/src/coderagent/web/templates/zh/macros.html +9 -0
  167. coder_agent-0.1.0/src/coderagent/web/templates/zh/settings.html +77 -0
  168. coder_agent-0.1.0/src/coderagent/web/templates/zh/skills.html +61 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Kilian A. Lieret and Carlos E. Jimenez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,262 @@
1
+ Metadata-Version: 2.4
2
+ Name: coder-agent
3
+ Version: 0.1.0
4
+ Summary: A coding agent for the terminal, for the browser and as a library
5
+ Author-email: sailor <sds819@126.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Kilian A. Lieret and Carlos E. Jimenez
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ Project-URL: Homepage, https://github.com/sds819/coder-agent
28
+ Project-URL: Repository, https://github.com/sds819/coder-agent
29
+ Project-URL: Bug Tracker, https://github.com/sds819/coder-agent/issues
30
+ Project-URL: Documentation, https://sds819.github.io/coder-agent/latest/
31
+ Keywords: nlp,agents,code,coding-agent
32
+ Classifier: Development Status :: 3 - Alpha
33
+ Classifier: Operating System :: OS Independent
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Programming Language :: Python :: 3.10
37
+ Classifier: Programming Language :: Python :: 3 :: Only
38
+ Requires-Python: >=3.10
39
+ Description-Content-Type: text/markdown
40
+ License-File: LICENSE.md
41
+ Requires-Dist: pyyaml
42
+ Requires-Dist: requests
43
+ Requires-Dist: jinja2
44
+ Requires-Dist: pydantic>=2.0
45
+ Requires-Dist: litellm!=1.82.7,!=1.82.8,>=1.75.5
46
+ Requires-Dist: tenacity
47
+ Requires-Dist: rich
48
+ Requires-Dist: python-dotenv
49
+ Requires-Dist: typer
50
+ Requires-Dist: platformdirs
51
+ Requires-Dist: textual
52
+ Requires-Dist: fastapi>=0.115
53
+ Provides-Extra: full
54
+ Requires-Dist: coder-agent[dev]; extra == "full"
55
+ Requires-Dist: coder-agent[sandbox]; extra == "full"
56
+ Requires-Dist: coder-agent[mcp]; extra == "full"
57
+ Provides-Extra: sandbox
58
+ Requires-Dist: swe-rex>=1.4.0; extra == "sandbox"
59
+ Requires-Dist: modal; extra == "sandbox"
60
+ Requires-Dist: boto3; extra == "sandbox"
61
+ Requires-Dist: contree-sdk<0.3,>=0.2.0; extra == "sandbox"
62
+ Provides-Extra: dev
63
+ Requires-Dist: pytest; extra == "dev"
64
+ Requires-Dist: pytest-cov; extra == "dev"
65
+ Requires-Dist: pytest-asyncio; extra == "dev"
66
+ Requires-Dist: pytest-xdist; extra == "dev"
67
+ Requires-Dist: pre-commit; extra == "dev"
68
+ Requires-Dist: ruff; extra == "dev"
69
+ Requires-Dist: mkdocs-include-markdown-plugin; extra == "dev"
70
+ Requires-Dist: mkdocstrings[python]>=0.18; extra == "dev"
71
+ Requires-Dist: mike; extra == "dev"
72
+ Requires-Dist: mkdocs-material; extra == "dev"
73
+ Requires-Dist: mkdocs-glightbox; extra == "dev"
74
+ Requires-Dist: mkdocs-redirects; extra == "dev"
75
+ Requires-Dist: coder-agent[sandbox]; extra == "dev"
76
+ Requires-Dist: uvicorn>=0.30; extra == "dev"
77
+ Requires-Dist: jinja2>=3.1.5; extra == "dev"
78
+ Requires-Dist: httpx>=0.27; extra == "dev"
79
+ Provides-Extra: web
80
+ Requires-Dist: uvicorn>=0.30; extra == "web"
81
+ Requires-Dist: jinja2>=3.1.5; extra == "web"
82
+ Provides-Extra: mcp
83
+ Requires-Dist: mcp>=2.0.0; extra == "mcp"
84
+ Dynamic: license-file
85
+
86
+ # The coding agent
87
+
88
+ > 中文版:[README_zh.md](https://github.com/sds819/coder-agent/blob/main/README_zh.md)
89
+
90
+ [![Docs](https://img.shields.io/badge/Docs-green?style=for-the-badge&logo=materialformkdocs&logoColor=white)](https://github.com/sds819/coder-agent/tree/main/docs)
91
+
92
+ `coder` is an interactive coding agent: it reads the code, writes the code, runs
93
+ the commands and tells you what it changed. It runs in the terminal **and** in
94
+ the browser, and it is a library too.
95
+
96
+ ```bash
97
+ pip install coder-agent
98
+ cd my-project
99
+
100
+ coder # the terminal interface
101
+ coder web # the same agent in the browser
102
+ coder eval path/to/suite # run a task suite against the agent
103
+ ```
104
+
105
+ The package is on PyPI. To follow the repository instead:
106
+ `pip install "coder-agent @ git+https://github.com/sds819/coder-agent"`.
107
+
108
+ ## What it does
109
+
110
+ **Tools.** Fourteen built-ins: `read`, `write`, `edit`, `multi_edit` and `apply_patch` to change
111
+ files; `glob`, `grep` and `ls` to find code; `bash`, `bash_output` and `bash_kill` to run commands
112
+ (also in the background); `todo_write` to keep a task list; `task` to spawn a sub agent; `skill`
113
+ to load a skill.
114
+
115
+ **Permissions.** Five modes: `default` (everything that changes something asks), `acceptEdits`
116
+ (writes pass, the rest still asks), `plan` and `readonly` (nothing is changed) and `bypass`
117
+ (nothing asks). Rules live in `~/.coderagent/rules.yaml` (yours) and `.coderagent/rules.yaml`
118
+ (the project's); a `deny` always wins over an `allow`.
119
+
120
+ **Sessions.** Every session has an event log, so it can be resumed (`coder --resume`), forked
121
+ (`/fork`), rewound (`/rewind`) and exported (`coder export`). The trace of a session can be sent to
122
+ an OpenTelemetry collector. A session started in the browser can be continued in the terminal, and
123
+ the other way round.
124
+
125
+ **Context.** The conversation is compacted when it reaches 80% of the budget; the summary keeps
126
+ the goal, the findings, the decisions, the files that were touched and the open questions. Before
127
+ a round ends, three gates are checked in order: a `Stop` hook, the `verify.commands` of the
128
+ project, and the output schema.
129
+
130
+ **Memory.** The project writes `.coderagent/memory/*.md`, your own preferences live in
131
+ `~/.coderagent/CLAUDE.md`, and `/init` writes an `AGENTS.md` for the repository.
132
+
133
+ **Subagents and routing.** `task` spawns a sub agent (`code-explorer`, `verifier`, `refactorer`
134
+ and your own). Different jobs can use different models: `main`, `cheap`, `strong`, `summarize`,
135
+ `reflect` and `review`.
136
+
137
+ **Extensions.** Hooks on nine events (`PreToolUse`, `PostToolUse`, `UserPromptSubmit`, `Stop`,
138
+ `SessionStart`, `SessionEnd`, `SubagentStop`, `PreCompact`, `PostCompact`), MCP servers, plugins,
139
+ skills and custom slash commands.
140
+
141
+ **Sandboxes.** The commands can run in `local`, `docker`, `singularity`, `bubblewrap`, `contree`
142
+ or SWE-ReX (`swerex_docker`, `swerex_modal`).
143
+
144
+ **35 slash commands** in the terminal (`/model`, `/mode`, `/plan`, `/review`, `/diff`, `/cost`,
145
+ `/context`, `/compact`, `/resume`, `/fork`, `/agents`, `/permissions`, `/hooks`, `/sandbox`, …)
146
+ — the same set in the browser.
147
+
148
+ **The web interface.** `coder web` serves a chat page, a settings page (model and permissions as
149
+ forms), a file tree and the diffs of the session. Every action is a plain HTTP call, so the
150
+ browser can be driven by a script too; the API docs are at `/api/docs`.
151
+
152
+ **Evaluation.** `coder eval <suite>` runs a task suite against the agent and reports what the
153
+ agent did with every task; `coder eval-compare` diffs two reports and names the regressions.
154
+
155
+ > [!WARNING]
156
+ > The browser interface has **no authentication**: everybody who can reach the port can drive the agent and run
157
+ > shell commands in the working directory. Keep it on `127.0.0.1`.
158
+
159
+ ## The model
160
+
161
+ The models go through [litellm](https://github.com/BerriAI/litellm), so every model that litellm
162
+ supports works — with the name of the provider in front of it (`anthropic/…`, `deepseek/…`). The
163
+ key of the provider is read from the environment (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, …) or
164
+ from `~/.coderagent/.env`.
165
+
166
+ ```bash
167
+ coder -m deepseek/deepseek-flash --task "fix the failing test"
168
+ ```
169
+
170
+ The model is configured in the terminal, in the terminal interface and in the browser. All three
171
+ write the same file, `~/.coderagent/config.yaml`:
172
+
173
+ ```bash
174
+ coder model # show the settings in effect
175
+ coder model --name deepseek/deepseek-flash --max-retries 3 # write them down
176
+ coder model --test # try the model out
177
+ ```
178
+
179
+ The try-out and the writing are two steps: `--test` never writes anything, and the writing never
180
+ waits for the try-out — a configuration that does not work yet is worth writing down, to be fixed
181
+ later. The terminal interface has the same three steps (`/model name=… base=… key=… retries=…`,
182
+ `/model --test`, `/model --save`), and the settings page of the browser has a **Test** button next
183
+ to **Save**.
184
+
185
+ **Pictures.** When a picture is sent to a model nobody knows anything about, the agent asks it
186
+ once — with a picture of one color and the question what color it is — and writes the answer to
187
+ your own configuration file. The next time the configuration says it, and the model is never asked
188
+ again. A model that cannot take pictures is refused the turn, instead of making up an answer.
189
+
190
+ ## Read more
191
+
192
+ In `docs/usage`:
193
+
194
+ * [Quick start](docs/usage/coderagent_quickstart.md) — install it, set the model, run the first round (中文)
195
+ * [Everything `coder` can do](docs/usage/coderagent_features.md) — one page, every feature, with the errors you may hit
196
+ * [The web interface](docs/usage/coderagent_web.md) — the chat page, the settings page, the HTTP API, the security model
197
+ * [The commands](docs/usage/coderagent_commands.md) — every slash command
198
+ * [Sub agents](docs/usage/coderagent_subagents.md) — sub agents and their own models
199
+ * [Hooks](docs/usage/coderagent_hooks.md) — hooks on nine events
200
+ * [The sandbox](docs/usage/coderagent_sandbox.md) — where the commands run
201
+ * [The eval harness](docs/usage/coderagent_eval.md) — task suites, reports, comparisons
202
+ * [Model routing](docs/usage/coderagent_routing.md) — which model does which job
203
+ * [Memory](docs/usage/coderagent_memory.md) — project memory and your preferences
204
+ * [Skills](docs/usage/coderagent_skills.md) — the skills the agent may load
205
+ * [Plugins](docs/usage/coderagent_plugins.md) — the plugins that extend it
206
+ * [MCP servers](docs/usage/coderagent_mcp.md) — the tools other servers bring
207
+ * [The trace of a session](docs/usage/coderagent_export.md) — export the trace, send it to a collector
208
+
209
+ And if you want to know how it was designed, see `docs/design`:
210
+
211
+ * [The architecture](docs/design/coding-agent-architecture.md) — the layers, the modules, the interfaces, the key decisions
212
+ * [The design logic](docs/design/coderagent-design-logic.md) — why it grew this way: the load-bearing decisions, the invariants, the trade-offs
213
+ * [The questions and their answers](docs/design/coderagent-answers.md) — 41 questions about the agent, answered
214
+
215
+ ## Questions
216
+
217
+ * **Something is broken.** [Open a bug report](https://github.com/sds819/coder-agent/issues/new/choose) — the
218
+ template asks for the error message and how to reproduce it. The log of the last session is in
219
+ `~/.coderagent/sessions` (`coder export` writes it out).
220
+ * **An error you do not understand.** [Everything `coder` can do](docs/usage/coderagent_features.md) has a
221
+ "When something goes wrong" section for every part of the agent.
222
+ * **A question.** [Open a question](https://github.com/sds819/coder-agent/issues/new/choose) or ask on
223
+ [Discord](https://discord.gg/AVEFbBn2rH).
224
+
225
+ <a id="chinese"></a>
226
+
227
+ ### 中文
228
+
229
+ 这份 README 有中文版,文档也有中文的:
230
+
231
+ * [中文版 README](https://github.com/sds819/coder-agent/blob/main/README_zh.md)——整篇中文的这份介绍
232
+ * [快速开始](docs/usage/coderagent_quickstart.md)——装上、配置模型、跑第一轮
233
+ * [功能](docs/usage/coderagent_features_zh.md)——一页看完所有功能,外加你可能撞到的报错
234
+ * [网页版](docs/usage/coderagent_web_zh.md)——聊天页、设置页、HTTP API、安全模型
235
+ * [命令](docs/usage/coderagent_commands_zh.md)——全部 slash 命令
236
+ * [子 agent](docs/usage/coderagent_subagents_zh.md)——子 agent 和模型路由
237
+ * [Hooks](docs/usage/coderagent_hooks_zh.md)——九个事件上的 hook
238
+ * [沙箱](docs/usage/coderagent_sandbox_zh.md)——命令跑在哪里
239
+ * [评测](docs/usage/coderagent_eval_zh.md)——任务集、报告和对比
240
+
241
+ ## Where it comes from
242
+
243
+ This agent is built on the ideas of [mini-swe-agent](https://github.com/SWE-agent/mini-swe-agent),
244
+ the minimal AI software engineering agent: the linear history of the messages, the commands run
245
+ through one `bash` tool, the model layer of litellm, and the sandbox environments (Docker,
246
+ Singularity, bubblewrap, contree, SWE-ReX) that came with it. Everything else — the agent loop,
247
+ the tool system and the permission layer, the sessions and the event log, the context engine and
248
+ its compaction, the memory, the sub agents and the model routing, the extensions (hooks, MCP,
249
+ plugins, skills), the terminal interface, the web interface and the evaluation harness — is new.
250
+
251
+ mini-swe-agent itself is a research project of the SWE-agent team. If you found that work helpful,
252
+ please consider citing the [SWE-agent paper](https://arxiv.org/abs/2405.15793) in your work:
253
+
254
+ ```bibtex
255
+ @inproceedings{yang2024sweagent,
256
+ title={{SWE}-agent: Agent-Computer Interfaces Enable Automated Software Engineering},
257
+ author={John Yang and Carlos E Jimenez and Alexander Wettig and Kilian Lieret and Shunyu Yao and Karthik R Narasimhan and Ofir Press},
258
+ booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems},
259
+ year={2024},
260
+ url={https://arxiv.org/abs/2405.15793}
261
+ }
262
+ ```
@@ -0,0 +1,177 @@
1
+ # The coding agent
2
+
3
+ > 中文版:[README_zh.md](https://github.com/sds819/coder-agent/blob/main/README_zh.md)
4
+
5
+ [![Docs](https://img.shields.io/badge/Docs-green?style=for-the-badge&logo=materialformkdocs&logoColor=white)](https://github.com/sds819/coder-agent/tree/main/docs)
6
+
7
+ `coder` is an interactive coding agent: it reads the code, writes the code, runs
8
+ the commands and tells you what it changed. It runs in the terminal **and** in
9
+ the browser, and it is a library too.
10
+
11
+ ```bash
12
+ pip install coder-agent
13
+ cd my-project
14
+
15
+ coder # the terminal interface
16
+ coder web # the same agent in the browser
17
+ coder eval path/to/suite # run a task suite against the agent
18
+ ```
19
+
20
+ The package is on PyPI. To follow the repository instead:
21
+ `pip install "coder-agent @ git+https://github.com/sds819/coder-agent"`.
22
+
23
+ ## What it does
24
+
25
+ **Tools.** Fourteen built-ins: `read`, `write`, `edit`, `multi_edit` and `apply_patch` to change
26
+ files; `glob`, `grep` and `ls` to find code; `bash`, `bash_output` and `bash_kill` to run commands
27
+ (also in the background); `todo_write` to keep a task list; `task` to spawn a sub agent; `skill`
28
+ to load a skill.
29
+
30
+ **Permissions.** Five modes: `default` (everything that changes something asks), `acceptEdits`
31
+ (writes pass, the rest still asks), `plan` and `readonly` (nothing is changed) and `bypass`
32
+ (nothing asks). Rules live in `~/.coderagent/rules.yaml` (yours) and `.coderagent/rules.yaml`
33
+ (the project's); a `deny` always wins over an `allow`.
34
+
35
+ **Sessions.** Every session has an event log, so it can be resumed (`coder --resume`), forked
36
+ (`/fork`), rewound (`/rewind`) and exported (`coder export`). The trace of a session can be sent to
37
+ an OpenTelemetry collector. A session started in the browser can be continued in the terminal, and
38
+ the other way round.
39
+
40
+ **Context.** The conversation is compacted when it reaches 80% of the budget; the summary keeps
41
+ the goal, the findings, the decisions, the files that were touched and the open questions. Before
42
+ a round ends, three gates are checked in order: a `Stop` hook, the `verify.commands` of the
43
+ project, and the output schema.
44
+
45
+ **Memory.** The project writes `.coderagent/memory/*.md`, your own preferences live in
46
+ `~/.coderagent/CLAUDE.md`, and `/init` writes an `AGENTS.md` for the repository.
47
+
48
+ **Subagents and routing.** `task` spawns a sub agent (`code-explorer`, `verifier`, `refactorer`
49
+ and your own). Different jobs can use different models: `main`, `cheap`, `strong`, `summarize`,
50
+ `reflect` and `review`.
51
+
52
+ **Extensions.** Hooks on nine events (`PreToolUse`, `PostToolUse`, `UserPromptSubmit`, `Stop`,
53
+ `SessionStart`, `SessionEnd`, `SubagentStop`, `PreCompact`, `PostCompact`), MCP servers, plugins,
54
+ skills and custom slash commands.
55
+
56
+ **Sandboxes.** The commands can run in `local`, `docker`, `singularity`, `bubblewrap`, `contree`
57
+ or SWE-ReX (`swerex_docker`, `swerex_modal`).
58
+
59
+ **35 slash commands** in the terminal (`/model`, `/mode`, `/plan`, `/review`, `/diff`, `/cost`,
60
+ `/context`, `/compact`, `/resume`, `/fork`, `/agents`, `/permissions`, `/hooks`, `/sandbox`, …)
61
+ — the same set in the browser.
62
+
63
+ **The web interface.** `coder web` serves a chat page, a settings page (model and permissions as
64
+ forms), a file tree and the diffs of the session. Every action is a plain HTTP call, so the
65
+ browser can be driven by a script too; the API docs are at `/api/docs`.
66
+
67
+ **Evaluation.** `coder eval <suite>` runs a task suite against the agent and reports what the
68
+ agent did with every task; `coder eval-compare` diffs two reports and names the regressions.
69
+
70
+ > [!WARNING]
71
+ > The browser interface has **no authentication**: everybody who can reach the port can drive the agent and run
72
+ > shell commands in the working directory. Keep it on `127.0.0.1`.
73
+
74
+ ## The model
75
+
76
+ The models go through [litellm](https://github.com/BerriAI/litellm), so every model that litellm
77
+ supports works — with the name of the provider in front of it (`anthropic/…`, `deepseek/…`). The
78
+ key of the provider is read from the environment (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, …) or
79
+ from `~/.coderagent/.env`.
80
+
81
+ ```bash
82
+ coder -m deepseek/deepseek-flash --task "fix the failing test"
83
+ ```
84
+
85
+ The model is configured in the terminal, in the terminal interface and in the browser. All three
86
+ write the same file, `~/.coderagent/config.yaml`:
87
+
88
+ ```bash
89
+ coder model # show the settings in effect
90
+ coder model --name deepseek/deepseek-flash --max-retries 3 # write them down
91
+ coder model --test # try the model out
92
+ ```
93
+
94
+ The try-out and the writing are two steps: `--test` never writes anything, and the writing never
95
+ waits for the try-out — a configuration that does not work yet is worth writing down, to be fixed
96
+ later. The terminal interface has the same three steps (`/model name=… base=… key=… retries=…`,
97
+ `/model --test`, `/model --save`), and the settings page of the browser has a **Test** button next
98
+ to **Save**.
99
+
100
+ **Pictures.** When a picture is sent to a model nobody knows anything about, the agent asks it
101
+ once — with a picture of one color and the question what color it is — and writes the answer to
102
+ your own configuration file. The next time the configuration says it, and the model is never asked
103
+ again. A model that cannot take pictures is refused the turn, instead of making up an answer.
104
+
105
+ ## Read more
106
+
107
+ In `docs/usage`:
108
+
109
+ * [Quick start](docs/usage/coderagent_quickstart.md) — install it, set the model, run the first round (中文)
110
+ * [Everything `coder` can do](docs/usage/coderagent_features.md) — one page, every feature, with the errors you may hit
111
+ * [The web interface](docs/usage/coderagent_web.md) — the chat page, the settings page, the HTTP API, the security model
112
+ * [The commands](docs/usage/coderagent_commands.md) — every slash command
113
+ * [Sub agents](docs/usage/coderagent_subagents.md) — sub agents and their own models
114
+ * [Hooks](docs/usage/coderagent_hooks.md) — hooks on nine events
115
+ * [The sandbox](docs/usage/coderagent_sandbox.md) — where the commands run
116
+ * [The eval harness](docs/usage/coderagent_eval.md) — task suites, reports, comparisons
117
+ * [Model routing](docs/usage/coderagent_routing.md) — which model does which job
118
+ * [Memory](docs/usage/coderagent_memory.md) — project memory and your preferences
119
+ * [Skills](docs/usage/coderagent_skills.md) — the skills the agent may load
120
+ * [Plugins](docs/usage/coderagent_plugins.md) — the plugins that extend it
121
+ * [MCP servers](docs/usage/coderagent_mcp.md) — the tools other servers bring
122
+ * [The trace of a session](docs/usage/coderagent_export.md) — export the trace, send it to a collector
123
+
124
+ And if you want to know how it was designed, see `docs/design`:
125
+
126
+ * [The architecture](docs/design/coding-agent-architecture.md) — the layers, the modules, the interfaces, the key decisions
127
+ * [The design logic](docs/design/coderagent-design-logic.md) — why it grew this way: the load-bearing decisions, the invariants, the trade-offs
128
+ * [The questions and their answers](docs/design/coderagent-answers.md) — 41 questions about the agent, answered
129
+
130
+ ## Questions
131
+
132
+ * **Something is broken.** [Open a bug report](https://github.com/sds819/coder-agent/issues/new/choose) — the
133
+ template asks for the error message and how to reproduce it. The log of the last session is in
134
+ `~/.coderagent/sessions` (`coder export` writes it out).
135
+ * **An error you do not understand.** [Everything `coder` can do](docs/usage/coderagent_features.md) has a
136
+ "When something goes wrong" section for every part of the agent.
137
+ * **A question.** [Open a question](https://github.com/sds819/coder-agent/issues/new/choose) or ask on
138
+ [Discord](https://discord.gg/AVEFbBn2rH).
139
+
140
+ <a id="chinese"></a>
141
+
142
+ ### 中文
143
+
144
+ 这份 README 有中文版,文档也有中文的:
145
+
146
+ * [中文版 README](https://github.com/sds819/coder-agent/blob/main/README_zh.md)——整篇中文的这份介绍
147
+ * [快速开始](docs/usage/coderagent_quickstart.md)——装上、配置模型、跑第一轮
148
+ * [功能](docs/usage/coderagent_features_zh.md)——一页看完所有功能,外加你可能撞到的报错
149
+ * [网页版](docs/usage/coderagent_web_zh.md)——聊天页、设置页、HTTP API、安全模型
150
+ * [命令](docs/usage/coderagent_commands_zh.md)——全部 slash 命令
151
+ * [子 agent](docs/usage/coderagent_subagents_zh.md)——子 agent 和模型路由
152
+ * [Hooks](docs/usage/coderagent_hooks_zh.md)——九个事件上的 hook
153
+ * [沙箱](docs/usage/coderagent_sandbox_zh.md)——命令跑在哪里
154
+ * [评测](docs/usage/coderagent_eval_zh.md)——任务集、报告和对比
155
+
156
+ ## Where it comes from
157
+
158
+ This agent is built on the ideas of [mini-swe-agent](https://github.com/SWE-agent/mini-swe-agent),
159
+ the minimal AI software engineering agent: the linear history of the messages, the commands run
160
+ through one `bash` tool, the model layer of litellm, and the sandbox environments (Docker,
161
+ Singularity, bubblewrap, contree, SWE-ReX) that came with it. Everything else — the agent loop,
162
+ the tool system and the permission layer, the sessions and the event log, the context engine and
163
+ its compaction, the memory, the sub agents and the model routing, the extensions (hooks, MCP,
164
+ plugins, skills), the terminal interface, the web interface and the evaluation harness — is new.
165
+
166
+ mini-swe-agent itself is a research project of the SWE-agent team. If you found that work helpful,
167
+ please consider citing the [SWE-agent paper](https://arxiv.org/abs/2405.15793) in your work:
168
+
169
+ ```bibtex
170
+ @inproceedings{yang2024sweagent,
171
+ title={{SWE}-agent: Agent-Computer Interfaces Enable Automated Software Engineering},
172
+ author={John Yang and Carlos E Jimenez and Alexander Wettig and Kilian Lieret and Shunyu Yao and Karthik R Narasimhan and Ofir Press},
173
+ booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems},
174
+ year={2024},
175
+ url={https://arxiv.org/abs/2405.15793}
176
+ }
177
+ ```