ucode-agent 1.5.0 → 1.7.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.
Files changed (71) hide show
  1. package/README.md +399 -327
  2. package/package.json +6 -1
  3. package/skills/ui-ux/SKILL.md +2 -2
  4. package/src/core/doctor.js +122 -0
  5. package/src/core/livelog.js +113 -0
  6. package/src/core/loop.js +2105 -1659
  7. package/src/core/provider.js +93 -10
  8. package/src/core/stuck.js +269 -0
  9. package/src/core/tests.js +86 -0
  10. package/src/tools/blocks.js +117 -0
  11. package/src/tools/browser.js +121 -59
  12. package/src/tools/cache.js +105 -0
  13. package/src/tools/deploy.js +283 -0
  14. package/src/tools/files.js +91 -8
  15. package/src/tools/index.js +634 -495
  16. package/src/tools/rename.js +157 -0
  17. package/src/tools/scaffold.js +85 -6
  18. package/src/tools/shell.js +799 -701
  19. package/src/tools/symbols.js +218 -0
  20. package/src/tools/types.js +179 -0
  21. package/src/ui/activity.js +203 -0
  22. package/src/ui/plain.js +22 -3
  23. package/src/ui/screen.js +65 -19
  24. package/src/ui/theme.js +5 -1
  25. package/templates/blocks/app-shell.tsx +81 -0
  26. package/templates/blocks/data-table.tsx +117 -0
  27. package/templates/blocks/empty-state.tsx +41 -0
  28. package/templates/blocks/page-header.tsx +27 -0
  29. package/templates/blocks/stat-cards.tsx +46 -0
  30. package/templates/next-shadcn/TEMPLATE.md +53 -9
  31. package/templates/next-shadcn/_package-lock.json +1335 -148
  32. package/templates/next-shadcn/components.json +1 -1
  33. package/templates/next-shadcn/next.config.ts +2 -1
  34. package/templates/next-shadcn/package.json +4 -2
  35. package/templates/next-shadcn/presets/citrus.json +77 -0
  36. package/templates/next-shadcn/presets/graphite.json +77 -0
  37. package/templates/next-shadcn/presets/grove.json +77 -0
  38. package/templates/next-shadcn/presets/ocean.json +78 -0
  39. package/templates/next-shadcn/presets/sunset.json +77 -0
  40. package/templates/next-shadcn/presets/violet.json +77 -0
  41. package/templates/next-shadcn/src/components/ui/accordion.tsx +80 -0
  42. package/templates/next-shadcn/src/components/ui/alert-dialog.tsx +34 -22
  43. package/templates/next-shadcn/src/components/ui/avatar.tsx +7 -4
  44. package/templates/next-shadcn/src/components/ui/badge.tsx +15 -18
  45. package/templates/next-shadcn/src/components/ui/button.tsx +12 -3
  46. package/templates/next-shadcn/src/components/ui/calendar.tsx +1 -0
  47. package/templates/next-shadcn/src/components/ui/checkbox.tsx +6 -2
  48. package/templates/next-shadcn/src/components/ui/collapsible.tsx +33 -0
  49. package/templates/next-shadcn/src/components/ui/command.tsx +1 -2
  50. package/templates/next-shadcn/src/components/ui/dialog.tsx +34 -26
  51. package/templates/next-shadcn/src/components/ui/dropdown-menu.tsx +115 -114
  52. package/templates/next-shadcn/src/components/ui/hover-card.tsx +43 -0
  53. package/templates/next-shadcn/src/components/ui/input-group.tsx +2 -4
  54. package/templates/next-shadcn/src/components/ui/input.tsx +1 -2
  55. package/templates/next-shadcn/src/components/ui/label.tsx +6 -2
  56. package/templates/next-shadcn/src/components/ui/popover.tsx +27 -28
  57. package/templates/next-shadcn/src/components/ui/progress.tsx +11 -63
  58. package/templates/next-shadcn/src/components/ui/radio-group.tsx +43 -0
  59. package/templates/next-shadcn/src/components/ui/scroll-area.tsx +6 -6
  60. package/templates/next-shadcn/src/components/ui/select.tsx +55 -64
  61. package/templates/next-shadcn/src/components/ui/separator.tsx +6 -3
  62. package/templates/next-shadcn/src/components/ui/sheet.tsx +35 -26
  63. package/templates/next-shadcn/src/components/ui/slider.tsx +58 -0
  64. package/templates/next-shadcn/src/components/ui/switch.tsx +3 -2
  65. package/templates/next-shadcn/src/components/ui/table.tsx +115 -0
  66. package/templates/next-shadcn/src/components/ui/tabs.tsx +16 -8
  67. package/templates/next-shadcn/src/components/ui/toggle-group.tsx +89 -0
  68. package/templates/next-shadcn/src/components/ui/toggle.tsx +46 -0
  69. package/templates/next-shadcn/src/components/ui/tooltip.tsx +24 -33
  70. package/templates/next-shadcn/src/lib/utils.ts +6 -1
  71. package/ucode.js +8 -1
