Need browser automation only? Use BrowserBox instead — it’s lighter and gives you direct Playwright/Puppeteer access without a full desktop.
What you’ll build
A script that:- Launches a ComputerBox with a GUI desktop
- Takes a screenshot
- Uses the mouse and keyboard to interact with the desktop
- Automates a complete workflow: open a text editor, type content, and save
Prerequisites
- Python
- Node.js
Step 1: Launch and take a screenshot
Create a ComputerBox, wait for the desktop to be ready, and capture a screenshot.- Python
- Node.js
screenshot.py
- ComputerBox boots a VM with the
lscr.io/linuxserver/webtop:ubuntu-xfceimage — a full Ubuntu desktop with XFCE wait_until_ready()blocks until the desktop environment is loaded and responsivescreenshot()returns a base64-encoded PNG with the current screen contents
Step 2: Mouse interaction
Move the cursor, click, double-click, and drag.- Python
- Node.js
mouse.py
Mouse methods reference
Step 3: Keyboard input
Type text and press key combinations.- Python
- Node.js
keyboard.py
Key syntax reference (xdotool format)
Thekey() method uses xdotool key syntax:
Step 4: Automate a full workflow
Put it all together — open a text editor, type content, save the file, and verify with a screenshot.- Python
- Node.js
workflow.py
Constructor options
What’s next?
Automate a browser
Use BrowserBox for browser-only automation with Playwright or Puppeteer — lighter than a full desktop.
Handle errors and debug
Catch exceptions, handle timeouts, and debug failures in your automation scripts.
ComputerBox API reference
Full API docs for all mouse, keyboard, and display methods.
Connect to an LLM
Give an LLM the ability to control a desktop by wiring up ComputerBox to function calling.

