Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Docs : adding in github fine grained tokens documentation and settings link to documentation … (#7192)

Jason Burt8a7318480161
diff --git a/docs/modules/usage/how-to/gui-mode.md b/docs/modules/usage/how-to/gui-mode.md
index b50d1aeef0..cd0b2244f4 100644
--- a/docs/modules/usage/how-to/gui-mode.md
+++ b/docs/modules/usage/how-to/gui-mode.md
@@ -21,14 +21,18 @@ OpenHands provides a Graphical User Interface (GUI) mode for interacting with th
OpenHands automatically exports a `GITHUB_TOKEN` to the shell environment if it is available. This can happen in two ways:
-- **Local Installation**: The user directly inputs their GitHub token.
+**Local Installation**: The user directly inputs their GitHub token.
<details>
<summary>Setting Up a GitHub Token</summary>
+
1. **Generate a Personal Access Token (PAT)**:
- On GitHub, go to Settings > Developer Settings > Personal Access Tokens > Tokens (classic).
- - Click `Generate new token (classic)`.
- - Required scopes:
+ - **New token (classic)**
+ - Required scopes:
- `repo` (Full control of private repositories)
+ - **Fine-Grained Tokens**
+ - All Repositories (You can select specific repositories, but this will impact what returns in repo search)
+ - Minimal Permissions ( Select **Meta Data = Read-only** read for search, **Pull Requests = Read and Write**, **Content = Read and Write** for branch creation)
2. **Enter Token in OpenHands**:
- Click the Settings button (gear icon).
- Navigate to the `GitHub Settings` section.
@@ -74,7 +78,7 @@ OpenHands automatically exports a `GITHUB_TOKEN` to the shell environment if it
- Check the browser console for any error messages.
</details>
-- **OpenHands Cloud**: The token is obtained through GitHub OAuth authentication.
+**OpenHands Cloud**: The token is obtained through GitHub OAuth authentication.
<details>
<summary>OAuth Authentication</summary>
diff --git a/frontend/src/routes/account-settings.tsx b/frontend/src/routes/account-settings.tsx
index 1f814e7ab4..7b6fc10dc2 100644
--- a/frontend/src/routes/account-settings.tsx
+++ b/frontend/src/routes/account-settings.tsx
@@ -409,13 +409,33 @@ function AccountSettings() {
}
placeholder={isGitHubTokenSet ? "**********" : ""}
/>
-
- <HelpLink
- testId="github-token-help-anchor"
- text="Get your token"
- linkText="here"
- href="https://github.com/settings/tokens/new?description=openhands-app&scopes=repo,user,workflow"
- />
+ <p data-testId="github-token-help-anchor" className="text-xs">
+ {" "}
+ Generate a token on{" "}
+ <b>
+ {" "}
+ <a
+ href="https://github.com/settings/tokens/new?description=openhands-app&scopes=repo,user,workflow"
+ target="_blank"
+ className="underline underline-offset-2"
+ rel="noopener noreferrer"
+ >
+ GitHub
+ </a>{" "}
+ </b>
+ or see the{" "}
+ <b>
+ <a
+ href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token"
+ target="_blank"
+ className="underline underline-offset-2"
+ rel="noopener noreferrer"
+ >
+ documentation
+ </a>
+ </b>
+ .
+ </p>
</>
)}