wrencode 0.1.4__py3-none-any.whl
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.
- wrencode-0.1.4.dist-info/METADATA +263 -0
- wrencode-0.1.4.dist-info/RECORD +5 -0
- wrencode-0.1.4.dist-info/WHEEL +4 -0
- wrencode-0.1.4.dist-info/entry_points.txt +2 -0
- wrencode.py +1576 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wrencode
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: A minimal agentic coding assistant in a single Python file
|
|
5
|
+
Project-URL: Homepage, https://github.com/almostly/wrencode
|
|
6
|
+
Project-URL: Repository, https://github.com/almostly/wrencode
|
|
7
|
+
Project-URL: Issues, https://github.com/almostly/wrencode/issues
|
|
8
|
+
Author: Denis Burakov
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
Keywords: agent,ai,anthropic,cli,coding-assistant,llm,mlx,ollama,openai
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Provides-Extra: mlx
|
|
18
|
+
Requires-Dist: mlx-lm; extra == 'mlx'
|
|
19
|
+
Provides-Extra: transformers
|
|
20
|
+
Requires-Dist: torch; extra == 'transformers'
|
|
21
|
+
Requires-Dist: transformers; extra == 'transformers'
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# 🐦 WrenCode
|
|
25
|
+
|
|
26
|
+
A minimal agentic coding assistant in a single Python file.
|
|
27
|
+
|
|
28
|
+
Named after Harold Wren - the alias of a genius who built a superintelligent AI and operated quietly in the background.
|
|
29
|
+
|
|
30
|
+
-----
|
|
31
|
+
|
|
32
|
+
## What it is
|
|
33
|
+
|
|
34
|
+
WrenCode is a lightweight alternative to Claude Code. It runs a tool-calling agent loop locally or via API, giving an LLM the ability to read, write, and edit files, search codebases, and run shell commands - enough to autonomously navigate and modify a real project.
|
|
35
|
+
|
|
36
|
+
Where Claude Code is the batteries-included tool, WrenCode is the **"understand and own your agent" tool**: the entire agent loop fits in one readable file, runs against local or hosted models, and is yours to hack.
|
|
37
|
+
|
|
38
|
+
## Backends
|
|
39
|
+
|
|
40
|
+
On first run WrenCode asks you to pick a backend and saves the choice to
|
|
41
|
+
`~/.wrencode/config.json`. Run `wrencode --configure` any time to change it.
|
|
42
|
+
Set `BACKEND` (and the matching API key) in the environment to override the
|
|
43
|
+
saved choice, e.g. for CI.
|
|
44
|
+
|
|
45
|
+
|Backend |Description |Availability |
|
|
46
|
+
|--------------|----------------------------------------|----------------------|
|
|
47
|
+
|`anthropic` |Claude via Anthropic API |binary + source |
|
|
48
|
+
|`openai` |GPT models via OpenAI API |binary + source |
|
|
49
|
+
|`openrouter` |Any model via OpenRouter |binary + source |
|
|
50
|
+
|`ollama` |Local models via a running `ollama serve`|binary + source |
|
|
51
|
+
|`local` |Local proxy via Anthropic-compatible API|binary + source |
|
|
52
|
+
|`transformers`|HuggingFace Transformers (CPU/MPS/GPU) |source install only |
|
|
53
|
+
|`mlx` |Apple Silicon via MLX |source install, macOS |
|
|
54
|
+
|
|
55
|
+
The standalone binary can't bundle the heavy ML stack, so the local-weights
|
|
56
|
+
backends (`mlx`, `transformers`) are only offered when running from source.
|
|
57
|
+
|
|
58
|
+
## Tools
|
|
59
|
+
|
|
60
|
+
The agent has access to seven tools:
|
|
61
|
+
|
|
62
|
+
- **read** - read a file with line numbers, or list a directory
|
|
63
|
+
- **write** - write content to a file
|
|
64
|
+
- **edit** - replace a unique string in a file
|
|
65
|
+
- **glob** - find files by pattern, sorted by modification time
|
|
66
|
+
- **grep** - search files for a regex pattern using `rg` when available, falling back to `grep`
|
|
67
|
+
- **bash** - run a shell command with timeout and streaming output
|
|
68
|
+
- **task** - delegate a self-contained subtask to a fresh subagent (its own context, same tools) that returns only its final result
|
|
69
|
+
|
|
70
|
+
All file operations are sandboxed to the workspace root by default.
|
|
71
|
+
|
|
72
|
+
### Subagents
|
|
73
|
+
|
|
74
|
+
The `task` tool runs a nested agent loop on a fresh message history, so the
|
|
75
|
+
parent's context only grows by the returned summary — useful for context-heavy
|
|
76
|
+
subtasks. Recursion is capped by `WRENCODE_MAX_SUBAGENT_DEPTH` (default 2), and
|
|
77
|
+
each subagent round is bounded. For autonomous subagent runs, enable
|
|
78
|
+
`--yes` / `WRENCODE_AUTO_APPROVE` so sub-tool calls don't block on confirmation.
|
|
79
|
+
|
|
80
|
+
## Installation
|
|
81
|
+
|
|
82
|
+
### Option 1: Standalone binary (recommended)
|
|
83
|
+
|
|
84
|
+
Run the guided installer:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
curl -fsSL https://raw.githubusercontent.com/almostly/wrencode/main/install.sh | sh
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
It detects your OS/arch, downloads the matching binary from the latest GitHub
|
|
91
|
+
Release, and installs it to `~/.local/bin` (no sudo). Override the location with
|
|
92
|
+
`WRENCODE_INSTALL_DIR`, or pin a release with `WRENCODE_VERSION`:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
curl -fsSL https://raw.githubusercontent.com/almostly/wrencode/main/install.sh \
|
|
96
|
+
| WRENCODE_INSTALL_DIR=/usr/local/bin WRENCODE_VERSION=0.1.3 sh
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Or download and run it locally:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
curl -fsSL https://raw.githubusercontent.com/almostly/wrencode/main/install.sh -o install.sh
|
|
103
|
+
chmod +x install.sh
|
|
104
|
+
./install.sh
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Manual install (fallback): download the right binary from GitHub Releases, make it executable, and move it into your `PATH`.
|
|
108
|
+
|
|
109
|
+
macOS Apple Silicon:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
curl -L https://github.com/almostly/wrencode/releases/latest/download/wrencode-macos-arm64 -o wrencode
|
|
113
|
+
chmod +x wrencode
|
|
114
|
+
sudo mv wrencode /usr/local/bin/wrencode
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
macOS Intel:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
curl -L https://github.com/almostly/wrencode/releases/latest/download/wrencode-macos-x64 -o wrencode
|
|
121
|
+
chmod +x wrencode
|
|
122
|
+
sudo mv wrencode /usr/local/bin/wrencode
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Linux x64:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
curl -L https://github.com/almostly/wrencode/releases/latest/download/wrencode-linux-x64 -o wrencode
|
|
129
|
+
chmod +x wrencode
|
|
130
|
+
sudo mv wrencode /usr/local/bin/wrencode
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Option 2: Run from source
|
|
134
|
+
|
|
135
|
+
Single file, standard library only (except the backend you choose).
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
git clone https://github.com/almostly/wrencode
|
|
139
|
+
cd wrencode
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
For MLX (Mac Silicon):
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
pip install mlx-lm
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
For Anthropic:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
pip install anthropic # not required - uses urllib directly
|
|
152
|
+
export ANTHROPIC_API_KEY=your_key
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
For OpenAI:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
export OPENAI_API_KEY=your_key
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
For OpenRouter:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
export OPENROUTER_API_KEY=your_key
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
For HuggingFace Transformers:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
pip install transformers torch
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Usage
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Standalone binary — prompts for a backend on first run
|
|
177
|
+
wrencode
|
|
178
|
+
|
|
179
|
+
# Re-pick the backend at any time
|
|
180
|
+
wrencode --configure
|
|
181
|
+
|
|
182
|
+
# Or from source — also prompts on first run
|
|
183
|
+
python3 wrencode.py
|
|
184
|
+
|
|
185
|
+
# Anthropic Claude
|
|
186
|
+
BACKEND=anthropic python3 wrencode.py
|
|
187
|
+
|
|
188
|
+
# OpenAI
|
|
189
|
+
BACKEND=openai MODEL=gpt-4o python3 wrencode.py
|
|
190
|
+
|
|
191
|
+
# OpenRouter
|
|
192
|
+
BACKEND=openrouter MODEL=anthropic/claude-3-haiku python3 wrencode.py
|
|
193
|
+
|
|
194
|
+
# Ollama (needs `ollama serve` running and the model pulled)
|
|
195
|
+
BACKEND=ollama MODEL=llama3.2 python3 wrencode.py
|
|
196
|
+
|
|
197
|
+
# HuggingFace model
|
|
198
|
+
BACKEND=transformers MODEL=deburky/gpt-oss-claude-code python3 wrencode.py
|
|
199
|
+
|
|
200
|
+
# Local proxy
|
|
201
|
+
BACKEND=local LOCAL_PORT=8082 python3 wrencode.py
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Releasing binaries
|
|
205
|
+
|
|
206
|
+
Binaries are built automatically by GitHub Actions when you push a version tag:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
git tag v0.1.0
|
|
210
|
+
git push origin v0.1.0
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
This publishes release assets:
|
|
214
|
+
- `wrencode-linux-x64`
|
|
215
|
+
- `wrencode-macos-x64`
|
|
216
|
+
- `wrencode-macos-arm64`
|
|
217
|
+
|
|
218
|
+
## Slash Commands
|
|
219
|
+
|
|
220
|
+
|Command |Description |
|
|
221
|
+
|--------------|----------------------------------------------|
|
|
222
|
+
|`/help` |Show available commands |
|
|
223
|
+
|`/c` |Clear conversation history |
|
|
224
|
+
|`/compact` |Summarize history to reduce context (mlx only)|
|
|
225
|
+
|`/q` or `exit`|Quit |
|
|
226
|
+
|
|
227
|
+
## Environment Variables
|
|
228
|
+
|
|
229
|
+
|Variable |Default |Description |
|
|
230
|
+
|-----------------------------|-----------------------|----------------------------------|
|
|
231
|
+
|`BACKEND` |chooser/saved config |Override the saved inference backend|
|
|
232
|
+
|`MODEL` |backend-dependent |Model path or ID |
|
|
233
|
+
|`WRENCODE_CONFIG_DIR` |`~/.wrencode` |Dir for `config.json` (saved backend/key)|
|
|
234
|
+
|`WRENCODE_WORKSPACE` |cwd |Root directory for file operations|
|
|
235
|
+
|`WRENCODE_HISTORY_FILE` |`~/.wrencode/history.json`|Conversation history file path |
|
|
236
|
+
|`WRENCODE_UNRESTRICTED_PATHS`|`0` |Allow paths outside workspace |
|
|
237
|
+
|`WRENCODE_AUTO_APPROVE` |`0` |Skip y/N confirmation for writes/commands (headless; also `--yes`)|
|
|
238
|
+
|`WRENCODE_MAX_SUBAGENT_DEPTH`|`2` |Max nested subagent recursion depth (`task` tool)|
|
|
239
|
+
|`MAX_TOKENS` |`4096` |Max tokens per response |
|
|
240
|
+
|`MAX_READ_BYTES` |`4MB` |Max file size to read |
|
|
241
|
+
|`MAX_READ_LINES` |`800` |Max lines returned per read |
|
|
242
|
+
|`GREP_MAX_MATCHES` |`80` |Max grep results |
|
|
243
|
+
|`BASH_TIMEOUT` |`120` |Shell command timeout in seconds |
|
|
244
|
+
|`MAX_TOOL_OUTPUT_CHARS` |`48000` |Max tool output before truncation |
|
|
245
|
+
|`GLOB_SKIP_DIRS` |`.git,node_modules,...`|Directories to skip in glob |
|
|
246
|
+
|`OPENROUTER_API_KEY` |- |OpenRouter API key |
|
|
247
|
+
|`OPENAI_API_KEY` |- |OpenAI API key |
|
|
248
|
+
|`ANTHROPIC_API_KEY` |- |Anthropic API key |
|
|
249
|
+
|`LOCAL_API_KEY` |`local` |Local proxy API key |
|
|
250
|
+
|`LOCAL_PORT` |`8082` |Local proxy port |
|
|
251
|
+
|`OLLAMA_HOST` |`http://localhost:11434`|Ollama server base URL |
|
|
252
|
+
|
|
253
|
+
## History
|
|
254
|
+
|
|
255
|
+
Conversation history is persisted to `~/.wrencode/history.json` by default. It is restored automatically on next launch.
|
|
256
|
+
|
|
257
|
+
To override the history file location, set `WRENCODE_HISTORY_FILE` to a custom path.
|
|
258
|
+
|
|
259
|
+
To clear history: use `/c` in the session, or delete `~/.wrencode/history.json` (or your override path).
|
|
260
|
+
|
|
261
|
+
## License
|
|
262
|
+
|
|
263
|
+
MIT - Copyright 2026 Denis Burakov.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
wrencode.py,sha256=nYoSprcfcDpCB4nBApvuGKEbh7BS9dk8mxXLgrvc0Sw,58905
|
|
2
|
+
wrencode-0.1.4.dist-info/METADATA,sha256=StxaopUuiVazrn-DPFTmpgJtJ1XbzuhE8UQFBzjXc6k,9681
|
|
3
|
+
wrencode-0.1.4.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
4
|
+
wrencode-0.1.4.dist-info/entry_points.txt,sha256=8iFBbPoRgMeA0Cu6MGS1eEmCx3rm6pvThTLhaQTqp38,43
|
|
5
|
+
wrencode-0.1.4.dist-info/RECORD,,
|