Typing animation

[![License: MIT](https://img.shields.io/badge/License-MIT-f97316.svg?style=for-the-badge)](https://github.com/deathlegionteamlk/herodesktop) [![PyPI](https://img.shields.io/pypi/v/herodesktop?style=for-the-badge&logo=python&logoColor=white&color=3b82f6)](https://pypi.org/project/herodesktop/) [![npm](https://img.shields.io/npm/v/herodesktop?style=for-the-badge&logo=npm&logoColor=white&color=ef4444)](https://www.npmjs.com/package/herodesktop) [![Built on E2B](https://img.shields.io/badge/Powered%20by-E2B-8b5cf6?style=for-the-badge)](https://e2b.dev) [![Built by](https://img.shields.io/badge/Built%20by-Death%20Legion%20Team-1e293b?style=for-the-badge)](https://github.com/deathlegionteamlk)
--- ## πŸ€” The problem AI agents that do "computer use" need somewhere to actually run. You can't point Claude or GPT at your own machine β€” that's a security disaster. You can't use a VM you provision manually every time β€” that's too slow. And you can't fake a desktop environment with mocks; agents break the moment the UI doesn't behave like a real one. HeroDesktop gives agents a real Linux desktop, isolated per-session, that you can spin up in code and tear down when you're done.
--- ## ⚑ Features
### πŸ–₯️ On-Demand Desktops Each `HeroDesktop.create()` call boots a fresh Linux desktop sandbox. No shared state between sessions. Agents start clean every time. ### πŸ“¦ Pre-installed Apps Chrome, Firefox, and VS Code are already in the image. Your agent can open a browser or editor without any setup step. ### πŸ“Ί VNC Live Streaming Watch what your agent is doing in real time. Stream the full desktop or lock it to a specific application window. ### πŸ” Secure Access Password protection and view-only mode are built in, so you can share a stream URL without handing over control. ### ⌨️ Full Input Control Mouse movement, clicks, drag-and-drop, scroll, and keyboard input all work exactly as they would on a physical machine. ### πŸ” Window Detection Detect which windows are open and target a specific one for streaming or interaction β€” no hardcoded coordinates needed. ### 🐍 Python + TypeScript SDKs One consistent API, two languages. The SDKs behave the same way so you're not context-switching between docs. ### πŸ”’ Isolated by Default Each sandbox is fully isolated. An agent crashing the desktop, or a site doing something unexpected, doesn't affect anything outside the container.
--- ## πŸ“¦ Install
**Python** ```bash pip install herodesktop ``` **JavaScript / TypeScript** ```bash npm install herodesktop ``` --- ## 🐍 Python quickstart ```python from herodesktop import HeroDesktop # Boot a fresh desktop sandbox desktop = HeroDesktop.create() # Open Chrome and navigate to a URL desktop.launch_chrome("https://e2b.dev") # Stream the desktop so you can watch what's happening url = desktop.start_streaming() print(f"Watch live: {url}") # Send keyboard input desktop.write("HeroDesktop works.") desktop.press("enter") # Done β€” shut it down desktop.shutdown() ``` --- ## 🟨 JavaScript / TypeScript quickstart ```javascript import { HeroDesktop } from 'herodesktop'; const desktop = await HeroDesktop.create(); // Open VS Code in the sandbox await desktop.launchVSCode(); // Find the VS Code window and stream only that const windows = await desktop.getWindows('code'); const url = await desktop.startStreaming({ windowId: windows[0] }); console.log(`Stream URL: ${url}`); await desktop.shutdown(); ``` --- ## 🧰 What you can build with it
| Use case | What HeroDesktop gives you | |---|---| | πŸ€– **Agent testing** | Isolated sandbox so a broken agent can't touch your actual machine | | 🌐 **Browser automation** | Chrome and Firefox ready to go, fully controllable | | πŸ’» **Cloud IDE for agents** | VS Code in a container, accessible over a stream URL | | πŸ“Š **Computer use benchmarks** | Reproducible, fresh desktop state for every eval run | | πŸ”„ **Workflow automation** | Agents that interact with real GUI apps, not mocked interfaces | --- ## πŸ—‚οΈ Examples The `examples/` folder has working code for common patterns: - **`basic.py`** β€” mouse and keyboard control from scratch - **`streaming_app.ts`** β€” multi-window detection and targeted streaming --- ## πŸ”§ How it works under the hood
``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ HeroDesktop Sandbox β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Xvfb │───▢│ Apps β”‚ β”‚ β”‚ β”‚ (virtual β”‚ β”‚ Chrome β”‚ β”‚ β”‚ β”‚ display) β”‚ β”‚ Firefox β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ VS Code β”‚ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β–Ό β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ x11vnc │───▢│ noVNC │──▢ Stream URL β”‚ β”‚ β”‚ (capture) β”‚ β”‚ (browser β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ viewer) β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ E2B Desktop Template β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β–² β”‚ Python SDK / TypeScript SDK β”‚ HeroDesktop.create() / .launch*() / .shutdown() ```
Xvfb handles the headless display. x11vnc captures it. noVNC turns that into a browser-accessible stream. E2B wraps the whole thing in an isolated container. The SDKs talk to that container through a consistent API so you don't have to think about any of it. --- ## 🀝 Contributing
Issues and PRs are open. If something's broken or missing, open an issue before starting work so we can align on direction. --- ## πŸ›‘οΈ License MIT Β© [Death Legion Team](https://github.com/deathlegionteamlk) ---
Footer typing