# OpenHands Cloud

> Create and manage OpenHands Cloud conversations from the CLI

## Overview

The OpenHands CLI provides commands to interact with [OpenHands Cloud](/openhands/usage/cloud/openhands-cloud) directly from your terminal. You can:

* Authenticate with your OpenHands Cloud account
* Create new cloud conversations
* Use cloud resources without the web interface

## Authentication

### Login

Authenticate with OpenHands Cloud using OAuth 2.0 Device Flow:

```bash  theme={null}
openhands login
```

This opens a browser window for authentication. After successful login, your credentials are stored locally.

#### Custom Server URL

For self-hosted or enterprise deployments:

```bash  theme={null}
openhands login --server-url https://your-openhands-server.com
```

You can also set the server URL via environment variable:

```bash  theme={null}
export OPENHANDS_CLOUD_URL=https://your-openhands-server.com
openhands login
```

### Logout

Log out from OpenHands Cloud:

```bash  theme={null}
# Log out from all servers
openhands logout

# Log out from a specific server
openhands logout --server-url https://app.all-hands.dev
```

## Creating Cloud Conversations

Create a new conversation in OpenHands Cloud:

```bash  theme={null}
# With a task
openhands cloud -t "Review the codebase and suggest improvements"

# From a file
openhands cloud -f task.txt
```

### Options

| Option             | Description                                                                            |
| ------------------ | -------------------------------------------------------------------------------------- |
| `-t, --task TEXT`  | Initial task to seed the conversation                                                  |
| `-f, --file PATH`  | Path to a file whose contents seed the conversation                                    |
| `--server-url URL` | OpenHands server URL (default: [https://app.all-hands.dev](https://app.all-hands.dev)) |

### Examples

```bash  theme={null}
# Create a cloud conversation with a task
openhands cloud -t "Fix the authentication bug in login.py"

# Create from a task file
openhands cloud -f requirements.txt

# Use a custom server
openhands cloud --server-url https://custom.server.com -t "Add unit tests"

# Combine with environment variable
export OPENHANDS_CLOUD_URL=https://enterprise.openhands.dev
openhands cloud -t "Refactor the database module"
```

## Workflow

A typical workflow with OpenHands Cloud:

1. **Login once**:
   ```bash  theme={null}
   openhands login
   ```

2. **Create conversations as needed**:
   ```bash  theme={null}
   openhands cloud -t "Your task here"
   ```

3. **Continue in the web interface** at [app.all-hands.dev](https://app.all-hands.dev) or your custom server

## Environment Variables

| Variable              | Description                             |
| --------------------- | --------------------------------------- |
| `OPENHANDS_CLOUD_URL` | Default server URL for cloud operations |

## Cloud vs Local

| Feature       | Cloud (`openhands cloud`) | Local (`openhands`)     |
| ------------- | ------------------------- | ----------------------- |
| Compute       | Cloud-hosted              | Your machine            |
| Persistence   | Cloud storage             | Local files             |
| Collaboration | Share via link            | Local only              |
| Setup         | Just login                | Configure LLM & runtime |
| Cost          | Subscription/usage-based  | Your LLM API costs      |

<Tip>
  Use OpenHands Cloud for collaboration, on-the-go access, or when you don't want to manage infrastructure. Use the local CLI for privacy, offline work, or custom configurations.
</Tip>

## See Also

* [OpenHands Cloud](/openhands/usage/cloud/openhands-cloud) - Full cloud documentation
* [Cloud UI](/openhands/usage/cloud/cloud-ui) - Web interface guide
* [Cloud API](/openhands/usage/cloud/cloud-api) - Programmatic access


---

> To find navigation and other pages in this documentation, fetch the llms.txt file at: https://docs.openhands.dev/llms.txt