Goal
Start a turn with one of eight coding agents, follow it live, redirect or stop it, and read the result from the CLI, the API, an SDK or MCP.Prerequisites
- A running computer, ideally with your code in
/workspace. - For each agent you want to use, either a sign-in to that agent on the computer or a model key saved with
stackshift computers secrets. - The StackShift CLI, or a computers key for the API, an SDK or MCP.
Workflow
1
List the agents and see which are signed in:
stackshift computers agent providers my-computer.2
Sign in once, if the agent uses a subscription:
stackshift computers agent login my-computer --provider claude. Or save a model key with stackshift computers secrets set and pass it with --secret.3
Start a turn:
stackshift computers agent prompt my-computer 'Fix the failing tests' --provider claude -f. The -f flag follows the agent as it works.4
Steer or stop it while it runs with
agent steer and agent interrupt.5
When the turn ends, read what it did with
stackshift computers agent result my-computer.What it is
A Computer can run a coding agent for you. You send a task, the agent works on the computer’s files and terminal, and StackShift records every step. You can watch live, add instructions while it works, stop it, and pick up the result afterwards, all without opening a terminal yourself. Each task is a turn. A turn belongs to a conversation, and you can send another turn to the same conversation to continue where the agent left off.From the CLI
The eight agents
Use--provider with one of these names. The default is claude. The first time you use an agent, StackShift installs it on the computer.
claude(Claude Code): signs in, or takes an Anthropic model key.codex(Codex): signs in, or takes an OpenAI model key.gemini(Gemini CLI): signs in, or takes a Gemini model key.opencode(OpenCode): signs in, or takes an Anthropic or OpenAI model key.cursor(Cursor): signs in only. It does not take a model key.copilot(GitHub Copilot): signs in, or takes an Anthropic or OpenAI model key.amp(Amp): signs in only. It does not take a model key.qwen(Qwen Code): signs in, or takes an Anthropic or OpenAI model key.stackshift computers agent providers COMPUTER(add--refreshto check again instead of using the last 30 seconds) shows, for every agent, whether it is installed, which version, whether it is signed in and by which method (subscriptionorapi_key), and which model keys it accepts.stackshift computers agent models COMPUTER --provider Xlists the models you can pick for that agent. Add--secret BINDING_IDto list the models a saved model key can use; the list comes from the key’s provider. Without a key, Codex, Gemini CLI, OpenCode and Cursor list their own models; the others have no list, and the agent uses its own default.
Sign in an agent
Runstackshift computers agent login COMPUTER --provider X. It opens its own terminal tab on the computer and runs the agent’s sign-in there; the tab closes when the sign-in ends. On a desktop Computer, the agent’s sign-in page opens in the browser on that desktop, so you can finish it in the live view. On a coding Computer, which has no desktop, the command prints a link and a code. Open the link on your own device and enter the code.
A sign-in stays inside the computer. It is not copied to your StackShift account. Snapshots and forks of the computer keep it, so a fork can start working straight away. If you delete the computer without a snapshot, the sign-in goes with it.
Use a model key instead
Save the key withstackshift computers secrets set, then pass its binding with --secret (CLI) or secret_binding_ids (API and SDKs). StackShift adds the key to the agent’s requests on the way out. The key never enters the computer, so the agent and anything it runs cannot read it.
Send a key kind the agent cannot use and the request fails with invalid_request. Cursor and Amp sign in with their own accounts only and accept no model key. Setting the agent’s own key variable with --env KEY=VALUE also counts as signed in, but a key saved with computers secrets is the safe way, because it never enters the computer.
From the dashboard
Open a Computer and choose the Agent tab beside the terminal tabs. Pick the agent. It shows Signed in, Sign in needed or Installs on first use. Next to the agent picker is the Model key picker. It starts on “Use this computer’s sign-in” and lists the keys saved for this computer that the chosen agent can use. Choose “Add a key…” to save a new one: give it a name, a provider and the key. The key is never shown again and never enters the computer. Cursor and Amp have no key picker, because they sign in with their own accounts. The Model picker starts on “Agent default” and lists the models the chosen agent and key can use. It updates when you change either. If a key is refused, only the agent default is offered. A conversation you continue shows the model it ran with. Type the task, attach files and press Send. Messages, commands and file edits appear as they happen. Type into the box to steer the agent, or press Stop to end the turn. Choose Run on copies (1 to 3) to run the task on forks, then use Open a copy to look at one or Keep this one to keep it and delete the rest. Turns also show in the Steps tab.Start a turn
Every route is under/api/v1/computers/{id}/agent. A new turn returns a conversation with status running.
List the models for an agent with GET /agent/models?provider=X, adding secret_binding_id to list what a saved key can use. It returns models (each with id and name) and source: provider when the key’s provider listed them, agent when the agent listed its own, none when there is no list. A key its provider refuses returns invalid_request. Options on a prompt: provider, model, cwd (where the agent works), env, secret_binding_ids, attachments, and conversation_id to continue an earlier conversation. In the CLI these are --provider, --model, --cwd, --env, --secret, --attach and --resume.
- The Go, PHP and Ruby SDKs have the same calls: prompt, providers, models (
agentModelsin TypeScript and PHP,agent_modelsin Python and Ruby,AgentModelsin Go), conversations, events, steer, interrupt, result, fan-outs, turn history, keep, and a helper that uploads a file and returns its path. - MCP:
computer_agent_promptstarts a turn.computer_agent_events,computer_agent_steer,computer_agent_interrupt,computer_agent_conversations,computer_agent_providersandcomputer_agent_modelsdo the rest. They use the same key scopes and approval rules ascomputer_exec.
API
Attach files
Give the agent screenshots, specs or data with--attach FILE. Repeat the flag for more files, up to 20. The CLI uploads each file to /workspace/.stackshift/attachments/ on the computer and adds a short list of the paths to the end of your prompt, so the agent knows where to look.
Over the API, upload the files yourself with the files route, then send their paths in attachments. Every path must be a regular file under /workspace/.stackshift/attachments/.
Follow what the agent does
stackshift computers agent prompt ... -f and stackshift computers agent events COMPUTER -f show events as readable lines; events takes -c CONVERSATION. computers watch and the computer events stream also send an agent.turn event when a turn ends. Add -o json for the raw events. Over the API, GET /conversations/{cid}/events returns a page, and adding follow=1 with Accept: text/event-stream streams them as they happen.
Every event has a number (seq), the turn it belongs to and a time. These are the kinds:
turn.started: the turn began, andpromptholds the text.installing: the agent is being installed on the computer for the first time.message: something the agent said, intext.command: the agent ran a shell command, incommand.file_edit: the agent created or changed the file inpath.tool_call: the agent used another tool.toolnames it andtextis a short summary.error: something went wrong, described intext.agent,outputandstderr: lines from the agent that do not fit another kind. Raw lines are kept indata.turn.ended: the turn is over. It carriesstatus,exit_codeand theresult.
Steer and stop
stackshift computers agent steer COMPUTER 'Also run the linter' sends a new instruction into the running turn. stackshift computers agent interrupt COMPUTER stops it. Both act on the newest conversation unless you pass -c CONVERSATION. An interrupted turn ends with status interrupted, and the work done so far stays on the computer.
agent ls lists the conversations on a computer. A conversation shows running while a turn works and idle when the turn finished. The status of a finished turn in a result, a turn record or a copy is completed, failed, interrupted, needs_input or lost (the computer stopped while the turn ran).
Collect the result
stackshift computers agent result COMPUTER (add -c CONVERSATION for an older one) prints the last turn’s summary: how long it took, the exit code, what the agent said last (last_message) and a changed files summary. When the computer’s folder is a Git repository, the summary gives how many files changed, the lines added and removed, and a short diff stat.
Add --wait to wait for a running turn to finish. Add -o json when a script or a CI job reads the result. Over the API, GET /conversations/{cid}/result returns {conversation_id, provider, turn, status, result}, where status is completed, failed, interrupted, needs_input or lost. It answers 409 while the turn is running unless you add ?wait=1, which waits up to 25 seconds.
Turn history
GET /computers/{id}/agent/turns lists every turn on the computer, newest first, with its prompt, status, result and fan-out. It includes copies still waiting to start, takes limit (1 to 200, default 50), and works while the computer is paused. In the SDKs it is agentTurns (JavaScript) and agent_turns (Python). Each turn that ends also appears in the Steps tab.
Run the same task on several copies
Try one task several ways and keep the best.--forks N (1 to 3) forks the computer live and starts the same prompt on every copy. --prompts FILE reads one prompt per non-empty line, up to 3, and gives each copy its own. Model keys named in the request are copied onto each fork, so every copy can use them without seeing them.
stackshift computers agent fanout COMPUTER lists your fan-outs. Add the fan-out id to see each copy’s name, prompt, status and result. When you have a winner, stackshift computers agent keep COMPUTER FANOUT FORK keeps that copy and deletes the other copies. Your original computer stays.
A copy starts as starting, then goes to running, and ends as completed, failed, interrupted, needs_input or lost. Over the API this is POST /agent/prompt with forks or prompts, GET /agent/fanouts, GET /agent/fanouts/{id} and POST /agent/fanouts/{id}/keep with {"computer_id": "..."}. You cannot combine forks with conversation_id.
Three copies, keep one
A different prompt for each copy
The computer stays awake
While a turn runs, StackShift keeps the computer awake, so the idle policy does not pause it halfway through the work. The hold ends when the turn ends. If you close your laptop, the agent keeps going and you can read the result later.Notifications and webhooks
When a turn ends ascompleted, failed or needs_input, StackShift sends a notification. Interrupted turns do not notify you, because you caused them. A turn lost because the computer stopped is reported as failed.
Subscribe a webhook endpoint to the computer.agent.turn event to start the next step of a pipeline. The status is completed, failed or needs_input. Stopped turns send nothing. Every Computer webhook has this body: an id, the type, a timestamp and a data object. Each delivery is signed with the same webhook-id, webhook-timestamp and webhook-signature headers as the other Computer webhooks, so verify it the same way. result can be null. The notification is called “Coding agent finished”. It shows in the app by default, and you can switch on email and Slack in notification settings.
A computer.agent.turn payload
Safety and cost
- The computer is the boundary. The agent runs with its own permission prompts skipped, so it can change anything on that computer without asking. Give it a computer you are happy for it to change, and use a snapshot to go back.
- The computer’s internet policy still applies. Under
allowlistornone, the agent can reach only what the policy allows, which also limits what it can send out. - StackShift bills computer running time only. The model costs are paid by your own key or your own subscription with the agent’s maker.
- Model keys stay outside the computer. Agent sign-ins stay inside it, and go with its snapshots and forks.
Expected result
The agent works inside the computer, you see each message, command and file change as it happens, and when it stops you get a summary, the exit code and the list of files it changed.
Common failures
Related guides
Computers: a cloud computer for any agent
A Computer is a full Linux machine, with or without a desktop, that an agent or a person can create, drive, pause, fork and delete from anywhere.
Pause, snapshot and fork
Pause a computer to stop paying for running time, snapshot it to keep a copy, and fork it up to 20 times to try many things from one starting point.
Computers keys and limits
A computers key lets an agent or tool drive computers and nothing else. Set how many it may run, how large, from which templates and how much it may spend.
Computers CLI reference
Every
stackshift computers command: open a shell, create, list, run commands, move files, publish ports, fork, pause, snapshot and manage keys.Computers REST API
Every computer action is an endpoint under /api/v1/computers, with idempotent mutations, a typed error format, live sessions and an event stream.
Computers MCP tools
One MCP address gives any MCP client 18 tools to create computers, see and use their screens, run commands, fork, pause and ask you first.