Websockets
Execute Command
Execute a command in the sprite environment via WebSocket. Commands continue running after disconnect; use max_run_after_disconnect to control timeout. Supports TTY and non-TTY modes.
WSS
/
v1
/
sprites
/
{name}
/
exec
Messages
{
"cols": 180,
"rows": 50,
"type": "resize"
}"0x00 0x6c 0x73 0x0a (sends 'ls\\n')""0x04 (signals end of input)"{
"cols": 120,
"command": "bash",
"created": 1767609000,
"is_owner": true,
"rows": 40,
"session_id": "1847",
"tty": true,
"type": "session_info"
}{
"exit_code": 0,
"type": "exit"
}{
"address": "https://my-sprite.sprites.dev:3000",
"pid": 1847,
"port": 3000,
"type": "port_opened"
}"0x01 0x66 0x6f 0x6f 0x0a (receives 'foo\\n')""0x02 0x65 0x72 0x72 0x6f 0x72 0x0a (receives 'error\\n')""0x03 0x00 (exit code 0)"name
type:string
required
Sprite name within the organization.
bearerAuth
type:http
Sprites API token in the form <org>/<id>/<secret>, sent as Authorization: Bearer <token> on the upgrade request.
ResizeMessage
type:object
stdin data (0x00)
type:string
stdin data. Frame prefix: 0x00.
stdin EOF signal (0x04)
type:string
stdin EOF signal. Frame prefix: 0x04.
SessionInfoMessage
type:object
ExitMessage
type:object
PortNotificationMessage
type:object
stdout data (0x01)
type:string
stdout data. Frame prefix: 0x01.
stderr data (0x02)
type:string
stderr data. Frame prefix: 0x02.
exit code (single byte) (0x03)
type:string
exit code (single byte). Frame prefix: 0x03.
⌘I
Messages
{
"cols": 180,
"rows": 50,
"type": "resize"
}"0x00 0x6c 0x73 0x0a (sends 'ls\\n')""0x04 (signals end of input)"{
"cols": 120,
"command": "bash",
"created": 1767609000,
"is_owner": true,
"rows": 40,
"session_id": "1847",
"tty": true,
"type": "session_info"
}{
"exit_code": 0,
"type": "exit"
}{
"address": "https://my-sprite.sprites.dev:3000",
"pid": 1847,
"port": 3000,
"type": "port_opened"
}"0x01 0x66 0x6f 0x6f 0x0a (receives 'foo\\n')""0x02 0x65 0x72 0x72 0x6f 0x72 0x0a (receives 'error\\n')""0x03 0x00 (exit code 0)"