[
    {
        "role": "user",
        "content": "how%20to%20install%20copilot%20cli%20on%20windows%3F"
    },
    {
        "role": "assistant",
        "content": "Here\u2019s how you install **GitHub Copilot CLI** on Windows, step by step\u2014all based on the latest official docs (as of Spring 2026):\n\n---\n\n## What you\u2019ll need first\n\n- **A GitHub Copilot subscription**\u2014Pro, Pro+, Business, or Enterprise. ([github.com](https://github.com/features/copilot/cli/?utm_source=openai))  \n- **PowerShell v6+** installed. ([docs.github.com](https://docs.github.com/copilot/how-tos/set-up/installing-github-copilot-in-the-cli?utm_source=openai))  \n- **Node.js v22+** (includes npm v10+). If you want to use the npm-based install method. ([github.blog](https://github.blog/ai-and-ml/github-copilot/github-copilot-cli-how-to-get-started/?utm_source=openai))  \n\n---\n\n## Ways to install Copilot CLI on Windows\n\nYou have several options depending on what you prefer or already have configured:\n\n| Method | What you need first | Install command / steps |\n|---|---|---|\n| **WinGet** | Running Windows 10/11 with WinGet available (latest version). | Open PowerShell and run:<br>`winget install GitHub.Copilot`<br>To get the prerelease version:<br>`winget install GitHub.Copilot.Prerelease` ([docs.github.com](https://docs.github.com/copilot/how-tos/set-up/installing-github-copilot-in-the-cli?utm_source=openai)) |\n| **npm (Node.js)** | Node.js v22+ installed. | In any terminal (PowerShell, Windows Terminal, etc.):<br>`npm install -g @github/copilot`<br>Prerelease version:<br>`npm install -g @github/copilot@prerelease` ([docs.github.com](https://docs.github.com/copilot/how-tos/set-up/installing-github-copilot-in-the-cli?utm_source=openai)) |\n| **Homebrew** | If you also use WSL (Windows Subsystem for Linux) or a Linux-like environment. | `brew install copilot-cli` or `<...>@prerelease` version. ([docs.github.com](https://docs.github.com/copilot/how-tos/set-up/installing-github-copilot-in-the-cli?utm_source=openai)) |\n| **Download executable** | If you don\u2019t want npm or WinGet. | Head to the GitHub `copilot-cli` repo, get the Windows executable, unzip / unpack, drop in a folder on your PATH. ([docs.github.com](https://docs.github.com/copilot/how-tos/set-up/installing-github-copilot-in-the-cli?utm_source=openai)) |\n\n---\n\n## Activating and logging in\n\nAfter you\u2019ve installed it\u2026\n\n1. Open your terminal.\n2. Run:\n\n   ```\n   copilot\n   ```\n\n   If you're not already logged into GitHub, it\u2019ll prompt you to run:\n\n   ```\n   /login\n   ```\n\n   Follow that flow to authenticate with your GitHub account. ([docs.github.com](https://docs.github.com/copilot/how-tos/set-up/installing-github-copilot-in-the-cli?utm_source=openai))\n\n3. You can also use a **fine-grained personal access token** with `\"Copilot Requests\"` permission enabled, and set it via environment variable `GH_TOKEN` or `GITHUB_TOKEN`. ([docs.github.com](https://docs.github.com/copilot/how-tos/set-up/installing-github-copilot-in-the-cli?utm_source=openai))\n\n---\n\n## Notes & common issues\n\n- The Copilot CLI is officially supported on Windows **via WSL**. If you're using pure PowerShell or CMD, you might run into more issues, though npm + PowerShell v6+ is supported in many cases. ([github.com](https://github.com/features/copilot/cli/?utm_source=openai))  \n- Make sure policies (if you're in an org) allow using Copilot in the CLI. Sometimes admins disable it. ([docs.github.com](https://docs.github.com/copilot/how-tos/set-up/installing-github-copilot-in-the-cli?utm_source=openai))  \n- If you're updating, you can rerun the same install command. For example, with npm:  \n  ```\n  npm install -g @github/copilot@latest\n  ```\n  or use WinGet\u2019s update flow. ([docs.github.com](https://docs.github.com/copilot/how-tos/set-up/installing-github-copilot-in-the-cli?utm_source=openai))\n\n---\n\nIf you tell me whether you prefer WinGet, npm, or manually installing, I can send you commands customized to your setup!"
    },
    {
        "role": "user",
        "content": "when%20i%20run%20copilot%20from%20command%20prompt%2C%20it%20launches%20a%20browser%2C%20i%20login%2C%20but%20it%20doesn%27t%20seem%20to%20save%20it%20to%20the%20copilot%20cli"
    },
    {
        "role": "assistant",
        "content": "Here are possible reasons the GitHub Copilot CLI doesn\u2019t seem to remember your login, and how to fix them. All info is taken from GitHub\u2019s official documentation and recent issues. ([docs.github.com](https://docs.github.com/en/enterprise-cloud%40latest/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli?utm_source=openai))\n\n---\n\n## What you should expect\n\n- After you run `copilot login` (or `/login` inside Copilot CLI), a browser opens and lets you authorize via OAuth. Once that goes through correctly, Copilot CLI should store the token. On Windows, that\u2019s in **Windows Credential Manager**. ([docs.github.com](https://docs.github.com/en/enterprise-cloud%40latest/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli?utm_source=openai))  \n- Also, GitHub CLI (`gh`) auth status can be used as fallback if no other credentials are found. ([docs.github.com](https://docs.github.com/en/enterprise-cloud%40latest/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli?utm_source=openai))  \n\n---\n\n## Why login might not be \u201csticking\u201d\n\nHere are frequent causes when Copilot CLI doesn\u2019t seem to stay logged in:\n\n| Problem | Symptoms / Clues | What to do |\n|---|---|---|\n| **Keychain / Credential Manager issues** | - The login completes via browser, but Copilot CLI still says \u201cnot logged in.\u201d<br>- Errors like \u201csystem keychain unavailable.\u201d ([docs.github.com](https://docs.github.com/de/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth?utm_source=openai)) | Open Windows **Credential Manager** (Control Panel \u2192 Credential Manager) and check whether there\u2019s an entry \u201ccopilot-cli\u201d. If not, Copilot couldn\u2019t write the token there. Fix permissions or try running as admin. |\n| **Environment variable is overriding stored token** | If `COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, or `GITHUB_TOKEN` is set (even if wrong or expired), Copilot CLI uses that instead of stored OAuth token. ([docs.github.com](https://docs.github.com/en/enterprise-cloud%40latest/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli?utm_source=openai)) | Check with:`echo $env:GH_TOKEN` (in PowerShell) or `echo %GH_TOKEN%` (in CMD). If set and invalid, you can clear it, or ensure it has a valid token. |\n| **Using classic PATs (`ghp_`)** | Copilot CLI ignores \u201cclassic\u201d personal access tokens and behaves like you\u2019re not logged in. The token won\u2019t work. ([docs.github.com](https://docs.github.com/de/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth?utm_source=openai)) | Generate a **fine-grained PAT** with the right scopes: must include *Copilot Requests* permission. Then use that via login flow or set it in environment variable. |\n| **Wrong account or policy** | You might be logged into GitHub website, but Copilot CLI is looking for a token tied to a different account, or your account isn\u2019t permitted (or subscription expired). ([docs.github.com](https://docs.github.com/de/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth?utm_source=openai)) | Check your GitHub subscription, organization policies. Use Copilot CLI\u2019s `/user list` or `/user switch` inside the CLI to see which account is active. |\n| **Credential store problems** | If Windows Credential Manager is locked, corrupted, or somehow inaccessible (maybe by group policy or security tools), Copilot CLI can\u2019t store token securely. ([docs.github.com](https://docs.github.com/en/enterprise-cloud%40latest/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli?utm_source=openai)) | Ensure Credential Manager service is running. If not, let Copilot CLI prompt you to store in plaintext (`$HOME\\.copilot\\config.json`) and approve that. |\n\n---\n\n## How to check what Copilot CLI sees\n\n1. Open a fresh terminal (PowerShell or CMD).  \n2. Run:  \n   ```sh\n   copilot user list\n   ```\n   This shows which GitHub accounts Copilot CLI has stored. If none, you\u2019re not really logged in. ([docs.github.com](https://docs.github.com/en/enterprise-cloud%40latest/copilot/how-tos/copilot-cli/set-up-copilot-cli/authenticate-copilot-cli?utm_source=openai))  \n\n3. Also try:\n   ```sh\n   copilot login\n   ```\n   or start Copilot CLI and run `/login` inside. Make sure you complete authorization fully in the browser. Sometimes you might close the browser tab prematurely.  \n\n4. If you're using env-vars like `GH_TOKEN`, ensure they have valid **fine-grained** tokens.  \n\n---\n\n## What to do to fix it\n\nHere\u2019s a checklist to resolve the issue:\n\n- Clear environment variables that might interfere: `GH_TOKEN`, `GITHUB_TOKEN`, `COPILOT_GITHUB_TOKEN`.  \n- Run `copilot login` again. Let it complete the OAuth flow fully.  \n- Check in **Windows Credential Manager** whether \u201ccopilot-cli\u201d exists and contains an access token.  \n- If Credential Manager fails or is blocked, accept plaintext storage when prompted (this puts token in `%USERPROFILE%\\.copilot\\config.json`). ([docs.github.com](https://docs.github.com/de/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth?utm_source=openai))  \n- Make sure the token or OAuth permission includes \u201cCopilot Requests\u201d. Tokens without that will be rejected silently. ([docs.github.com](https://docs.github.com/de/copilot/how-tos/copilot-cli/set-up-copilot-cli/troubleshoot-copilot-cli-auth?utm_source=openai))  \n\n---\n\nIf you're willing, I can walk you through the exact commands and checks on your machine to verify what\u2019s going wrong\u2014just tell me whether you're using PowerShell, CMD, or WSL."
    }
]