# Source: https://www.daytona.io/docs/en/computer-use-linux.md

**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 for most tasks.

## Common Use Cases

- **GUI Application Testing** - Automate interactions with desktop 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 desktop tasks, file management through GUI, and complex workflows
- **Human-in-the-Loop** - Access the VNC interface directly from the [Daytona Dashboard](https://app.daytona.io/dashboard/sandboxes) to manually control and interact with the desktop environment alongside automated scripts

## SDK References

Choose your preferred SDK to get started with computer use automation:

### TypeScript SDK
Complete API reference for computer use operations in TypeScript.

[View TypeScript SDK →](https://www.daytona.io/docs/en/typescript-sdk/computer-use.md)

### Python SDK  
Complete API reference for computer use operations in Python (sync & async).

[View Python SDK →](https://www.daytona.io/docs/en/python-sdk/sync/computer-use.md)

## Quick Example

    ```python
    from daytona import Daytona

    # Initialize using environment variables (recommended)
    daytona = Daytona()
    # Or explicitly configure:
    # daytona = Daytona(
    #     api_key=os.getenv('DAYTONA_API_KEY'),
    #     api_url=os.getenv('DAYTONA_API_URL', 'https://app.daytona.io/api')
    # )

    # Create sandbox from default snapshot (includes desktop environment)
    sandbox = daytona.create()

    # Start computer use processes
    result = sandbox.computer_use.start()
    print("Computer use started:", result.message)

    # Take a screenshot
    screenshot = sandbox.computer_use.screenshot.take_full_screen()

    # Click and type
    sandbox.computer_use.mouse.click(100, 200)
    sandbox.computer_use.keyboard.type('Hello, Linux!')
    sandbox.computer_use.keyboard.hotkey('ctrl+s')
    ```

    ```typescript
    import { Daytona } from '@daytonaio/sdk';

    // Initialize using environment variables (recommended)
    const daytona = new Daytona();
    // Or explicitly configure:
    // const daytona = new Daytona({
    //     apiKey: process.env.DAYTONA_API_KEY,
    //     apiUrl: process.env.DAYTONA_API_URL || 'https://app.daytona.io/api'
    // });

    // Create sandbox from default snapshot (includes desktop environment)
    const sandbox = await daytona.create();

    // Start computer use processes
    await sandbox.computerUse.start();

    // Take a screenshot
    const screenshot = await sandbox.computerUse.screenshot.takeFullScreen();

    // Click and type
    await sandbox.computerUse.mouse.click(100, 200);
    await sandbox.computerUse.keyboard.type('Hello, Linux!');
    await sandbox.computerUse.keyboard.hotkey('ctrl+s');
    ```

**Environment Variables (.env file):**
```bash
DAYTONA_API_KEY=your-api-key-here
DAYTONA_API_URL=https://app.daytona.io/api
```

## Related Documentation

- [Computer Use - Windows](https://www.daytona.io/docs/en/computer-use-windows.md)  
- [Computer Use - macOS](https://www.daytona.io/docs/en/computer-use-macos.md)