Makepad Code (editor layout, selection, sidebar, early yield), the EN/ZH Translator with voice, Weather with a generated offline forecast, Amp playing its offline library, and fixes across the other apps and examples. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3.4 KiB
3.4 KiB
Makepad Code
Makepad Code is a local coding agent in a native window. It talks to a model on your own AI Hub (or this machine's weights), works inside one folder, and shows what it does: every file it reads, every command it runs, every edit as a diff you can accept hunk by hunk.
cargo run --release -p makepad-app-code -- ~/my-project
cargo run --release -p makepad-app-code -- ~/my-project --approve ask --context 32768
- The folder is the sandbox: file tools cannot leave it. Approval modes are
ask(everything asks),allowlist(reads and safe commands run, the rest ask; the default) andauto. - Edits show their diff before anything is written. Tick hunks with 1-9,
yapplies the ticked ones,aaccepts all,nrejects. run_commandoutput streams into a terminal block while it runs;Escinterrupts.- A plan panel follows the model's todo list; sub-agents show as lanes.
- Sessions are saved under
~/.makepad/code/sessionsand listed in the left rail; click one to resume it. Old turns fold into a summary as the context fills (the heat strip in the status bar shows what fills it). - The file tree lists lazily; the editor pane (
Cmd/Ctrl+E) follows the files the agent reads and edits and opens the ones you click. Cmd/Ctrl+Kopens the command palette: new session, resume, approval mode, context size, panes, dark or light theme, interrupt, copy last answer.
In a terminal
makepad-code is the same agent without a window: a plain binary (no GPU, no
display) for ssh sessions, a bare console, or a machine whose desktop is down.
cargo build --release -p makepad-code
makepad-code # in the project folder, or: makepad-code ~/my-project
makepad-code --approve ask --context 32k --resume last
makepad-code -p "list the files here and count lines in README" # one task, then exit
- The prompt sits at the bottom; the conversation scrolls above it in the
terminal's own scrollback. Answers stream in; each tool is one row (state,
title, summary);
run_commandoutput streams under its row, dim, and folds to its last lines when done; edits show a coloured diff. - Approvals ask inline:
[y] allow [a] this session [r] this repo [n] denyfor commands; for edits1-9tick hunks,yapplies the ticked ones,aall,nrejects. Questions from the agent get an answer prompt. EscorCtrl+Cinterrupts the current step;Ctrl+D, orCtrl+Ctwice at an empty prompt, exits.Alt+Enteror a trailing\adds a line; pastes stay one prompt; Up/Down walk the history (~/.makepad/code/cli-history)./new,/resume [N|ID],/sessions,/model [32k | kv q8|f16],/approve ask|allowlist|auto,/ref PATH,/clear,/help,/exit.@pathin a request attaches that file;Tabcompletes it from the repo.- Sessions are the window's (
~/.makepad/code/sessions): one started in the window resumes here, and back. The model is elected as in the window: this machine's hub, then a LAN node. - Without a terminal (pipes, scripts) it reads lines from stdin: requests,
then answers to approvals.
NO_COLORor a pipe gives plain text;TERM=linuxor a non-UTF-8 locale gives ASCII marks.
Layout: agent/ (crate makepad-code-agent) is the core (no UI types:
tools, approvals, context, sessions, sub-agents, the file index), src/ui and
src/ide the window, cli/ (crate makepad-code) the terminal.
CODE_MOCK=1 runs either front end against a scripted agent without a model.