You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/usage/cloud/cloud-api.md
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# OpenHands Cloud API
2
2
3
-
OpenHands Cloud provides a REST API that allows you to programmatically interact with the service. This is useful if you easily want to kick off your own jobs from your programs in a flexible way.
3
+
OpenHands Cloud provides a REST API that allows you to programmatically interact with the service. This is useful if
4
+
you want to kick off your own jobs from your programs in a flexible way.
4
5
5
6
This guide explains how to obtain an API key and use the API to start conversations.
6
7
For more detailed information about the API, refer to the [OpenHands API Reference](https://docs.all-hands.dev/swagger-ui/).
@@ -9,27 +10,27 @@ For more detailed information about the API, refer to the [OpenHands API Referen
9
10
10
11
To use the OpenHands Cloud API, you'll need to generate an API key:
11
12
12
-
1. Log in to your [OpenHands Cloud](https://app.all-hands.dev) account
13
-
2. Navigate to the [Settings page](https://app.all-hands.dev/settings)
14
-
3.Locate the "API Keys" section
15
-
4. Click "Generate New Key"
16
-
5. Give your key a descriptive name (e.g., "Development", "Production")
17
-
6. Copy the generated API key and store it securely - it will only be shown once
13
+
1. Log in to your [OpenHands Cloud](https://app.all-hands.dev) account.
14
+
2. Navigate to the [Settings page](https://app.all-hands.dev/settings).
15
+
3.Select the `API Keys` tab.
16
+
4. Click `Create API Key`.
17
+
5. Give your key a descriptive name (Example: "Development" or "Production") and select `Create`.
18
+
6. Copy the generated API key and store it securely. It will only be shown once.
OpenHands can be run in an interactive CLI mode, which allows users to start an interactive session via the command line.
3
+
CLI mode provides a powerful interactive Command-Line Interface (CLI) that lets you engage with OpenHands directly
4
+
from your terminal.
4
5
5
6
This mode is different from the [headless mode](headless-mode), which is non-interactive and better for scripting.
6
7
7
-
## With Python
8
+
## Getting Started
8
9
9
-
To start an interactive OpenHands session via the command line:
10
+
### Running with Python
10
11
11
12
1. Ensure you have followed the [Development setup instructions](https://github.com/All-Hands-AI/OpenHands/blob/main/Development.md).
12
-
2. Run the following command:
13
+
2. Set your model, API key, and other preferences using environment variables or with the [`config.toml`](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml) file.
14
+
3. Launch an interactive OpenHands conversation from the command line:
13
15
14
16
```bash
15
-
poetry run python -m openhands.core.cli
17
+
poetry run python -m openhands.cli.main
16
18
```
17
19
18
20
Example:
19
21
```bash
20
-
poetry run python -m openhands.core.cli -t "Print 'Hello, World'" --no-auto-continue
22
+
poetry run python -m openhands.cli.main -t "Print 'Hello, World'" --no-auto-continue
21
23
```
22
24
23
-
This command will start an interactive session where you can input tasks and receive responses from OpenHands.
24
-
25
-
You'll need to be sure to set your model, API key, and other settings via environment variables
26
-
[or the `config.toml` file](https://github.com/All-Hands-AI/OpenHands/blob/main/config.template.toml).
27
-
28
-
## With Docker
25
+
This command opens an interactive prompt where you can type tasks or commands and get responses from OpenHands.
29
26
30
-
To run OpenHands in CLI mode with Docker:
27
+
### Running with Docker
31
28
32
-
1. Set the following environmental variables in your terminal:
29
+
1. Set the following environment variables in your terminal:
30
+
-`SANDBOX_VOLUMES` to specify the directory you want OpenHands to access ([See using SANDBOX_VOLUMES for more info](../runtimes/docker#using-sandbox_volumes))
31
+
-`LLM_MODEL` - the LLM model to use (e.g. `export LLM_MODEL="anthropic/claude-3-7-sonnet-20250219"`)
32
+
-`LLM_API_KEY` - your API key (e.g. `export LLM_API_KEY="sk_test_12345"`)
33
33
34
-
-`SANDBOX_VOLUMES` to specify the directory you want OpenHands to access (Ex: `export SANDBOX_VOLUMES=$(pwd)/workspace:/workspace:rw`).
35
-
- The agent works in `/workspace` by default, so mount your project directory there if you want the agent to modify files.
36
-
- For read-only data, use a different mount path (Ex: `export SANDBOX_VOLUMES=$(pwd)/workspace:/workspace:rw,/path/to/large/dataset:/data:ro`).
37
-
-`LLM_MODEL` to the model to use (Ex: `export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"`).
38
-
-`LLM_API_KEY` to the API key (Ex: `export LLM_API_KEY="sk_test_12345"`).
|`/help`| Show all available interactive commands and their descriptions |
75
+
|`/exit`| Exit the application |
76
+
|`/init`| Initialize a new repository for agent exploration |
77
+
|`/status`| Show conversation details and usage metrics |
78
+
|`/new`| Start a new conversation |
79
+
|`/settings`| View and modify current LLM/agent settings |
80
+
|`/resume`| Resume the agent if paused |
81
+
82
+
#### Settings and Configuration
83
+
84
+
You can update your model, API key, agent, and other preferences interactively using the `/settings` command. Just
85
+
follow the prompts:
86
+
87
+
-**Basic settings**: Choose a model/provider and enter your API key.
88
+
-**Advanced settings**: Set custom endpoints, enable or disable confirmation mode, and configure memory condensation.
89
+
90
+
Settings can also be managed via the `config.toml` file.
91
+
92
+
#### Repository Initialization
93
+
94
+
The `/init` command helps the agent understand your project by creating a `.openhands/microagents/repo.md` file with
95
+
project details and structure. Use this when onboarding the agent to a new codebase.
96
+
97
+
#### Agent Pause/Resume Feature
98
+
99
+
You can pause the agent while it is running by pressing `Ctrl-P`. To continue the conversation after pausing, simply
100
+
type `/resume` at the prompt.
101
+
102
+
## Tips and Troubleshooting
103
+
104
+
- Use `/help` at any time to see the list of available commands.
105
+
- If you encounter permission issues, make sure your workspace directory is trusted and all required environment variables are set correctly.
106
+
- For advanced LLM configuration, use the advanced options in `/settings`.
107
+
- When confirmation mode is enabled, the CLI will prompt before sensitive operations. You can type `a` or `always` at the first confirmation prompt to automatically confirm subsequent actions for the current conversation.
108
+
- If you want to start over, use `/new` to begin a fresh conversation without restarting the CLI.
59
109
60
-
The `-e SANDBOX_USER_ID=$(id -u)` is passed to the Docker command to ensure the sandbox user matches the host user’s
61
-
permissions. This prevents the agent from creating root-owned files in the mounted workspace.
Copy file name to clipboardExpand all lines: docs/modules/usage/how-to/gui-mode.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,8 +39,9 @@ OpenHands automatically exports a `GITHUB_TOKEN` to the shell environment if pro
39
39
- Minimal Permissions ( Select `Meta Data = Read-only` read for search, `Pull Requests = Read and Write` and `Content = Read and Write` for branch creation)
40
40
2.**Enter Token in OpenHands**:
41
41
- Click the Settings button (gear icon).
42
+
- Navigate to the `Git` tab.
42
43
- Paste your token in the `GitHub Token` field.
43
-
- Click `Save` to apply the changes.
44
+
- Click `Save Changes` to apply the changes.
44
45
</details>
45
46
46
47
<details>
@@ -98,9 +99,9 @@ OpenHands automatically exports a `GITLAB_TOKEN` to the shell environment if pro
98
99
- Set an expiration date or leave it blank for a non-expiring token.
99
100
2.**Enter Token in OpenHands**:
100
101
- Click the Settings button (gear icon).
102
+
- Navigate to the `Git` tab.
101
103
- Paste your token in the `GitLab Token` field.
102
-
- Enter your GitLab instance URL if using self-hosted GitLab.
103
-
- Click `Save` to apply the changes.
104
+
- Click `Save Changes` to apply the changes.
104
105
</details>
105
106
106
107
<details>
@@ -112,7 +113,6 @@ OpenHands automatically exports a `GITLAB_TOKEN` to the shell environment if pro
112
113
- Ensure the token is properly saved in settings.
113
114
- Check that the token hasn't expired.
114
115
- Verify the token has the required scopes.
115
-
- For self-hosted instances, verify the correct instance URL.
116
116
117
117
-**Access Denied**:
118
118
- Verify project access permissions.
@@ -122,7 +122,7 @@ OpenHands automatically exports a `GITLAB_TOKEN` to the shell environment if pro
122
122
123
123
### Advanced Settings
124
124
125
-
1. Inside the Settings page, toggle `Advanced` options to access additional settings.
125
+
1. Inside the Settings page, under the `LLM` tab, toggle `Advanced` options to access additional settings.
126
126
2. Use the `Custom Model` text box to manually enter a model if it's not in the list.
127
127
3. Specify a `Base URL` if required by your LLM provider.
Copy file name to clipboardExpand all lines: docs/modules/usage/how-to/headless-mode.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,10 @@ You'll need to be sure to set your model, API key, and other settings via enviro
21
21
22
22
To run OpenHands in Headless mode with Docker:
23
23
24
-
1. Set the following environmental variables in your terminal:
25
-
26
-
-`SANDBOX_VOLUMES` to specify the directory you want OpenHands to access (Ex: `export SANDBOX_VOLUMES=$(pwd)/workspace:/workspace:rw`).
27
-
- The agent works in `/workspace` by default, so mount your project directory there if you want the agent to modify files.
28
-
- For read-only data, use a different mount path (Ex: `export SANDBOX_VOLUMES=$(pwd)/workspace:/workspace:rw,/path/to/large/dataset:/data:ro`).
29
-
-`LLM_MODEL` to the model to use (Ex: `export LLM_MODEL="anthropic/claude-3-5-sonnet-20241022"`).
30
-
-`LLM_API_KEY` to the API key (Ex: `export LLM_API_KEY="sk_test_12345"`).
24
+
1. Set the following environment variables in your terminal:
25
+
-`SANDBOX_VOLUMES` to specify the directory you want OpenHands to access ([See using SANDBOX_VOLUMES for more info](../runtimes/docker#using-sandbox_volumes))
26
+
-`LLM_MODEL` - the LLM model to use (e.g. `export LLM_MODEL="anthropic/claude-3-7-sonnet-20250219"`)
27
+
-`LLM_API_KEY` - your API key (e.g. `export LLM_API_KEY="sk_test_12345"`)
0 commit comments