The CLI, headless & CI
Everything you’ve done with Cursor so far happened inside the editor. The Agent sidebar, Tab, the mode dropdown, the diff you review before you commit - all of it assumed you were sitting in front of the desktop app, watching the loop run. That’s the right surface for the work this course has been about: turning budgetcli from someone else’s weekend project into something you trust, one reviewed change at a time. But it’s not the only surface, and the reason this chapter comes near the end is the editorial bet this course makes: the editor is the product, the terminal is the export. That’s a framing call, not a Cursor claim - Cursor’s own CLI docs present the terminal agent as a standalone tool (“Cursor CLI lets you interact with AI agents directly from your terminal”), with no hierarchy between editor and CLI. This chapter takes budgetcli’s agent out of the room. The same agent you’ve driven by hand all course, run from a script with nobody watching: a one-shot categoriser check you can pipe into other commands, a CI step that reviews every push, a Cloud Agent you spawn over HTTP, and an AI reviewer sitting on your pull requests. The thread running through all of it is the one you set in Permissions, auto-run & the sandbox: the moment you take yourself out of the loop, the approval prompt you half-ignore in the editor is gone, and whatever containment you settled in advance is the only thing standing between an unattended agent and your real financial data.
The five moves of this chapter
Section titled “The five moves of this chapter”- Install & headless - the one-line script, the
agentvscursor-agentnaming wrinkle, then-pruns the agent as a command: output formats,--force, the key that authenticates a script, and the global-only config rule - Install, headless, auth, and the config constraint - Slash commands - the version-sensitive built-in set the terminal agent answers to, and why it’s a different list from the editor’s
/picker - The CLI’s own slash commands - CI - the same headless command on a runner, keyed by a secret and gated on an exit code so a bad import fails the workflow and can block merges through branch protection - Wiring it into CI
- Cloud Agents and Bugbot - the agent off your hardware entirely: isolated VMs spawned over REST, and a reviewer that lands on every PR - Cloud Agents and Bugbot
The arc runs outward, one step at a time, away from your keyboard. The first two lessons hand you the binary and the one flag that changes its nature - a program that finishes the job and exits. The third is the short detour back to the interactive surface, because you’ll spend real time there too. The fourth puts the command somewhere it runs without being asked, and the fifth takes it off your machine altogether, to a VM you don’t own and a pull request you didn’t open. Track one thing as you go: at every step outward, the flags get less load-bearing and where the agent runs gets more. That trade is the whole chapter.