Ubuntu
Deploy an Ubuntu instance
UbuntuInstance
The UbuntuInstance
is a Ubuntu 22.04 desktop that supports interactive streaming, computer actions, bash commands, filesystem management, built-in Jupyter notebooks, and Chromium browser support. We recommend using this instance type for most tasks.
- Fast start up time
- 1x compute cost
Start an Ubuntu instance
Python
TypeScript
Available actions
screenshot
Take a base64 encoded image of the current desktop
Python
TypeScript
get_stream_url
Get the interactive stream URL
Python
TypeScript
computer
Perform computer actions with the mouse and keyboard
move_mouse
Move mouse cursor to specific coordinates
[x, y] coordinates to move to
List of modifier keys to hold during the action
Whether to take a screenshot after the action
Python
TypeScript
click_mouse
Perform a mouse click at current position or specified coordinates
Mouse button to click (“left”, “right”, “middle”, “back”, “forward”)
Type of click action (“down”, “up”, “click”)
[x, y] coordinates to click at
Number of clicks
List of modifier keys to hold during the action
Whether to take a screenshot after the action
Python
TypeScript
drag_mouse
Click and drag from current position to specified coordinates
List of [x, y] coordinate pairs defining the drag path
List of modifier keys to hold during the action
Whether to take a screenshot after the action
Python
TypeScript
scroll
Scroll horizontally and/or vertically
[x, y] coordinates to scroll at
Horizontal scroll amount
Vertical scroll amount
List of modifier keys to hold during the action
Whether to take a screenshot after the action
Python
TypeScript
press_key
Press a key or combination of keys. Scrapybara supports keys defined by X keysyms. Common aliases are also supported:
alt
→Alt_L
ctrl
,control
→Control_L
meta
→Meta_L
super
→Super_L
shift
→Shift_L
List of keys to press
Time to hold keys in seconds
Whether to take a screenshot after the action
Python
TypeScript
type_text
Type text into the active window
Text to type
List of modifier keys to hold while typing
Whether to take a screenshot after the action
Python
TypeScript
wait
Wait for a specified duration
Time to wait in seconds
Whether to take a screenshot after the action
Python
TypeScript
take_screenshot
Take a screenshot of the desktop
Python
TypeScript
get_cursor_position
Get current mouse cursor coordinates
Python
TypeScript
bash
Run a bash command
Python
TypeScript
edit
Deprecated: Please use the
file
tool instead which provides more comprehensive file management capabilities.
Edit a file on the instance
Python
TypeScript
file
Manage files and directories on the instance
read
Read the content of a file in text or binary mode
Path to the file to read
Read mode: “text” or “binary”
Text encoding when mode is “text”
Python
TypeScript
write
Write content to a file, overwriting if it exists
Path to the file to write
Content to write to the file
Write mode: “text” or “binary” (base64 encoded for binary)
Text encoding when mode is “text”
Python
TypeScript
append
Append content to an existing file or create it if it doesn’t exist
Path to the file to append to
Content to append to the file
Append mode: “text” or “binary” (base64 encoded for binary)
Text encoding when mode is “text”
Python
TypeScript
exists
Check if a path exists
Path to check
Python
TypeScript
list
List the contents of a directory
Path to the directory to list
Python
TypeScript
mkdir
Create a directory, including parent directories if needed
Path to the directory to create
Python
TypeScript
rmdir
Remove an empty directory
Path to the directory to remove
Python
TypeScript
delete
Delete a file or directory
Path to delete
Delete directory contents recursively
Python
TypeScript
move
Move or rename a file or directory
Source path
Destination path
Python
TypeScript
copy
Copy a file or directory
Source path
Destination path
Python
TypeScript
view
View file content with line numbers or list directory contents
Path to view
Optional [start, end] line range to view
Python
TypeScript
create
Create a new file with the given content, failing if it already exists
Path to the file to create
Content to write to the new file
Create mode: “text” or “binary” (base64 encoded for binary)
Text encoding when mode is “text”
Python
TypeScript
replace
Replace a string in a file
Path to the file
String to replace
Replacement string
Replace all occurrences if true, only first occurrence if false
Python
TypeScript
insert
Insert text at a specific line in a file
Path to the file
Line number to insert at (1-based)
Text to insert
Python
TypeScript
delete_lines
Delete specified lines from a file
Path to the file
Array of line numbers to delete (1-based)
Python
TypeScript
undo
Undo the last text editing operation on a file
Path to the file
Python
TypeScript
grep
Search for a pattern in a file or directory
Regular expression pattern to search for
Path to file or directory to search
Whether search is case sensitive
Search directories recursively (required for directory paths)
Include line numbers in results
Python
TypeScript
stop
Stop the instance
Python
TypeScript
pause
Pause the instance
Python
TypeScript
resume
Resume the instance
Python
TypeScript
Compatible tools
BashTool
ComputerTool
EditTool
Screen resolution
By default, the Ubuntu instance runs at 1024x768 resolution. You can specify a custom resolution when starting the instance:
Python
TypeScript
Additional protocols
The Ubuntu instance supports several protocols that provide additional functionality:
- Browser - Control the browser with Playwright
- Code Execution - Execute code in Python and JavaScript
- Environment Variables - Manage environment variables