Background commands
Dev servers and watchers a thread keeps running, as terminals you can see
A thread starts long-running commands, such as a dev server, a watcher or a test runner in watch mode, as background commands. Each one is a terminal in the thread's work pane, marked as the thread's, on whichever device the thread runs. You can watch its output, type into it or close it.
What the thread can do
The agent has four tools for them: start a command, list its commands, read the end of a command's output, and stop one. Starting a command goes through approvals like the same command typed in a shell, so a dev server falls under "Run the dev server and open the browser".
A thread runs at most 10 background commands at once.
When they stop
Background commands end when:
- the thread or you stop them, or you close their terminal,
- the thread is archived,
- the app or the engine stops, or the device's connection drops.
Stopping one also stops everything it started, including processes it put in the background.
Background commands aren't kept across a restart. After one, the thread's list is empty and the agent starts the commands again when it needs them.
Ports and previews
On Keko Cloud, and on a server set up with keko setup --previews, a background command that listens on a port gets
a preview link. See Previews.