package/README.md CHANGED
@@ -1,327 +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
- **Parallel workers.** When a build splits into parts that touch different files
129
- — the API route, the upload component, the results view — the model hands them
130
- to up to three workers that build at the same time, each line in the transcript
131
- tagged with the worker's name. File writes take turns so two never collide.
132
-
133
- **Installs that start early.** The moment a `package.json` with dependencies is
134
- written, its install starts in the background while the rest of the app is
135
- still being written. An install the model asks for later waits for that one
136
- instead of running twice, and anything run in that folder waits for it too.
137
-
138
- **It looks at what it built.** `look_at_app` opens the running app in a real
139
- browser — the Edge or Chrome already on your machine, so there is nothing extra
140
- to download at 375px and 1440px. It reports console errors, failed requests,
141
- content that spills off a phone screen, broken images and unlabeled controls,
142
- saves screenshots to `.ucode/screenshots`, and has Nemotron Nano Omni review them
143
- the way a designer would. The model fixes what it finds before calling the app
144
- done.
145
-
146
- **Errors fixed before you see them.** When the model says it is done, ucode
147
- type-checks every file it changed — `tsc --noEmit` for TypeScript projects,
148
- a syntax check for JavaScript and Python and hands any errors back to fix,
149
- up to three rounds.
150
-
151
- **A plan you can see.** For longer jobs the model keeps a short checklist, shown
152
- as one line: `plan 2/5 ✓ Scaffold · Upload · Score dial · Findings · ○ Polish`.
153
-
154
- **It knows the project before it asks.** Each turn starts with a map of every
155
- file and the names each code file exports, so the model goes straight to the
156
- right file instead of searching for it.
157
-
158
- **Project memory.** `UCODE.md` in a project and `~/.ucode/UCODE.md` for how you
159
- like to work everywhere is read at the start of every turn. `/remember <note>`
160
- adds a line to it.
161
-
162
- **Edits that never guess.** `edit_file` matches exactly once or it fails, and
163
- when it fails it says *why*. It tolerates what does not matter — tabs against
164
- spaces, a different indent depth, Windows line endings — and re-indents the
165
- replacement to fit the file, but a match found twice is still refused.
166
- `edit_files` changes several files in one call, and writes none of them if any
167
- edit fails.
168
-
169
- **Diffs with real line numbers.** Removed lines are numbered where they were,
170
- added lines where they now are. Numbers you can jump to, not decoration.
171
-
172
- **Live commentary.** `● Listing src`, `● Running npm test` what it is doing,
173
- as it does it, named after the file or command rather than the tool.
174
-
175
- **Two modes.** Build edits and runs. Plan reads and researches with the writing
176
- tools withheld, which is stronger than asking a model nicely. `ctrl+b` swaps
177
- them; the chip inside the input box says which is live.
178
-
179
- **Sessions.** Everything is on disk under `~/.ucode/sessions`, saved after every
180
- step. `/resume` lists them with what each one was actually about, the ones from
181
- this folder first. Press `d` twice on one to delete it the list stays open, so
182
- clearing out several is quick or `/session delete 2,5`.
183
-
184
- **It updates itself.** Each launch checks npm in the background and, if there is
185
- a newer version, installs it while you work. The next launch is the new one.
186
- Set `UCODE_NO_UPDATE=1` to turn that off.
187
-
188
- **A context window that folds rather than forgets.** Past 75% the oldest turns
189
- are summarised instead of dropped, never cutting between a tool call and its
190
- result. The full history stays on disk regardless.
191
-
192
- **Screenshots.** Mention a `.png` in your message and it gets attached.
193
-
194
- ## Skills
195
-
196
- A skill is a folder with a `SKILL.md`: frontmatter, then instructions. Only the
197
- names and one-line descriptions go into the system prompt a body is pulled in
198
- when it is wanted, so the prompt stays the same size however many you add.
199
-
200
- | Skill | For |
201
- | --- | --- |
202
- | `ui-ux` | interfaces: direction, tokens, layout, states, motion, accessibility |
203
- | `build-app` | going from nothing to something running, and proving it runs |
204
- | `debug` | finding the real cause instead of the first plausible one |
205
- | `code-review` | reviewing a change the way a careful colleague would |
206
- | `write-tests` | tests that fail for the right reason |
207
- | `ai-features` | model-backed features: prompts with rules, validated JSON, images, failure handling |
208
- | `security` | secrets, auth, ownership checks, injection, XSS, CSRF, SSRF, uploads |
209
- | `performance` | measure first, find the real bottleneck, prove the win with numbers |
210
- | `refactor` | change the shape of code without changing what it does |
211
-
212
- **Every skill loads itself** when the request calls for it an app pulls in
213
- `ui-ux` and `build-app`, "it crashes" pulls in `debug`, an AI feature pulls in
214
- `ai-features`, an API key pulls in `security` so the whole skill is in
215
- context before the model takes its first step. Waiting for the model to decide it needs design guidance means
216
- finding out it did not after the app is built.
217
-
218
- Add your own in `.ucode/skills/<name>/SKILL.md` inside a project. A project
219
- skill shadows a built-in of the same name. Give it an `auto:` line and it loads
220
- itself too:
221
-
222
- ```markdown
223
- ---
224
- name: house-style
225
- description: How we write services here.
226
- auto: endpoint, handler, migration
227
- ---
228
-
229
- Everything after the frontmatter is the instruction.
230
- ```
231
-
232
- ## Commands
233
-
234
- | | |
235
- | --- | --- |
236
- | `/help` | the list |
237
- | `/model` | show the models and switch `/models` does the same |
238
- | `/resume` | pick up an earlier conversation `/session`, `/sessions` too |
239
- | `/session delete 2,5` | delete saved conversations by number (or `d d` in the list) |
240
- | `/new` | save this one and start fresh |
241
- | `/remember <note>` | add a standing note to this project's `UCODE.md` |
242
- | `/skills` | what it knows how to do, and what is loaded |
243
- | `/search <query>` | look something up on the web |
244
- | `/copy` | last reply to the clipboard |
245
- | `/clear` | clear the screen, keep the conversation |
246
- | `/exit` | save and quit |
247
-
248
- `ctrl+b` plan/build · `esc` stops a running turn · `ctrl+d` quits ·
249
- `↑ ↓` scroll the conversation, or walk history once you are typing ·
250
- `tab` completes a command
251
-
252
- ## Options
253
-
254
- ```
255
- ucode [options]
256
-
257
- -m, --model <id> which model to use
258
- -C, --cwd <dir> work in another directory
259
- --plan start in plan mode
260
- --debug print stack traces when something breaks
261
- -v, --version print the version
262
- -h, --help the above
263
- ```
264
-
265
- ## Configuration
266
-
267
- | | |
268
- | --- | --- |
269
- | `~/.ucode/.env` | `UCODE_API_KEY`, and `TAVILY_API_KEY` for web search |
270
- | `~/.ucode/sessions/` | one JSON per conversation |
271
- | `.ucode/skills/` | skills belonging to a project |
272
- | `UCODE.md` | project memory, read every turn |
273
- | `~/.ucode/UCODE.md` | your own standing instructions, for every project |
274
-
275
- Environment overrides: `UCODE_MODEL`, `UCODE_WORKER_MODEL` (a faster model for
276
- parallel workers), `UCODE_WORKER_STEPS`, `UCODE_MAX_CONTEXT_TOKENS`,
277
- `UCODE_MAX_STEPS`, `UCODE_MAX_TOOL_OUTPUT`, `UCODE_REQUEST_TIMEOUT_MS`,
278
- `UCODE_BASE_URL`, `UCODE_NO_UPDATE`.
279
-
280
- Web search needs a Tavily key free, 1000 searches a month, no card. Without
281
- one, ucode answers from what it knows and says that it could not check.
282
-
283
- ## How it is put together
284
-
285
- ```
286
- ucode.js the command: arguments in, Agent out
287
- src/core/loop.js the agent loop, the system prompt, the slash commands
288
- src/core/provider.js the only file that knows which provider answers
289
- src/core/history.js sessions on disk
290
- src/core/window.js folding a long conversation to fit
291
- src/core/skills.js loading skills, and deciding which load themselves
292
- src/core/context.js the project map and project memory
293
- src/core/failure.js one error shape: what, why, what next
294
- src/tools/ the eleven tools, plus their shared plumbing
295
- src/ui/screen.js the full-screen interface
296
- src/ui/plain.js the same interface for when there is no terminal
297
- src/ui/theme.js colour, boxes, and the string maths behind both
298
- ```
299
-
300
- Everything above `provider.js` speaks one small provider-neutral message
301
- format. Moving to another host means rewriting that one file.
302
-
303
- Every failure carries three things — what was attempted, what failed, and what
304
- to do next — so no screen ever has to fall back on a stack trace. Tool failures
305
- are handed to the model as text instead, which is why they read like
306
- instructions.
307
-
308
- ## Development
309
-
310
- ```bash
311
- git clone https://github.com/sppideey/ucode-agent
312
- cd ucode-agent
313
- npm install
314
- npm link # puts `ucode` on PATH, pointing at this checkout
315
- npm test
316
- ```
317
-
318
- `npm link` matters while developing: it symlinks the global command to your
319
- working copy, so an edit is live on the next launch. Running
320
- `npm i -g ucode-agent` replaces that with a frozen copy from the registry and
321
- your edits stop taking effect.
322
-
323
- The tests need no network and no framework — `node test/run.js` runs them all.
324
-
325
- ## Licence
326
-
327
- 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.