-
Notifications
You must be signed in to change notification settings - Fork 3.9k
docs: improve Claude installation guide with Windows PowerShell support #2312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -37,11 +37,17 @@ echo -e ".env\n.mcp.json" >> .gitignore | |||||||
| claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}' | ||||||||
| ``` | ||||||||
|
|
||||||||
| With an environment variable: | ||||||||
| With an environment variable (Linux/macOS): | ||||||||
| ```bash | ||||||||
| claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer '"$(grep GITHUB_PAT .env | cut -d '=' -f2)"'"}}' | ||||||||
| ``` | ||||||||
|
|
||||||||
| With an environment variable (Windows PowerShell): | ||||||||
| ```powershell | ||||||||
| $env:GITHUB_PAT = (Get-Content .env | Select-String "^GITHUB_PAT=").ToString().Split("=")[1] | ||||||||
|
||||||||
| $env:GITHUB_PAT = (Get-Content .env | Select-String "^GITHUB_PAT=").ToString().Split("=")[1] | |
| $githubPatLine = Get-Content .env | Select-String "^\s*GITHUB_PAT\s*=" | Select-Object -First 1 | |
| $env:GITHUB_PAT = ($githubPatLine.Line -split "=", 2)[1].Trim().Trim('"').Trim("'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Linux/macOS example is labeled as using an environment variable, but it actually reads the token directly from
.envviagrep/cutand inlines it into the JSON. Either rename this section to indicate it reads from.env, or setGITHUB_PATas an env var first and then reference it so the heading matches the command.