Skip to content
ƒtsforgev0.52.0
19

Drive a change to green

2 min read

The interactive REPL is great for exploring. When you already know what “done” looks like, hand tsforge a task and a check, and it drives the change until the check passes, then exits.

Terminal window
tsforge "add input validation to the signup route" --accept "bun test"

--accept is any shell command. tsforge runs the model, applies edits, runs the check, feeds the failures back, and repeats until the command exits 0 or it stops making progress. The exit code is the check’s, so it drops straight into scripts and CI.

The check is the contract. The model doesn’t decide it’s finished; your command does. With --accept "bun test", “done” means your tests pass. With --accept "tsc --noEmit && bun test", it means types and tests pass. Underneath, tsforge layers its own strict gate (strict tsc, ESLint, and tests by default), so green reflects the compiler, the linter, and your tests all agreeing, not the model’s say-so.

Goal--accept
Make the suite passbun test
Types and teststsc --noEmit && bun test
One file’s tests (fast loop)bun test src/auth.test.ts
Lint clean toobun test && bun run lint

If it can’t get there, it stops with a clear status instead of churning forever. See When the gate fails.

By default the whole repo is editable. To fence the agent in, narrow it:

Terminal window
tsforge "refactor the parser" --files "src/parser/**" --accept "bun test"

Anything outside --files is read-only, a tripwire rather than a requirement.

Chat with your repo · The gate · Review your changes