ucode-agent 1.6.0 → 1.8.0

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.
package/README.md CHANGED
@@ -1,379 +1,399 @@
1
- # ucode
2
-
3
- A coding agent that lives in your terminal. It reads your code, edits it, runs
4
- your commands, and keeps every conversation on disk. It runs on NVIDIA and
5
- Cohere models, all of them free.
6
-
7
- It opens on a quiet screen — the name, the place to type, and the version in the
8
- corner:
9
-
10
- ```
11
- ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗
12
- ██║ ██║██╔════╝██╔═══██╗██╔══██╗██╔════╝
13
- ██║ ██║██║ ██║ ██║██║ ██║█████╗
14
- ██║ ██║██║ ██║ ██║██║ ██║██╔══╝
15
- ╚██████╔╝╚██████╗╚██████╔╝██████╔╝███████╗
16
- ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
17
-
18
-
19
- ╭──────────────────────────────────────────────────────────────────────────────╮
20
- │ › Ask anything… │
21
- │ │
22
- │ ◆ Build · North Mini Code 0% │
23
- ╰──────────────────────────────────────────────────────────────────────────────╯
24
-
25
-
26
- v1.2.0
27
- ```
28
-
29
- and once you are talking, each message you send is boxed in the same blue as
30
- the input, so your own words are easy to find in a long session:
31
-
32
- ```
33
- ╭──────────────────────────────────────────────────────────────────────────────────╮
34
- │ › build a notes dashboard │
35
- ╰──────────────────────────────────────────────────────────────────────────────────╯
36
- ● Writing index.html
37
- └ created · 148 lines
38
- 1 + <!doctype html>
39
- 2 + <html lang="en">
40
- … 146 more lines
41
- ● Running npm run dev
42
- └ ready · http://localhost:3000 · PID 4812
43
-
44
- ╭──────────────────────────────────────────────────────────────────────────────────╮
45
- │ › now add a dark mode toggle │
46
- │ │
47
- │ ◆ Build · North Mini Code 4% │
48
- ╰──────────────────────────────────────────────────────────────────────────────────╯
49
- ```
50
-
51
- The status sits inside the input box because it describes the thing you are
52
- typing into. Three facts, no more: the live mode, the answering model, and how
53
- full the context window is. The percentage turns amber at 75%, which is where
54
- older turns start being folded into a summary. While a turn is running the
55
- middle of that row carries the spinner and the way out of it, and hands the
56
- space straight back when it finishes.
57
-
58
- ## Install
59
-
60
- ```bash
61
- npm i -g ucode-agent
62
- ```
63
-
64
- Then put a key where it will survive upgrades:
65
-
66
- ```bash
67
- mkdir -p ~/.ucode
68
- echo "UCODE_API_KEY=sk-or-..." > ~/.ucode/.env
69
- ```
70
-
71
- Keys are free at [openrouter.ai/keys](https://openrouter.ai/keys). A `.env` in
72
- the project you are working on wins over that one, and a real environment
73
- variable wins over both.
74
-
75
- Then, in any project:
76
-
77
- ```bash
78
- ucode
79
- ```
80
-
81
- Needs Node 22 or newer.
82
-
83
- ## The models
84
-
85
- Five, and no picker full of names nobody recognises. NVIDIA and Cohere both
86
- serve capable models free, and both handle tool calling
87
- properly, which is the thing an agent actually depends on.
88
-
89
- | Model | Context | For |
90
- | --- | --- | --- |
91
- | Nemotron 3 Ultra | 1M | deepest reasoning, slowest to first token |
92
- | Nemotron 3.5 Lightning | 1M | the same enormous window, answers much sooner |
93
- | Nemotron 3 Super | 262k | strong all-rounder, quick to start |
94
- | Nemotron 3 Nano Omni | 256k | small, fast, reasoning tuned |
95
- | **North Mini Code** ★ | 256k | the default — built for code and interface work, quick to answer |
96
-
97
- `/model` shows them and switches. `ucode -m cohere/north-mini-code:free`
98
- starts on one.
99
-
100
- North Mini Code is the default: it is built for code and interfaces, which is most
101
- of what ucode is asked to do, and it answers far sooner than the big reasoning
102
- models. Switch to Ultra when a problem needs the million-token window more than
103
- the speed.
104
-
105
- **A busy model never stops a build.** Free endpoints are shared, and "too many
106
- requests" is routine. ucode waits it out with growing pauses, and if the model
107
- stays busy it carries on with the next one — North Mini Code, then Nemotron 3.5
108
- Lightning, Super, Ultra — from exactly where it was, and tells you it switched.
109
- If every model is busy at once it waits a minute and goes round again. Your
110
- chosen model gets another go a few minutes later.
111
-
112
- ## What it does
113
-
114
- **Fifteen tools.** `create_app`, `read_file`, `read_files`, `write_file`,
115
- `batch_write`, `edit_file`, `multi_edit`, `edit_files`, `list_dir`, `glob`,
116
- `grep`, `run_command`, `run_commands`, `look_at_app`, `web_search`. Read-only calls run in parallel,
117
- and start the moment the model finishes writing them — while the rest of its
118
- reply is still arriving. Anything that writes runs on its own, in order.
119
-
120
- **Apps start from a ready-made starter.** Setting up Next.js and shadcn from
121
- nothing takes about four minutes — `create-next-app` and the shadcn CLI measured
122
- at 116s and 130s plus a dozen model round trips. `create_app` copies ucode's
123
- starter instead: Next.js 16, TypeScript, Tailwind 4, shadcn/ui with 25 common
124
- components, light/dark mode, toasts and a considered theme, already known to
125
- build. The copy takes under a second, and its install runs in the background
126
- while the model writes the first components.
127
-
128
- **Built to be fast, and measured.** A traced build of a small Next.js app went
129
- from 17 minutes and 116 model steps to about 6 minutes and 25 steps, by fixing
130
- where the time actually went:
131
-
132
- - Edits return the file as it now stands, so the model does not re-read it.
133
- - Files written more than a few steps ago stop being re-sent in full; the
134
- conversation stays small, so every step answers faster.
135
- - A file-write whose JSON is malformed — a missing comma, an unescaped quote in
136
- the code, raw line breaks is repaired instead of thrown away with all its
137
- output.
138
- - Every write is parsed on the spot, so a syntax error comes back in the same
139
- step rather than a minute later from a failed build.
140
- - A failed build that is missing a component or package says exactly which
141
- command fixes it.
142
- - The starter is the shadcn models already know (Radix), so the code they write
143
- compiles the first time.
144
-
145
- `UCODE_TRACE=1` writes every model call and tool, with its duration, to
146
- `~/.ucode/trace.jsonl`.
147
-
148
- **Deploy in one line.** Say "deploy it", or type `/deploy [folder]`, and the app
149
- goes live on Vercel. ucode picks a short project name that fits the app and is
150
- free (`food-iq`, else `food-iq-app`…), copies the app's `.env` keys to Vercel as
151
- encrypted variables, refuses code with a secret written into it (and says how to
152
- move it to a server route), and gives you the link. Deploying again updates the
153
- same link. Needs a token from vercel.com/account/tokens in `~/.ucode/.env` as
154
- `VERCEL_TOKEN=...`.
155
-
156
- **A look for every app.** `create_app` takes a design preset ocean, grove,
157
- sunset, graphite, violet or citrus — each a full light and dark palette with its
158
- own font, so apps stop looking like the same default blue.
159
-
160
- **It notices when it is going round in circles.** The same failing edit, an edit
161
- that changes nothing, or a build failing on the same errors three times gets a
162
- firm, specific note; if that does not work, the turn moves to another model.
163
-
164
- **It never dies at the daily limit.** When the free daily limit runs out mid-build,
165
- ucode counts down to the reset and carries on by itself.
166
-
167
- **You can see it working.** The status row shows the current step with a light
168
- sweeping across it, the step count and the time, and each answer ends with
169
- `✓ Done in 6m 12s · 25 steps`. When a dev server comes up, the app opens in your
170
- browser (`UCODE_OPEN=0` turns that off).
171
-
172
- **`/stats` and `ucode doctor`.** `/stats` shows the session's time, steps, tokens,
173
- files and builds. `ucode doctor` (or `/doctor`) checks Node, npm, git, the API
174
- key and today's free requests left, the browser, the Vercel token and the
175
- version, with the fix for anything wrong.
176
-
177
- **Parallel workers.** When a build splits into parts that touch different files
178
- the API route, the upload component, the results view — the model hands them
179
- to up to three workers that build at the same time, each line in the transcript
180
- tagged with the worker's name. File writes take turns so two never collide.
181
-
182
- **Installs that start early.** The moment a `package.json` with dependencies is
183
- written, its install starts in the background while the rest of the app is
184
- still being written. An install the model asks for later waits for that one
185
- instead of running twice, and anything run in that folder waits for it too.
186
-
187
- **It looks at what it built.** `look_at_app` opens the running app in a real
188
- browser the Edge or Chrome already on your machine, so there is nothing extra
189
- to download at 375px and 1440px. It reports console errors, failed requests,
190
- content that spills off a phone screen, broken images and unlabeled controls,
191
- saves screenshots to `.ucode/screenshots`, and has Nemotron Nano Omni review them
192
- the way a designer would. The model fixes what it finds before calling the app
193
- done. Both widths load at once, and the designer review the slow part — runs
194
- on the first look at an app in each request and is skipped, not waited on, when
195
- the vision model is busy. The look after the fixes re-runs only the fast checks:
196
- a few seconds.
197
-
198
- **Errors fixed before you see them.** When the model says it is done, ucode
199
- type-checks every file it changed `tsc --noEmit` for TypeScript projects,
200
- a syntax check for JavaScript and Python and hands any errors back to fix,
201
- up to three rounds.
202
-
203
- **A plan you can see.** For longer jobs the model keeps a short checklist, shown
204
- as one line: `plan 2/5 ✓ Scaffold · Upload · Score dial · ○ Findings · ○ Polish`.
205
-
206
- **It knows the project before it asks.** Each turn starts with a map of every
207
- file and the names each code file exports, so the model goes straight to the
208
- right file instead of searching for it.
209
-
210
- **Project memory.** `UCODE.md` in a project and `~/.ucode/UCODE.md` for how you
211
- like to work everywhere is read at the start of every turn. `/remember <note>`
212
- adds a line to it.
213
-
214
- **Edits that never guess.** `edit_file` matches exactly once or it fails, and
215
- when it fails it says *why*. It tolerates what does not matter tabs against
216
- spaces, a different indent depth, Windows line endings — and re-indents the
217
- replacement to fit the file, but a match found twice is still refused.
218
- `edit_files` changes several files in one call, and writes none of them if any
219
- edit fails.
220
-
221
- **Diffs with real line numbers.** Removed lines are numbered where they were,
222
- added lines where they now are. Numbers you can jump to, not decoration.
223
-
224
- **Live commentary.** `● Listing src`, `● Running npm test` what it is doing,
225
- as it does it, named after the file or command rather than the tool.
226
-
227
- **Two modes.** Build edits and runs. Plan reads and researches with the writing
228
- tools withheld, which is stronger than asking a model nicely. `ctrl+b` swaps
229
- them; the chip inside the input box says which is live.
230
-
231
- **Sessions.** Everything is on disk under `~/.ucode/sessions`, saved after every
232
- step. `/resume` lists them with what each one was actually about, the ones from
233
- this folder first. Press `d` twice on one to delete it — the list stays open, so
234
- clearing out several is quick or `/session delete 2,5`.
235
-
236
- **It updates itself.** Each launch checks npm in the background and, if there is
237
- a newer version, installs it while you work. The next launch is the new one.
238
- Set `UCODE_NO_UPDATE=1` to turn that off.
239
-
240
- **A context window that folds rather than forgets.** Past 75% the oldest turns
241
- are summarised instead of dropped, never cutting between a tool call and its
242
- result. The full history stays on disk regardless.
243
-
244
- **Screenshots.** Mention a `.png` in your message and it gets attached.
245
-
246
- ## Skills
247
-
248
- A skill is a folder with a `SKILL.md`: frontmatter, then instructions. Only the
249
- names and one-line descriptions go into the system prompt a body is pulled in
250
- when it is wanted, so the prompt stays the same size however many you add.
251
-
252
- | Skill | For |
253
- | --- | --- |
254
- | `ui-ux` | interfaces: direction, tokens, layout, states, motion, accessibility |
255
- | `build-app` | going from nothing to something running, and proving it runs |
256
- | `debug` | finding the real cause instead of the first plausible one |
257
- | `code-review` | reviewing a change the way a careful colleague would |
258
- | `write-tests` | tests that fail for the right reason |
259
- | `ai-features` | model-backed features: prompts with rules, validated JSON, images, failure handling |
260
- | `security` | secrets, auth, ownership checks, injection, XSS, CSRF, SSRF, uploads |
261
- | `performance` | measure first, find the real bottleneck, prove the win with numbers |
262
- | `refactor` | change the shape of code without changing what it does |
263
-
264
- **Every skill loads itself** when the request calls for it an app pulls in
265
- `ui-ux` and `build-app`, "it crashes" pulls in `debug`, an AI feature pulls in
266
- `ai-features`, an API key pulls in `security` — so the whole skill is in
267
- context before the model takes its first step. Waiting for the model to decide it needs design guidance means
268
- finding out it did not after the app is built.
269
-
270
- Add your own in `.ucode/skills/<name>/SKILL.md` inside a project. A project
271
- skill shadows a built-in of the same name. Give it an `auto:` line and it loads
272
- itself too:
273
-
274
- ```markdown
275
- ---
276
- name: house-style
277
- description: How we write services here.
278
- auto: endpoint, handler, migration
279
- ---
280
-
281
- Everything after the frontmatter is the instruction.
282
- ```
283
-
284
- ## Commands
285
-
286
- | | |
287
- | --- | --- |
288
- | `/help` | the list |
289
- | `/model` | show the models and switch — `/models` does the same |
290
- | `/resume` | pick up an earlier conversation `/session`, `/sessions` too |
291
- | `/session delete 2,5` | delete saved conversations by number (or `d d` in the list) |
292
- | `/new` | save this one and start fresh |
293
- | `/remember <note>` | add a standing note to this project's `UCODE.md` |
294
- | `/skills` | what it knows how to do, and what is loaded |
295
- | `/search <query>` | look something up on the web |
296
- | `/copy` | last reply to the clipboard |
297
- | `/clear` | clear the screen, keep the conversation |
298
- | `/exit` | save and quit |
299
-
300
- `ctrl+b` plan/build · `esc` stops a running turn · `ctrl+d` quits ·
301
- `↑ ↓` scroll the conversation, or walk history once you are typing ·
302
- `tab` completes a command
303
-
304
- ## Options
305
-
306
- ```
307
- ucode [options]
308
-
309
- -m, --model <id> which model to use
310
- -C, --cwd <dir> work in another directory
311
- --plan start in plan mode
312
- --debug print stack traces when something breaks
313
- -v, --version print the version
314
- -h, --help the above
315
- ```
316
-
317
- ## Configuration
318
-
319
- | | |
320
- | --- | --- |
321
- | `~/.ucode/.env` | `UCODE_API_KEY`, and `TAVILY_API_KEY` for web search |
322
- | `~/.ucode/sessions/` | one JSON per conversation |
323
- | `.ucode/skills/` | skills belonging to a project |
324
- | `UCODE.md` | project memory, read every turn |
325
- | `~/.ucode/UCODE.md` | your own standing instructions, for every project |
326
-
327
- Environment overrides: `UCODE_MODEL`, `UCODE_WORKER_MODEL` (a faster model for
328
- parallel workers), `UCODE_WORKER_STEPS`, `UCODE_MAX_CONTEXT_TOKENS`,
329
- `UCODE_MAX_STEPS`, `UCODE_MAX_TOOL_OUTPUT`, `UCODE_REQUEST_TIMEOUT_MS`,
330
- `UCODE_BASE_URL`, `UCODE_NO_UPDATE`.
331
-
332
- Web search needs a Tavily key — free, 1000 searches a month, no card. Without
333
- one, ucode answers from what it knows and says that it could not check.
334
-
335
- ## How it is put together
336
-
337
- ```
338
- ucode.js the command: arguments in, Agent out
339
- src/core/loop.js the agent loop, the system prompt, the slash commands
340
- src/core/provider.js the only file that knows which provider answers
341
- src/core/history.js sessions on disk
342
- src/core/window.js folding a long conversation to fit
343
- src/core/skills.js loading skills, and deciding which load themselves
344
- src/core/context.js the project map and project memory
345
- src/core/failure.js one error shape: what, why, what next
346
- src/tools/ the eleven tools, plus their shared plumbing
347
- src/ui/screen.js the full-screen interface
348
- src/ui/plain.js the same interface for when there is no terminal
349
- src/ui/theme.js colour, boxes, and the string maths behind both
350
- ```
351
-
352
- Everything above `provider.js` speaks one small provider-neutral message
353
- format. Moving to another host means rewriting that one file.
354
-
355
- Every failure carries three things — what was attempted, what failed, and what
356
- to do next — so no screen ever has to fall back on a stack trace. Tool failures
357
- are handed to the model as text instead, which is why they read like
358
- instructions.
359
-
360
- ## Development
361
-
362
- ```bash
363
- git clone https://github.com/sppideey/ucode-agent
364
- cd ucode-agent
365
- npm install
366
- npm link # puts `ucode` on PATH, pointing at this checkout
367
- npm test
368
- ```
369
-
370
- `npm link` matters while developing: it symlinks the global command to your
371
- working copy, so an edit is live on the next launch. Running
372
- `npm i -g ucode-agent` replaces that with a frozen copy from the registry and
373
- your edits stop taking effect.
374
-
375
- The tests need no network and no framework `node test/run.js` runs them all.
376
-
377
- ## Licence
378
-
379
- ISC. Made with ❤️ by om dixit.
1
+ # ucode
2
+
3
+ A coding agent that lives in your terminal. It reads your code, edits it, runs
4
+ your commands, and keeps every conversation on disk. It runs on NVIDIA and
5
+ Cohere models, all of them free.
6
+
7
+ It opens on a quiet screen — the name, the place to type, and the version in the
8
+ corner:
9
+
10
+ ```
11
+ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗
12
+ ██║ ██║██╔════╝██╔═══██╗██╔══██╗██╔════╝
13
+ ██║ ██║██║ ██║ ██║██║ ██║█████╗
14
+ ██║ ██║██║ ██║ ██║██║ ██║██╔══╝
15
+ ╚██████╔╝╚██████╗╚██████╔╝██████╔╝███████╗
16
+ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
17
+
18
+
19
+ ╭──────────────────────────────────────────────────────────────────────────────╮
20
+ │ › Ask anything… │
21
+ │ │
22
+ │ ◆ Build · North Mini Code 0% │
23
+ ╰──────────────────────────────────────────────────────────────────────────────╯
24
+
25
+
26
+ v1.2.0
27
+ ```
28
+
29
+ and once you are talking, each message you send is boxed in the same blue as
30
+ the input, so your own words are easy to find in a long session:
31
+
32
+ ```
33
+ ╭──────────────────────────────────────────────────────────────────────────────────╮
34
+ │ › build a notes dashboard │
35
+ ╰──────────────────────────────────────────────────────────────────────────────────╯
36
+ ● Writing index.html
37
+ └ created · 148 lines
38
+ 1 + <!doctype html>
39
+ 2 + <html lang="en">
40
+ … 146 more lines
41
+ ● Running npm run dev
42
+ └ ready · http://localhost:3000 · PID 4812
43
+
44
+ ╭──────────────────────────────────────────────────────────────────────────────────╮
45
+ │ › now add a dark mode toggle │
46
+ │ │
47
+ │ ◆ Build · North Mini Code 4% │
48
+ ╰──────────────────────────────────────────────────────────────────────────────────╯
49
+ ```
50
+
51
+ The status sits inside the input box because it describes the thing you are
52
+ typing into. Three facts, no more: the live mode, the answering model, and how
53
+ full the context window is. The percentage turns amber at 75%, which is where
54
+ older turns start being folded into a summary. While a turn is running the
55
+ middle of that row carries the spinner and the way out of it, and hands the
56
+ space straight back when it finishes.
57
+
58
+ ## Install
59
+
60
+ ```bash
61
+ npm i -g ucode-agent
62
+ ```
63
+
64
+ Then put a key where it will survive upgrades:
65
+
66
+ ```bash
67
+ mkdir -p ~/.ucode
68
+ echo "UCODE_API_KEY=sk-or-..." > ~/.ucode/.env
69
+ ```
70
+
71
+ Keys are free at [openrouter.ai/keys](https://openrouter.ai/keys). A `.env` in
72
+ the project you are working on wins over that one, and a real environment
73
+ variable wins over both.
74
+
75
+ Then, in any project:
76
+
77
+ ```bash
78
+ ucode
79
+ ```
80
+
81
+ Needs Node 22 or newer.
82
+
83
+ ## The models
84
+
85
+ Five, and no picker full of names nobody recognises. NVIDIA and Cohere both
86
+ serve capable models free, and both handle tool calling
87
+ properly, which is the thing an agent actually depends on.
88
+
89
+ | Model | Context | For |
90
+ | --- | --- | --- |
91
+ | Nemotron 3 Ultra | 1M | deepest reasoning, slowest to first token |
92
+ | Nemotron 3.5 Lightning | 1M | the same enormous window, answers much sooner |
93
+ | Nemotron 3 Super | 262k | strong all-rounder, quick to start |
94
+ | Nemotron 3 Nano Omni | 256k | small, fast, reasoning tuned |
95
+ | **North Mini Code** ★ | 256k | the default — built for code and interface work, quick to answer |
96
+
97
+ `/model` shows them and switches. `ucode -m cohere/north-mini-code:free`
98
+ starts on one.
99
+
100
+ North Mini Code is the default: it is built for code and interfaces, which is most
101
+ of what ucode is asked to do, and it answers far sooner than the big reasoning
102
+ models. Switch to Ultra when a problem needs the million-token window more than
103
+ the speed.
104
+
105
+ **A busy model never stops a build.** Free endpoints are shared, and "too many
106
+ requests" is routine. ucode waits it out with growing pauses, and if the model
107
+ stays busy it carries on with the next one — North Mini Code, then Nemotron 3.5
108
+ Lightning, Super, Ultra — from exactly where it was, and tells you it switched.
109
+ If every model is busy at once it waits a minute and goes round again. Your
110
+ chosen model gets another go a few minutes later.
111
+
112
+ ## What it does
113
+
114
+ **Twenty-one tools.** `create_app`, `read_file`, `read_files`, `write_file`,
115
+ `batch_write`, `edit_file`, `multi_edit`, `edit_files`, `rename_symbol`,
116
+ `find_symbol`, `outline`, `type_of`, `add_block`, `list_dir`, `glob`, `grep`,
117
+ `run_command`, `run_commands`, `look_at_app`, `web_search`, `deploy`. Read-only
118
+ calls run in parallel, and start the moment the model finishes writing them —
119
+ while the rest of its reply is still arriving. Anything that writes runs on its
120
+ own, in order.
121
+
122
+ **It asks rather than guesses.** `type_of` opens a language service on the
123
+ TypeScript the project itself has installed and gives back the exact signature,
124
+ the JSDoc, and where a thing is defined inferred types included. `find_symbol`
125
+ answers "where is this declared", which is the question `grep` is usually being
126
+ asked badly. `rename_symbol` renames by code shape, knowing where strings and
127
+ comments begin, because a find-and-replace that matched too much is the most
128
+ common broken edit.
129
+
130
+ **It checks itself as it goes.** After a change: an incremental type check that
131
+ answers in about a second rather than a cold minute, then the tests that reach
132
+ the files just changed, then anything the running dev server has complained
133
+ about since the last look. All three come back the way an error does, so the
134
+ model fixes them without being told.
135
+
136
+ **New apps are ready in seconds.** A starter installed once is kept and
137
+ hard-linked into the next app — the same files under another name, so it costs
138
+ no extra disk and skips the wait entirely.
139
+
140
+ **Apps start from a ready-made starter.** Setting up Next.js and shadcn from
141
+ nothing takes about four minutes — `create-next-app` and the shadcn CLI measured
142
+ at 116s and 130s plus a dozen model round trips. `create_app` copies ucode's
143
+ starter instead: Next.js 16, TypeScript, Tailwind 4, shadcn/ui with 25 common
144
+ components, light/dark mode, toasts and a considered theme, already known to
145
+ build. The copy takes under a second, and its install runs in the background
146
+ while the model writes the first components.
147
+
148
+ **Built to be fast, and measured.** A traced build of a small Next.js app went
149
+ from 17 minutes and 116 model steps to about 6 minutes and 25 steps, by fixing
150
+ where the time actually went:
151
+
152
+ - Edits return the file as it now stands, so the model does not re-read it.
153
+ - Files written more than a few steps ago stop being re-sent in full; the
154
+ conversation stays small, so every step answers faster.
155
+ - A file-write whose JSON is malformed — a missing comma, an unescaped quote in
156
+ the code, raw line breaks is repaired instead of thrown away with all its
157
+ output.
158
+ - Every write is parsed on the spot, so a syntax error comes back in the same
159
+ step rather than a minute later from a failed build.
160
+ - A failed build that is missing a component or package says exactly which
161
+ command fixes it.
162
+ - The starter is the shadcn models already know (Radix), so the code they write
163
+ compiles the first time.
164
+
165
+ `UCODE_TRACE=1` writes every model call and tool, with its duration, to
166
+ `~/.ucode/trace.jsonl`.
167
+
168
+ **Deploy in one line.** Say "deploy it", or type `/deploy [folder]`, and the app
169
+ goes live on Vercel. ucode picks a short project name that fits the app and is
170
+ free (`food-iq`, else `food-iq-app`…), copies the app's `.env` keys to Vercel as
171
+ encrypted variables, refuses code with a secret written into it (and says how to
172
+ move it to a server route), and gives you the link. Deploying again updates the
173
+ same link. Needs a token from vercel.com/account/tokens in `~/.ucode/.env` as
174
+ `VERCEL_TOKEN=...`.
175
+
176
+ **A look for every app.** `create_app` takes a design preset — ocean, grove,
177
+ sunset, graphite, violet or citrus — each a full light and dark palette with its
178
+ own font, so apps stop looking like the same default blue.
179
+
180
+ **It notices when it is going round in circles.** The same failing edit, an edit
181
+ that changes nothing, or a build failing on the same errors three times gets a
182
+ firm, specific note; if that does not work, the turn moves to another model.
183
+
184
+ **It never dies at the daily limit.** When the free daily limit runs out mid-build,
185
+ ucode counts down to the reset and carries on by itself.
186
+
187
+ **You can see it working.** The status row shows the current step with a light
188
+ sweeping across it, the step count and the time, and each answer ends with
189
+ `✓ Done in 6m 12s · 25 steps`. When a dev server comes up, the app opens in your
190
+ browser (`UCODE_OPEN=0` turns that off).
191
+
192
+ **`/stats` and `ucode doctor`.** `/stats` shows the session's time, steps, tokens,
193
+ files and builds. `ucode doctor` (or `/doctor`) checks Node, npm, git, the API
194
+ key and today's free requests left, the browser, the Vercel token and the
195
+ version, with the fix for anything wrong.
196
+
197
+ **Parallel workers.** When a build splits into parts that touch different files
198
+ the API route, the upload component, the results view the model hands them
199
+ to up to three workers that build at the same time, each line in the transcript
200
+ tagged with the worker's name. File writes take turns so two never collide.
201
+
202
+ **Installs that start early.** The moment a `package.json` with dependencies is
203
+ written, its install starts in the background while the rest of the app is
204
+ still being written. An install the model asks for later waits for that one
205
+ instead of running twice, and anything run in that folder waits for it too.
206
+
207
+ **It looks at what it built.** `look_at_app` opens the running app in a real
208
+ browser the Edge or Chrome already on your machine, so there is nothing extra
209
+ to download — at 375px and 1440px. It reports console errors, failed requests,
210
+ content that spills off a phone screen, broken images and unlabeled controls,
211
+ saves screenshots to `.ucode/screenshots`, and has Nemotron Nano Omni review them
212
+ the way a designer would. The model fixes what it finds before calling the app
213
+ done. Both widths load at once, and the designer review — the slow part — runs
214
+ on the first look at an app in each request and is skipped, not waited on, when
215
+ the vision model is busy. The look after the fixes re-runs only the fast checks:
216
+ a few seconds.
217
+
218
+ **Errors fixed before you see them.** When the model says it is done, ucode
219
+ type-checks every file it changed — `tsc --noEmit` for TypeScript projects,
220
+ a syntax check for JavaScript and Python — and hands any errors back to fix,
221
+ up to three rounds.
222
+
223
+ **A plan you can see.** For longer jobs the model keeps a short checklist, shown
224
+ as one line: `plan 2/5 ✓ Scaffold · Upload · Score dial · ○ Findings · ○ Polish`.
225
+
226
+ **It knows the project before it asks.** Each turn starts with a map of every
227
+ file and the names each code file exports, so the model goes straight to the
228
+ right file instead of searching for it.
229
+
230
+ **Project memory.** `UCODE.md` in a project — and `~/.ucode/UCODE.md` for how you
231
+ like to work everywhere — is read at the start of every turn. `/remember <note>`
232
+ adds a line to it.
233
+
234
+ **Edits that never guess.** `edit_file` matches exactly once or it fails, and
235
+ when it fails it says *why*. It tolerates what does not matter — tabs against
236
+ spaces, a different indent depth, Windows line endings and re-indents the
237
+ replacement to fit the file, but a match found twice is still refused.
238
+ `edit_files` changes several files in one call, and writes none of them if any
239
+ edit fails.
240
+
241
+ **Diffs with real line numbers.** Removed lines are numbered where they were,
242
+ added lines where they now are. Numbers you can jump to, not decoration.
243
+
244
+ **Live commentary.** `● Listing src`, `● Running npm test` — what it is doing,
245
+ as it does it, named after the file or command rather than the tool.
246
+
247
+ **Two modes.** Build edits and runs. Plan reads and researches with the writing
248
+ tools withheld, which is stronger than asking a model nicely. `ctrl+b` swaps
249
+ them; the chip inside the input box says which is live.
250
+
251
+ **Sessions.** Everything is on disk under `~/.ucode/sessions`, saved after every
252
+ step. `/resume` lists them with what each one was actually about, the ones from
253
+ this folder first. Press `d` twice on one to delete it — the list stays open, so
254
+ clearing out several is quick or `/session delete 2,5`.
255
+
256
+ **It updates itself.** Each launch checks npm in the background and, if there is
257
+ a newer version, installs it while you work. The next launch is the new one.
258
+ Set `UCODE_NO_UPDATE=1` to turn that off.
259
+
260
+ **A context window that folds rather than forgets.** Past 75% the oldest turns
261
+ are summarised instead of dropped, never cutting between a tool call and its
262
+ result. The full history stays on disk regardless.
263
+
264
+ **Screenshots.** Mention a `.png` in your message and it gets attached.
265
+
266
+ ## Skills
267
+
268
+ A skill is a folder with a `SKILL.md`: frontmatter, then instructions. Only the
269
+ names and one-line descriptions go into the system prompt — a body is pulled in
270
+ when it is wanted, so the prompt stays the same size however many you add.
271
+
272
+ | Skill | For |
273
+ | --- | --- |
274
+ | `ui-ux` | interfaces: direction, tokens, layout, states, motion, accessibility |
275
+ | `build-app` | going from nothing to something running, and proving it runs |
276
+ | `debug` | finding the real cause instead of the first plausible one |
277
+ | `code-review` | reviewing a change the way a careful colleague would |
278
+ | `write-tests` | tests that fail for the right reason |
279
+ | `ai-features` | model-backed features: prompts with rules, validated JSON, images, failure handling |
280
+ | `security` | secrets, auth, ownership checks, injection, XSS, CSRF, SSRF, uploads |
281
+ | `performance` | measure first, find the real bottleneck, prove the win with numbers |
282
+ | `refactor` | change the shape of code without changing what it does |
283
+
284
+ **Every skill loads itself** when the request calls for it — an app pulls in
285
+ `ui-ux` and `build-app`, "it crashes" pulls in `debug`, an AI feature pulls in
286
+ `ai-features`, an API key pulls in `security` — so the whole skill is in
287
+ context before the model takes its first step. Waiting for the model to decide it needs design guidance means
288
+ finding out it did not after the app is built.
289
+
290
+ Add your own in `.ucode/skills/<name>/SKILL.md` inside a project. A project
291
+ skill shadows a built-in of the same name. Give it an `auto:` line and it loads
292
+ itself too:
293
+
294
+ ```markdown
295
+ ---
296
+ name: house-style
297
+ description: How we write services here.
298
+ auto: endpoint, handler, migration
299
+ ---
300
+
301
+ Everything after the frontmatter is the instruction.
302
+ ```
303
+
304
+ ## Commands
305
+
306
+ | | |
307
+ | --- | --- |
308
+ | `/help` | the list |
309
+ | `/model` | show the models and switch — `/models` does the same |
310
+ | `/resume` | pick up an earlier conversation — `/session`, `/sessions` too |
311
+ | `/session delete 2,5` | delete saved conversations by number (or `d d` in the list) |
312
+ | `/new` | save this one and start fresh |
313
+ | `/remember <note>` | add a standing note to this project's `UCODE.md` |
314
+ | `/skills` | what it knows how to do, and what is loaded |
315
+ | `/search <query>` | look something up on the web |
316
+ | `/copy` | last reply to the clipboard |
317
+ | `/clear` | clear the screen, keep the conversation |
318
+ | `/exit` | save and quit |
319
+
320
+ `ctrl+b` plan/build · `esc` stops a running turn · `ctrl+d` quits ·
321
+ `↑ ↓` scroll the conversation, or walk history once you are typing ·
322
+ `tab` completes a command
323
+
324
+ ## Options
325
+
326
+ ```
327
+ ucode [options]
328
+
329
+ -m, --model <id> which model to use
330
+ -C, --cwd <dir> work in another directory
331
+ --plan start in plan mode
332
+ --debug print stack traces when something breaks
333
+ -v, --version print the version
334
+ -h, --help the above
335
+ ```
336
+
337
+ ## Configuration
338
+
339
+ | | |
340
+ | --- | --- |
341
+ | `~/.ucode/.env` | `UCODE_API_KEY`, and `TAVILY_API_KEY` for web search |
342
+ | `~/.ucode/sessions/` | one JSON per conversation |
343
+ | `.ucode/skills/` | skills belonging to a project |
344
+ | `UCODE.md` | project memory, read every turn |
345
+ | `~/.ucode/UCODE.md` | your own standing instructions, for every project |
346
+
347
+ Environment overrides: `UCODE_MODEL`, `UCODE_WORKER_MODEL` (a faster model for
348
+ parallel workers), `UCODE_WORKER_STEPS`, `UCODE_MAX_CONTEXT_TOKENS`,
349
+ `UCODE_MAX_STEPS`, `UCODE_MAX_TOOL_OUTPUT`, `UCODE_REQUEST_TIMEOUT_MS`,
350
+ `UCODE_BASE_URL`, `UCODE_NO_UPDATE`.
351
+
352
+ Web search needs a Tavily key free, 1000 searches a month, no card. Without
353
+ one, ucode answers from what it knows and says that it could not check.
354
+
355
+ ## How it is put together
356
+
357
+ ```
358
+ ucode.js the command: arguments in, Agent out
359
+ src/core/loop.js the agent loop, the system prompt, the slash commands
360
+ src/core/provider.js the only file that knows which provider answers
361
+ src/core/history.js sessions on disk
362
+ src/core/window.js folding a long conversation to fit
363
+ src/core/skills.js loading skills, and deciding which load themselves
364
+ src/core/context.js the project map and project memory
365
+ src/core/failure.js one error shape: what, why, what next
366
+ src/tools/ the twenty-one tools, plus their shared plumbing
367
+ src/ui/screen.js the full-screen interface
368
+ src/ui/plain.js the same interface for when there is no terminal
369
+ src/ui/theme.js colour, boxes, and the string maths behind both
370
+ ```
371
+
372
+ Everything above `provider.js` speaks one small provider-neutral message
373
+ format. Moving to another host means rewriting that one file.
374
+
375
+ Every failure carries three things what was attempted, what failed, and what
376
+ to do next — so no screen ever has to fall back on a stack trace. Tool failures
377
+ are handed to the model as text instead, which is why they read like
378
+ instructions.
379
+
380
+ ## Development
381
+
382
+ ```bash
383
+ git clone https://github.com/sppideey/ucode-agent
384
+ cd ucode-agent
385
+ npm install
386
+ npm link # puts `ucode` on PATH, pointing at this checkout
387
+ npm test
388
+ ```
389
+
390
+ `npm link` matters while developing: it symlinks the global command to your
391
+ working copy, so an edit is live on the next launch. Running
392
+ `npm i -g ucode-agent` replaces that with a frozen copy from the registry and
393
+ your edits stop taking effect.
394
+
395
+ The tests need no network and no framework — `node test/run.js` runs them all.
396
+
397
+ ## Licence
398
+
399
+ ISC. Made with ❤️ by om dixit.