Computer Use enables programmatic control of desktop environments within Daytona sandboxes. It provides mouse, keyboard, screenshot, and display operations for automating GUI interactions and testing desktop applications.
We recommend using this instance type if you need to interact with Linux , Windows , or macOS applications.
Common use cases
GUI Application Testing - Automate interactions with native macOS applications, click buttons, fill forms, and validate UI behavior
Visual Testing & Screenshots - Capture screenshots of applications, compare UI states, and perform visual regression testing
Desktop Automation - Automate repetitive macOS desktop tasks, file management through GUI, and complex workflows
Start Computer Use
Start all computer use processes (Xvfb, xfce4, x11vnc, novnc) in the Sandbox.
Python
TypeScript
Ruby
Go
API
result = sandbox.computer_use.start()
print ( "Computer use processes started:" , result.message)
const result = await sandbox . computerUse . start ();
console . log ( 'Computer use processes started:' , result . message );
result = sandbox. computer_use . start
puts "Computer use processes started: #{ result. message } "
err := sandbox . ComputerUse . Start ( ctx )
if err != nil {
log . Fatal ( err )
}
defer sandbox . ComputerUse . Stop ( ctx )
fmt . Println ( "Computer use processes started" )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/start' \
--request POST
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , Go SDK , and API references:
start (Python SDK)
start (TypeScript SDK)
start (Ruby SDK)
Start Computer Use Processes (API)
Stop Computer Use
Stop all computer use processes in the Sandbox.
Python
TypeScript
Ruby
Go
API
result = sandbox.computer_use.stop()
print ( "Computer use processes stopped:" , result.message)
const result = await sandbox . computerUse . stop ();
console . log ( 'Computer use processes stopped:' , result . message );
result = sandbox. computer_use . stop
puts "Computer use processes stopped: #{ result. message } "
err := sandbox . ComputerUse . Stop ( ctx )
if err != nil {
log . Fatal ( err )
}
fmt . Println ( "Computer use processes stopped" )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/stop' \
--request POST
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , Go SDK , and API references:
stop (Python SDK)
stop (TypeScript SDK)
stop (Ruby SDK)
Stop Computer Use Processes (API)
Get status
Get the status of all computer use processes.
Python
TypeScript
Ruby
Go
API
response = sandbox.computer_use.get_status()
print ( "Computer use status:" , response.status)
const status = await sandbox . computerUse . getStatus ();
console . log ( 'Computer use status:' , status . status );
response = sandbox. computer_use . status
puts "Computer use status: #{ response. status } "
status , err := sandbox . ComputerUse . GetStatus ( ctx )
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "Computer use status: %v \n " , status [ "status" ])
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/status'
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , Go SDK , and API references:
get_status (Python SDK)
getStatus (TypeScript SDK)
status (Ruby SDK)
Get Computer Use status (API)
Get process status
Get the status of a specific VNC process.
xvfb_status = sandbox.computer_use.get_process_status( "xvfb" )
novnc_status = sandbox.computer_use.get_process_status( "novnc" )
const xvfbStatus = await sandbox . computerUse . getProcessStatus ( 'xvfb' );
const noVncStatus = await sandbox . computerUse . getProcessStatus ( 'novnc' );
xvfb_status = sandbox. computer_use . get_process_status ( "xvfb" )
no_vnc_status = sandbox. computer_use . get_process_status ( "novnc" )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/process/{processName}/status'
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , and API references:
get_process_status (Python SDK)
getProcessStatus (TypeScript SDK)
get_process_status (Ruby SDK)
Get Process Status (API)
Restart process
Restart a specific VNC process.
result = sandbox.computer_use.restart_process( "xfce4" )
print ( "XFCE4 process restarted:" , result.message)
const result = await sandbox . computerUse . restartProcess ( 'xfce4' );
console . log ( 'XFCE4 process restarted:' , result . message );
result = sandbox. computer_use . restart_process ( "xfce4" )
puts "XFCE4 process restarted: #{ result. message } "
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/process/{processName}/restart' \
--request POST
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , and API references:
restart_process (Python SDK)
restartProcess (TypeScript SDK)
restart_process (Ruby SDK)
Restart process (API)
Get process logs
Get logs for a specific VNC process.
logs = sandbox.computer_use.get_process_logs( "novnc" )
print ( "NoVNC logs:" , logs)
const logsResp = await sandbox . computerUse . getProcessLogs ( 'novnc' );
console . log ( 'NoVNC logs:' , logsResp . logs );
logs = sandbox. computer_use . get_process_logs ( "novnc" )
puts "NoVNC logs: #{ logs } "
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/process/{processName}/logs'
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , and API references:
get_process_logs (Python SDK)
getProcessLogs (TypeScript SDK)
get_process_logs (Ruby SDK)
Get process logs (API)
Get process errors
Get error logs for a specific VNC process.
errors = sandbox.computer_use.get_process_errors( "x11vnc" )
print ( "X11VNC errors:" , errors)
const errorsResp = await sandbox . computerUse . getProcessErrors ( 'x11vnc' );
console . log ( 'X11VNC errors:' , errorsResp . errors );
errors = sandbox. computer_use . get_process_errors ( "x11vnc" )
puts "X11VNC errors: #{ errors } "
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/process/{processName}/errors'
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , and API references:
get_process_errors (Python SDK)
getProcessErrors (TypeScript SDK)
get_process_errors (Ruby SDK)
Get process errors (API)
Mouse operations
Click
Click the mouse at the specified coordinates.
Python
TypeScript
Ruby
Go
API
# Single left click
result = sandbox.computer_use.mouse.click( 100 , 200 )
# Double click
double_click = sandbox.computer_use.mouse.click( 100 , 200 , "left" , True )
# Right click
right_click = sandbox.computer_use.mouse.click( 100 , 200 , "right" )
// Single left click
const result = await sandbox . computerUse . mouse . click ( 100 , 200 );
// Double click
const doubleClick = await sandbox . computerUse . mouse . click ( 100 , 200 , 'left' , true );
// Right click
const rightClick = await sandbox . computerUse . mouse . click ( 100 , 200 , 'right' );
# Single left click
result = sandbox. computer_use . mouse . click ( x: 100 , y: 200 )
# Double click
double_click = sandbox. computer_use . mouse . click ( x: 100 , y: 200 , button: 'left' , double: true )
# Right click
right_click = sandbox. computer_use . mouse . click ( x: 100 , y: 200 , button: 'right' )
// Single left click
result , err := sandbox . ComputerUse . Mouse (). Click ( ctx , 100 , 200 , nil , nil )
if err != nil {
log . Fatal ( err )
}
// Double click
doubleClick := true
result , err = sandbox . ComputerUse . Mouse (). Click ( ctx , 100 , 200 , nil , & doubleClick )
// Right click
rightButton := "right"
result , err = sandbox . ComputerUse . Mouse (). Click ( ctx , 100 , 200 , & rightButton , nil )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/mouse/click' \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"button": "",
"double": true,
"x": 1,
"y": 1
}'
For more information, see the Python SDK , TypeScript SDK , Go SDK , and API references:
click (Python SDK)
click (TypeScript SDK)
Click (Go SDK)
Mouse click (API)
Move
Move the mouse cursor to the specified coordinates.
Python
TypeScript
Ruby
Go
API
result = sandbox.computer_use.mouse.move( 100 , 200 )
print ( f "Mouse moved to: { result.x } , { result.y } " )
const result = await sandbox . computerUse . mouse . move ( 100 , 200 );
console . log ( `Mouse moved to: ${ result . x } , ${ result . y } ` );
result = sandbox. computer_use . mouse . move ( x: 100 , y: 200 )
puts "Mouse moved to: #{ result. x } , #{ result. y } "
result , err := sandbox . ComputerUse . Mouse (). Move ( ctx , 100 , 200 )
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "Mouse moved to: %v , %v \n " , result [ "x" ], result [ "y" ])
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/mouse/move' \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"x": 1,
"y": 1
}'
For more information, see the Python SDK , TypeScript SDK , Go SDK , and API references:
move (Python SDK)
move (TypeScript SDK)
Move (Go SDK)
Mouse move (API)
Drag
Drag the mouse from start coordinates to end coordinates.
Python
TypeScript
Ruby
Go
API
result = sandbox.computer_use.mouse.drag( 50 , 50 , 150 , 150 )
print ( f "Dragged from { result.from_x } , { result.from_y } to { result.to_x } , { result.to_y } " )
const result = await sandbox . computerUse . mouse . drag ( 50 , 50 , 150 , 150 );
console . log ( `Dragged from ${ result . from . x } , ${ result . from . y } to ${ result . to . x } , ${ result . to . y } ` );
result = sandbox. computer_use . mouse . drag ( start_x: 50 , start_y: 50 , end_x: 150 , end_y: 150 )
puts "Dragged from #{ result. from_x } , #{ result. from_y } to #{ result. to_x } , #{ result. to_y } "
result , err := sandbox . ComputerUse . Mouse (). Drag ( ctx , 50 , 50 , 150 , 150 , nil )
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "Dragged to %v , %v \n " , result [ "x" ], result [ "y" ])
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/mouse/drag' \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"button": "",
"endX": 1,
"endY": 1,
"startX": 1,
"startY": 1
}'
For more information, see the Python SDK , TypeScript SDK , Go SDK , and API references:
drag (Python SDK)
drag (TypeScript SDK)
Drag (Go SDK)
Mouse drag (API)
Scroll the mouse wheel at the specified coordinates.
Python
TypeScript
Ruby
Go
API
# Scroll up
scroll_up = sandbox.computer_use.mouse.scroll( 100 , 200 , "up" , 3 )
# Scroll down
scroll_down = sandbox.computer_use.mouse.scroll( 100 , 200 , "down" , 5 )
// Scroll up
const scrollUp = await sandbox . computerUse . mouse . scroll ( 100 , 200 , 'up' , 3 );
// Scroll down
const scrollDown = await sandbox . computerUse . mouse . scroll ( 100 , 200 , 'down' , 5 );
# Scroll up
scroll_up = sandbox. computer_use . mouse . scroll ( x: 100 , y: 200 , direction: 'up' , amount: 3 )
# Scroll down
scroll_down = sandbox. computer_use . mouse . scroll ( x: 100 , y: 200 , direction: 'down' , amount: 5 )
// Scroll up
amount := 3
success , err := sandbox . ComputerUse . Mouse (). Scroll ( ctx , 100 , 200 , "up" , & amount )
if err != nil {
log . Fatal ( err )
}
// Scroll down
amount = 5
success , err = sandbox . ComputerUse . Mouse (). Scroll ( ctx , 100 , 200 , "down" , & amount )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/mouse/scroll' \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"amount": 1,
"direction": "",
"x": 1,
"y": 1
}'
For more information, see the Python SDK , TypeScript SDK , Go SDK , and API references:
scroll (Python SDK)
scroll (TypeScript SDK)
Scroll (Go SDK)
Mouse scroll (API)
Get position
Get the current mouse cursor position.
Python
TypeScript
Ruby
Go
API
position = sandbox.computer_use.mouse.get_position()
print ( f "Mouse is at: { position.x } , { position.y } " )
const position = await sandbox . computerUse . mouse . getPosition ();
console . log ( `Mouse is at: ${ position . x } , ${ position . y } ` );
position = sandbox. computer_use . mouse . position
puts "Mouse is at: #{ position. x } , #{ position. y } "
position , err := sandbox . ComputerUse . Mouse (). GetPosition ( ctx )
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "Mouse is at: %v , %v \n " , position [ "x" ], position [ "y" ])
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/mouse/position'
For more information, see the Python SDK , TypeScript SDK , Go SDK , and API references:
get_position (Python SDK)
getPosition (TypeScript SDK)
GetPosition (Go SDK)
Get mouse position (API)
Keyboard operations
Type
Type the specified text.
Python
TypeScript
Ruby
Go
API
sandbox.computer_use.keyboard.type( "Hello, World!" )
# With delay between characters
sandbox.computer_use.keyboard.type( "Slow typing" , 100 )
await sandbox . computerUse . keyboard . type ( 'Hello, World!' );
// With delay between characters
await sandbox . computerUse . keyboard . type ( 'Slow typing' , 100 );
sandbox. computer_use . keyboard . type ( text: "Hello, World!" )
# With delay between characters
sandbox. computer_use . keyboard . type ( text: "Slow typing" , delay: 100 )
err := sandbox . ComputerUse . Keyboard (). Type ( ctx , "Hello, World!" , nil )
if err != nil {
log . Fatal ( err )
}
// With delay between characters
delay := 100
err = sandbox . ComputerUse . Keyboard (). Type ( ctx , "Slow typing" , & delay )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/keyboard/type' \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"delay": 1,
"text": ""
}'
For more information, see the Python SDK , TypeScript SDK , Go SDK , and API references:
type (Python SDK)
type (TypeScript SDK)
Type (Go SDK)
Keyboard type (API)
Press
Press a key with optional modifiers.
Python
TypeScript
Ruby
Go
API
# Press Enter
sandbox.computer_use.keyboard.press( "Return" )
# Press Ctrl+C
sandbox.computer_use.keyboard.press( "c" , [ "ctrl" ])
# Press Ctrl+Shift+T
sandbox.computer_use.keyboard.press( "t" , [ "ctrl" , "shift" ])
// Press Enter
await sandbox . computerUse . keyboard . press ( 'Return' );
// Press Ctrl+C
await sandbox . computerUse . keyboard . press ( 'c' , [ 'ctrl' ]);
// Press Ctrl+Shift+T
await sandbox . computerUse . keyboard . press ( 't' , [ 'ctrl' , 'shift' ]);
# Press Enter
sandbox. computer_use . keyboard . press ( key: "Return" )
# Press Ctrl+C
sandbox. computer_use . keyboard . press ( key: "c" , modifiers: [ "ctrl" ])
# Press Ctrl+Shift+T
sandbox. computer_use . keyboard . press ( key: "t" , modifiers: [ "ctrl" , "shift" ])
// Press Enter
err := sandbox . ComputerUse . Keyboard (). Press ( ctx , "Return" , nil )
if err != nil {
log . Fatal ( err )
}
// Press Ctrl+C
err = sandbox . ComputerUse . Keyboard (). Press ( ctx , "c" , [] string { "ctrl" })
// Press Ctrl+Shift+T
err = sandbox . ComputerUse . Keyboard (). Press ( ctx , "t" , [] string { "ctrl" , "shift" })
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/keyboard/key' \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"key": "",
"modifiers": [
""
]
}'
For more information, see the Python SDK , TypeScript SDK , Go SDK , and API references:
press (Python SDK)
press (TypeScript SDK)
Press (Go SDK)
Keyboard press (API)
Hotkey
Press a hotkey combination.
Python
TypeScript
Ruby
Go
API
# Copy
sandbox.computer_use.keyboard.hotkey( "ctrl+c" )
# Paste
sandbox.computer_use.keyboard.hotkey( "ctrl+v" )
# Alt+Tab
sandbox.computer_use.keyboard.hotkey( "alt+tab" )
// Copy
await sandbox . computerUse . keyboard . hotkey ( 'ctrl+c' );
// Paste
await sandbox . computerUse . keyboard . hotkey ( 'ctrl+v' );
// Alt+Tab
await sandbox . computerUse . keyboard . hotkey ( 'alt+tab' );
# Copy
sandbox. computer_use . keyboard . hotkey ( keys: "ctrl+c" )
# Paste
sandbox. computer_use . keyboard . hotkey ( keys: "ctrl+v" )
# Alt+Tab
sandbox. computer_use . keyboard . hotkey ( keys: "alt+tab" )
// Copy
err := sandbox . ComputerUse . Keyboard (). Hotkey ( ctx , "ctrl+c" )
if err != nil {
log . Fatal ( err )
}
// Paste
err = sandbox . ComputerUse . Keyboard (). Hotkey ( ctx , "ctrl+v" )
// Alt+Tab
err = sandbox . ComputerUse . Keyboard (). Hotkey ( ctx , "alt+tab" )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/keyboard/hotkey' \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"keys": ""
}'
For more information, see the Python SDK , TypeScript SDK , Go SDK , and API references:
hotkey (Python SDK)
hotkey (TypeScript SDK)
Hotkey (Go SDK)
Keyboard hotkey (API)
Screenshot operations
Take full screen
Take a screenshot of the entire screen.
Python
TypeScript
Ruby
Go
API
screenshot = sandbox.computer_use.screenshot.take_full_screen()
print ( f "Screenshot size: { screenshot.width } x { screenshot.height } " )
# With cursor visible
with_cursor = sandbox.computer_use.screenshot.take_full_screen( True )
const screenshot = await sandbox . computerUse . screenshot . takeFullScreen ();
console . log ( `Screenshot size: ${ screenshot . width } x ${ screenshot . height } ` );
// With cursor visible
const withCursor = await sandbox . computerUse . screenshot . takeFullScreen ( true );
screenshot = sandbox. computer_use . screenshot . take_full_screen
puts "Screenshot size: #{ screenshot. width } x #{ screenshot. height } "
# With cursor visible
with_cursor = sandbox. computer_use . screenshot . take_full_screen ( show_cursor: true )
screenshot , err := sandbox . ComputerUse . Screenshot (). TakeFullScreen ( ctx , nil )
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "Screenshot captured, size: %d bytes \n " , * screenshot . SizeBytes )
// With cursor visible
showCursor := true
withCursor , err := sandbox . ComputerUse . Screenshot (). TakeFullScreen ( ctx , & showCursor )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/screenshot'
For more information, see the Python SDK , TypeScript SDK , Go SDK , and API references:
take_full_screen (Python SDK)
takeFullScreen (TypeScript SDK)
TakeFullScreen (Go SDK)
Take screenshot (API)
Take region
Take a screenshot of a specific region.
Python
TypeScript
Ruby
Go
API
from daytona import ScreenshotRegion
region = ScreenshotRegion( x = 100 , y = 100 , width = 300 , height = 200 )
screenshot = sandbox.computer_use.screenshot.take_region(region)
print ( f "Captured region: { screenshot.region.width } x { screenshot.region.height } " )
const region = { x: 100 , y: 100 , width: 300 , height: 200 };
const screenshot = await sandbox . computerUse . screenshot . takeRegion ( region );
console . log ( `Captured region: ${ screenshot . region . width } x ${ screenshot . region . height } ` );
region = Daytona :: ComputerUse :: ScreenshotRegion . new ( x: 100 , y: 100 , width: 300 , height: 200 )
screenshot = sandbox. computer_use . screenshot . take_region ( region: region)
puts "Captured region: #{ screenshot. region . width } x #{ screenshot. region . height } "
region := types . ScreenshotRegion { X : 100 , Y : 100 , Width : 300 , Height : 200 }
screenshot , err := sandbox . ComputerUse . Screenshot (). TakeRegion ( ctx , region , nil )
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "Captured region: %d x %d \n " , screenshot . Width , screenshot . Height )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/screenshot/region?x=1&y=1&width=1&height=1'
For more information, see the Python SDK , TypeScript SDK , Go SDK , and API references:
take_region (Python SDK)
takeRegion (TypeScript SDK)
TakeRegion (Go SDK)
Take Screenshot Region (API)
Take compressed
Take a compressed screenshot of the entire screen.
from daytona import ScreenshotOptions
# Default compression
screenshot = sandbox.computer_use.screenshot.take_compressed()
# High quality JPEG
jpeg = sandbox.computer_use.screenshot.take_compressed(
ScreenshotOptions( format = "jpeg" , quality = 95 , show_cursor = True )
)
# Scaled down PNG
scaled = sandbox.computer_use.screenshot.take_compressed(
ScreenshotOptions( format = "png" , scale = 0.5 )
)
// Default compression
const screenshot = await sandbox . computerUse . screenshot . takeCompressed ();
// High quality JPEG
const jpeg = await sandbox . computerUse . screenshot . takeCompressed ({
format: 'jpeg' ,
quality: 95 ,
showCursor: true
});
// Scaled down PNG
const scaled = await sandbox . computerUse . screenshot . takeCompressed ({
format: 'png' ,
scale: 0.5
});
# Default compression
screenshot = sandbox. computer_use . screenshot . take_compressed
# High quality JPEG
jpeg = sandbox. computer_use . screenshot . take_compressed (
options: Daytona :: ComputerUse :: ScreenshotOptions . new ( format: "jpeg" , quality: 95 , show_cursor: true )
)
# Scaled down PNG
scaled = sandbox. computer_use . screenshot . take_compressed (
options: Daytona :: ComputerUse :: ScreenshotOptions . new ( format: "png" , scale: 0.5 )
)
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/screenshot/compressed'
For more information, see the Python SDK , TypeScript SDK , and API references:
take_compressed (Python SDK)
takeCompressed (TypeScript SDK)
Take compressed screenshot (API)
Take compressed region
Take a compressed screenshot of a specific region.
from daytona import ScreenshotRegion, ScreenshotOptions
region = ScreenshotRegion( x = 0 , y = 0 , width = 800 , height = 600 )
screenshot = sandbox.computer_use.screenshot.take_compressed_region(
region,
ScreenshotOptions( format = "webp" , quality = 80 , show_cursor = True )
)
print ( f "Compressed size: { screenshot.size_bytes } bytes" )
const region = { x: 0 , y: 0 , width: 800 , height: 600 };
const screenshot = await sandbox . computerUse . screenshot . takeCompressedRegion ( region , {
format: 'webp' ,
quality: 80 ,
showCursor: true
});
console . log ( `Compressed size: ${ screenshot . size_bytes } bytes` );
region = Daytona :: ComputerUse :: ScreenshotRegion . new ( x: 0 , y: 0 , width: 800 , height: 600 )
screenshot = sandbox. computer_use . screenshot . take_compressed_region (
region: region,
options: Daytona :: ComputerUse :: ScreenshotOptions . new ( format: "webp" , quality: 80 , show_cursor: true )
)
puts "Compressed size: #{ screenshot. size_bytes } bytes"
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/screenshot/region/compressed?x=1&y=1&width=1&height=1'
For more information, see the Python SDK , TypeScript SDK , and API references:
take_compressed_region (Python SDK)
takeCompressedRegion (TypeScript SDK)
Take compressed screenshot region (API)
Screen Recording
Computer Use supports screen recording capabilities, allowing you to capture desktop sessions for debugging, documentation, or automation workflows.
By default, recordings are saved to ~/.daytona/recordings. You can specify a custom directory by passing the DAYTONA_RECORDINGS_DIR environment variable when creating a sandbox:
from daytona import Daytona, CreateSandboxFromSnapshotParams
daytona = Daytona()
sandbox = daytona.create(
CreateSandboxFromSnapshotParams(
snapshot = "daytonaio/sandbox:0.6.0" ,
name = "my-sandbox" ,
env_vars = { "DAYTONA_RECORDINGS_DIR" : "/home/daytona/my-recordings" }
)
)
import { Daytona } from '@daytonaio/sdk' ;
const daytona = new Daytona ();
const sandbox = await daytona . create ({
snapshot: 'daytonaio/sandbox:0.6.0' ,
name: 'my-sandbox' ,
envVars: { DAYTONA_RECORDINGS_DIR: '/home/daytona/my-recordings' }
});
require 'daytona'
daytona = Daytona :: Client . new
sandbox = daytona. create (
snapshot: 'daytonaio/sandbox:0.6.0' ,
name: 'my-sandbox' ,
env_vars: { DAYTONA_RECORDINGS_DIR: '/home/daytona/my-recordings' }
)
import (
" github.com/daytonaio/daytona/pkg/client "
" github.com/daytonaio/daytona/pkg/types "
)
daytona := client . New ()
envVars := map [ string ] string {
"DAYTONA_RECORDINGS_DIR" : "/home/daytona/my-recordings" ,
}
sandbox , err := daytona . Create ( ctx , & types . CreateSandboxParams {
Snapshot : "daytonaio/sandbox:0.6.0" ,
Name : "my-sandbox" ,
EnvVars : envVars ,
})
if err != nil {
log . Fatal ( err )
}
Start Recording
Start a new screen recording session with an optional name identifier:
Python
TypeScript
Ruby
Go
API
# Start recording with a custom name
recording = sandbox.computer_use.recording.start( "test-1" )
print ( f "Recording started: { recording.id } " )
print ( f "File path: { recording.file_path } " )
// Start recording with a custom name
const recording = await sandbox . computerUse . recording . start ( 'test-1' );
console . log ( `Recording started: ${ recording . id } ` );
console . log ( `File path: ${ recording . file_path } ` );
# Start recording with a custom label
recording = sandbox. computer_use . recording . start ( label: 'test-1' )
puts "Recording started: #{ recording. id } "
puts "File path: #{ recording. file_path } "
// Start recording with a custom name
name := "test-1"
recording , err := sandbox . ComputerUse . Recording (). Start ( ctx , & name )
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "Recording started: %s \n " , * recording . Id )
fmt . Printf ( "File path: %s \n " , * recording . FilePath )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/recording/start' \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"name": "test-1"
}'
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , Go SDK , and API references:
start (Python SDK)
start (TypeScript SDK)
start (Ruby SDK)
Start (Go SDK)
Start Recording (API)
Stop Recording
Stop an active recording session by providing the recording ID:
Python
TypeScript
Ruby
Go
API
# Stop the recording
stopped_recording = sandbox.computer_use.recording.stop(recording.id)
print ( f "Recording stopped: { stopped_recording.duration_seconds } seconds" )
print ( f "Saved to: { stopped_recording.file_path } " )
// Stop the recording
const stoppedRecording = await sandbox . computerUse . recording . stop ( recording . id );
console . log ( `Recording stopped: ${ stoppedRecording . duration_seconds } seconds` );
console . log ( `Saved to: ${ stoppedRecording . file_path } ` );
# Stop the recording
stopped_recording = sandbox. computer_use . recording . stop ( id: recording. id )
puts "Recording stopped: #{ stopped_recording. duration_seconds } seconds"
puts "Saved to: #{ stopped_recording. file_path } "
// Stop the recording
stoppedRecording , err := sandbox . ComputerUse . Recording (). Stop ( ctx , * recording . Id )
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "Recording stopped: %f seconds \n " , * stoppedRecording . DurationSeconds )
fmt . Printf ( "Saved to: %s \n " , * stoppedRecording . FilePath )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/recording/stop' \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"id": "recording-id"
}'
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , Go SDK , and API references:
stop (Python SDK)
stop (TypeScript SDK)
stop (Ruby SDK)
Stop (Go SDK)
Stop Recording (API)
List Recordings
Get a list of all recordings in the sandbox:
Python
TypeScript
Ruby
Go
API
recordings_list = sandbox.computer_use.recording.list()
print ( f "Total recordings: { len (recordings_list.recordings) } " )
for rec in recordings_list.recordings:
print ( f "- { rec.name } : { rec.duration_seconds } s ( { rec.file_size_bytes } bytes)" )
const recordingsList = await sandbox . computerUse . recording . list ();
console . log ( `Total recordings: ${ recordingsList . recordings . length } ` );
recordingsList . recordings . forEach ( rec => {
console . log ( `- ${ rec . name } : ${ rec . duration_seconds } s ( ${ rec . file_size_bytes } bytes)` );
});
recordings_list = sandbox. computer_use . recording . list
puts "Total recordings: #{ recordings_list. recordings . length } "
recordings_list. recordings . each do | rec |
puts "- #{ rec. name } : #{ rec. duration_seconds } s ( #{ rec. file_size_bytes } bytes)"
end
recordingsList , err := sandbox . ComputerUse . Recording (). List ( ctx )
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "Total recordings: %d \n " , len ( recordingsList . Recordings ))
for _ , rec := range recordingsList . Recordings {
fmt . Printf ( "- %s : %.2f s ( %d bytes) \n " , * rec . Name , * rec . DurationSeconds , * rec . FileSizeBytes )
}
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/recording/list'
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , Go SDK , and API references:
list (Python SDK)
list (TypeScript SDK)
list (Ruby SDK)
List (Go SDK)
List Recordings (API)
Get Recording
Get details about a specific recording:
Python
TypeScript
Ruby
Go
API
recording_detail = sandbox.computer_use.recording.get( "recording-id" )
print ( f "Recording: { recording_detail.name } " )
print ( f "Status: { recording_detail.status } " )
print ( f "Duration: { recording_detail.duration_seconds } s" )
const recordingDetail = await sandbox . computerUse . recording . get ( 'recording-id' );
console . log ( `Recording: ${ recordingDetail . name } ` );
console . log ( `Status: ${ recordingDetail . status } ` );
console . log ( `Duration: ${ recordingDetail . duration_seconds } s` );
recording_detail = sandbox. computer_use . recording . get ( id: 'recording-id' )
puts "Recording: #{ recording_detail. name } "
puts "Status: #{ recording_detail. status } "
puts "Duration: #{ recording_detail. duration_seconds } s"
recordingDetail , err := sandbox . ComputerUse . Recording (). Get ( ctx , "recording-id" )
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "Recording: %s \n " , * recordingDetail . Name )
fmt . Printf ( "Status: %s \n " , * recordingDetail . Status )
fmt . Printf ( "Duration: %.2f s \n " , * recordingDetail . DurationSeconds )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/recording/{recordingId}'
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , Go SDK , and API references:
get (Python SDK)
get (TypeScript SDK)
get (Ruby SDK)
Get (Go SDK)
Get Recording (API)
Delete Recording
Delete a recording by ID:
Python
TypeScript
Ruby
Go
API
sandbox.computer_use.recording.delete( "recording-id" )
print ( "Recording deleted successfully" )
await sandbox . computerUse . recording . delete ( 'recording-id' );
console . log ( 'Recording deleted successfully' );
sandbox. computer_use . recording . delete ( id: 'recording-id' )
puts 'Recording deleted successfully'
err := sandbox . ComputerUse . Recording (). Delete ( ctx , "recording-id" )
if err != nil {
log . Fatal ( err )
}
fmt . Println ( "Recording deleted successfully" )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/recording/{recordingId}' \
--request DELETE
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , Go SDK , and API references:
delete (Python SDK)
delete (TypeScript SDK)
delete (Ruby SDK)
Delete (Go SDK)
Delete Recording (API)
Download Recording
Download a recording file from the sandbox to your local machine. The file is streamed efficiently without loading the entire content into memory, making it suitable for large recordings.
Python
TypeScript
Ruby
Go
API
# Download recording to local file
sandbox.computer_use.recording.download(recording.id, "local_recording.mp4" )
print ( "Recording downloaded successfully" )
# Or with custom path
import os
download_path = os.path.join( "recordings" , f "recording_ { recording.id } .mp4" )
sandbox.computer_use.recording.download(recording.id, download_path)
// Download recording to local file
await sandbox . computerUse . recording . download ( recording . id , 'local_recording.mp4' );
console . log ( 'Recording downloaded successfully' );
// Or with custom path
const downloadPath = `recordings/recording_ ${ recording . id } .mp4` ;
await sandbox . computerUse . recording . download ( recording . id , downloadPath );
# Download recording to local file
sandbox. computer_use . recording . download ( id: recording. id , local_path: 'local_recording.mp4' )
puts 'Recording downloaded successfully'
# Or with custom path
download_path = "recordings/recording_ #{ recording. id } .mp4"
sandbox. computer_use . recording . download ( id: recording. id , local_path: download_path)
// Download recording to local file
err := sandbox . ComputerUse . Recording (). Download ( ctx , recording . GetId (), "local_recording.mp4" )
if err != nil {
log . Fatal ( err )
}
fmt . Println ( "Recording downloaded successfully" )
// Or with custom path
downloadPath := fmt . Sprintf ( "recordings/recording_ %s .mp4" , recording . GetId ())
err = sandbox . ComputerUse . Recording (). Download ( ctx , recording . GetId (), downloadPath )
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/recordings/{recordingId}/download' \
--output local_recording.mp4
Streaming Downloads
All SDK implementations stream the recording file directly to disk without loading the entire content into memory. This allows you to download large recordings (hundreds of MB or even GB) efficiently without running out of memory.
Python : Streams in 64KB chunks using httpx
TypeScript : Uses Node.js pipeline() with backpressure handling
Ruby : Uses Typhoeus streaming with on_body callbacks
Go : Uses io.Copy() with 32KB internal buffer
For more information, see the Python SDK , TypeScript SDK , Ruby SDK , Go SDK , and API references:
download (Python SDK)
download (TypeScript SDK)
download (Ruby SDK)
Download (Go SDK)
Download Recording (API)
Recording Dashboard
Every sandbox includes a built-in recording dashboard for managing screen recordings through a web interface. The dashboard allows you to view, download, and delete recordings without writing code.
To access the recording dashboard:
Navigate to your sandboxes in the Daytona Dashboard
Click the action menu (three dots) for your sandbox
Select Screen Recordings from the dropdown menu
The recording dashboard provides:
List of all recordings with metadata (name, duration, file size, creation time)
Playback controls for reviewing recordings
Download functionality to save recordings locally
Delete options for managing storage
The recording dashboard runs on a private port and is automatically secured. No additional authentication is required once you access it through the Daytona Dashboard.
Display operations
Get info
Get information about the displays.
Python
TypeScript
Ruby
Go
API
info = sandbox.computer_use.display.get_info()
print ( f "Primary display: { info.primary_display.width } x { info.primary_display.height } " )
print ( f "Total displays: { info.total_displays } " )
for i, display in enumerate (info.displays):
print ( f "Display { i } : { display.width } x { display.height } at { display.x } , { display.y } " )
const info = await sandbox . computerUse . display . getInfo ();
console . log ( `Primary display: ${ info . primary_display . width } x ${ info . primary_display . height } ` );
console . log ( `Total displays: ${ info . total_displays } ` );
info . displays . forEach (( display , index ) => {
console . log ( `Display ${ index } : ${ display . width } x ${ display . height } at ${ display . x } , ${ display . y } ` );
});
info = sandbox. computer_use . display . info
puts "Primary display: #{ info. primary_display . width } x #{ info. primary_display . height } "
puts "Total displays: #{ info. total_displays } "
info. displays . each_with_index do | display , i |
puts "Display #{ i } : #{ display. width } x #{ display. height } at #{ display. x } , #{ display. y } "
end
info , err := sandbox . ComputerUse . Display (). GetInfo ( ctx )
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "Displays: %v \n " , info [ "displays" ])
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/display/info'
For more information, see the Python SDK , TypeScript SDK , Go SDK , and API references:
get_info (Python SDK)
getInfo (TypeScript SDK)
GetInfo (Go SDK)
Get display info (API)
Get windows
Get the list of open windows.
Python
TypeScript
Ruby
Go
API
windows = sandbox.computer_use.display.get_windows()
print ( f "Found { windows.count } open windows:" )
for window in windows.windows:
print ( f "- { window.title } (ID: { window.id } )" )
const windows = await sandbox . computerUse . display . getWindows ();
console . log ( `Found ${ windows . count } open windows:` );
windows . windows . forEach ( window => {
console . log ( `- ${ window . title } (ID: ${ window . id } )` );
});
windows = sandbox. computer_use . display . windows
puts "Found #{ windows. count } open windows:"
windows. windows . each do | window |
puts "- #{ window. title } (ID: #{ window. id } )"
end
result , err := sandbox . ComputerUse . Display (). GetWindows ( ctx )
if err != nil {
log . Fatal ( err )
}
fmt . Printf ( "Open windows: %v \n " , result [ "windows" ])
curl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/computeruse/display/windows'
For more information, see the Python SDK , TypeScript SDK , Go SDK , and API references:
get_windows (Python SDK)
getWindows (TypeScript SDK)
GetWindows (Go SDK)
Get Windows (API)