> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hopx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Desktop Automation

> Desktop automation resource for sandbox GUI interactions, screenshots, and VNC access in HopX using the JavaScript/TypeScript SDK. Complete reference for the Desktop class including async methods for VNC servers, screenshots, mouse and keyboard control, window management, and clipboard operations. Includes TypeScript examples for desktop automation.

**Version:** 0.1.22\
**Last Verified:** 2025-01-27\
**Package:** `@hopx-ai/sdk` on [npm](https://www.npmjs.com/package/@hopx-ai/sdk)

## Overview

The `Desktop` resource provides desktop automation capabilities for sandboxes with GUI support.

<Note>
  Desktop features require a desktop-enabled template. Not all templates support desktop operations.
</Note>

## Methods

### VNC Methods

* `async desktop.startVnc(): Promise<VNCInfo>`
* `async desktop.stopVnc(): Promise<void>`
* `async desktop.getVncInfo(): Promise<VNCInfo>`
* `async desktop.getVncUrl(): Promise<string>`

### Mouse Methods

* `async desktop.mouseClick(x: number, y: number, options?: MouseClickOptions): Promise<void>`
* `async desktop.mouseMove(x: number, y: number): Promise<void>`
* `async desktop.mouseDrag(fromX: number, fromY: number, toX: number, toY: number): Promise<void>`
* `async desktop.mouseScroll(x: number, y: number, deltaY: number): Promise<void>`

### Keyboard Methods

* `async desktop.keyboardType(text: string): Promise<void>`
* `async desktop.keyboardPress(key: string): Promise<void>`
* `async desktop.keyboardCombination(keys: string[]): Promise<void>`

### Screenshot Methods

* `async desktop.screenshot(): Promise<ScreenshotResponse>`
* `async desktop.screenshotRegion(x: number, y: number, width: number, height: number): Promise<Buffer>`

***

## Related Classes

* **[Sandbox](/sdk/javascript/sandbox)** - Main sandbox class

## Related

* **[Python SDK: Desktop](/sdk/python/desktop)** - Python SDK desktop automation
* **[VNC Server](/core-concepts/desktop/vnc-server)** - Learn about VNC access
* **[Screenshots](/core-concepts/desktop/screenshots)** - Capture screenshots

## Next Steps

* Learn about [VNC Server](/core-concepts/desktop/vnc-server) for remote desktop access
* Explore [Screenshots](/core-concepts/desktop/screenshots) for visual verification
* Review [Mouse Control](/core-concepts/desktop/mouse-control) and [Keyboard Control](/core-concepts/desktop/keyboard-control) for GUI automation
* **[Types](/sdk/javascript/types)** - TypeScript type definitions
* **[CLI System Commands](/cli/commands/system)** - System operations from CLI

## See Also

* [Core Concepts: Desktop](/core-concepts/desktop) - Learn about desktop automation
* [Sandbox Class](/sdk/javascript/sandbox) - Access desktop via `sandbox.desktop`
