Baton CLI
Let your agent launch other agents, open browser previews, and manage workspaces through the terminal.
baton is already available in Baton-managed terminals, including local, SSH, and Lima sessions. Keep Baton running and run these commands from a terminal inside your workspace. No separate CLI installation or MCP setup is needed.
Start with a prompt
Ask your agent: “Use the Baton CLI to open a new workspace and investigate the failing build.” It can discover the available commands with baton --help.
Launch an agent
Start a separate task in a new workspace:
baton launch "Investigate the failing build"
Git projects get a separate worktree and branch. Directory-backed projects share their directory.
To open another agent tab in the current workspace, add --here:
baton launch "Review these changes" --here
The new tab uses the same working directory, so both agents see the same files. Launches use your default agent. To choose another, list your configured agents with baton agent presets --json.
Open a browser preview
Start your development server first, then open its actual URL in Baton:
baton preview http://localhost:3000
Replace port 3000 with the port your server uses. This opens a preview; it does not start a server.
Update a workspace title
baton title "Build investigation" --description "Trace the failing build"
Use a title that describes the overall task so the workspace is easy to find in the sidebar.
Teach your agent the CLI
The optional Baton skill gives your agent instructions for these workflows. In Baton, open Settings → Integrations & MCP, find Baton CLI → Install Baton skill, and copy the install command. Run it in a local terminal and choose your agent in the installer.
The CLI works without the skill. For a guided tour, choose the Baton CLI demo from Baton's Tips menu.
CLI and MCP
Both let agents control Baton. The CLI works through terminal commands; MCP exposes native tools to agents with MCP support. Choose the interface that fits your agent. You can configure MCP separately in Settings.
More help
Run baton --help or baton launch --help for command options. If the command is unavailable, check that you are in a Baton-managed terminal. Baton also provides its absolute path in the BATON_CLI environment variable.
Commands automatically use the current workspace. If you need Baton-specific project or workspace metadata, or want to investigate an unexpected target, use baton context --json.
If an operation is disabled, check Settings → Integrations & MCP → MCP and CLI access.
Contact us if you need help getting connected.