spin exec
Run a command inside a workspace and stream its output.
The command runs over the same brokered connection as 'spin ssh', so it needs no directnetwork access to the workspace. Its standard input, output and error are connected toyours, and its exit status becomes this command's exit status.
A terminal is allocated when both ends are one - so an interactive program works and apipeline does not get control characters in its data. Force either with --tty/--no-tty.
--detach starts the command under systemd in the workspace and prints its run id: it goes onafter this command ends, and its output and error, merged, are kept on the workspace's disk.--attach <id> prints that output from the start and follows it until the run ends, with itsexit status. 'systemctl stop spin-exec-<id>' in the workspace stops it.
Examples: spin exec my-workspace -- ls -la spin exec my-workspace -- npm run build spin exec my-workspace --tty -- bash spin exec my-workspace -w /srv/app -- git status spin exec my-workspace -- cat build.log > local.log spin exec my-workspace --detach -w /srv/app -- make release spin exec my-workspace --attach 3f9a0c1d2e4b
Usage: spin exec <workspace> -- <command> [args...] [flags]
Flags: --attach string Print a detached run's output until it ends, and exit with its status -d, --detach Start the command, print its run id and leave it running -h, --help help for exec -i, --identity string Identity file (private key) --no-tty Do not allocate a terminal --start Start the workspace first if it is stopped --timeout duration How long to wait for the workspace to be running; by default, until the control plane gives up on it -t, --tty Allocate a terminal even if this one is not -u, --user string User to run the command as (default "root") -w, --workdir string Directory to run the command in
Global Flags: --config string config file (default is $HOME/.spin/config.yaml) -o, --output string text for a person, or json: one document of what the API answered, and no prose (default "text") --profile string named profile to use; SPIN_PROFILE names it when this flag does not (default "default")Generated by task reference from spin/cmd/cli at 8eee32b9d.
Documents Spinbox v20261019.02. This page as Markdown, for a model or a terminal.

