Skip to content

Can't login with GH_TOKEN in Copilot CLI if gh is not installed #799

@2-5

Description

@2-5

Describe the bug

I am setting up Copilot CLI in a basic Ubuntu VM, using a GH_TOKEN with the Copilot Requests permission and copilot doesn't pick it up.

It seems it's because this VM doesn't have gh installed. There is no error reported in Copilot itself, only in logs, and the documentation doesn't mention that you also need to install gh when using GH_TOKEN.

2025-12-16T21:02:13.874Z [INFO] Starting Copilot CLI: 0.0.369
Commit: 83653a1
2025-12-16T21:02:13.874Z [INFO] Node.js version: v24.12.0
2025-12-16T21:02:14.135Z [INFO] Login status unknown
2025-12-16T21:02:14.160Z [ERROR] Error checking for updates: TypeError: Cannot read properties of undefined (reading 'paths')
2025-12-16T21:02:14.303Z [ERROR] Failed to fetch PAT user login (401): Failed to fetch user info:
2025-12-16T21:02:14.306Z [ERROR] Error: spawn gh ENOENT
2025-12-16T21:02:14.451Z [ERROR] Failed to fetch PAT user login (401): Failed to fetch user info:
2025-12-16T21:02:14.455Z [ERROR] Error: spawn gh ENOENT
2025-12-16T21:02:14.460Z [ERROR] Failed to fetch PAT user login (401): Failed to fetch user info:
2025-12-16T21:02:14.463Z [ERROR] Error: spawn gh ENOENT
2025-12-16T21:02:14.463Z [INFO] Logged out

Affected version

0.0.369 Commit: 83653a1

Steps to reproduce the behavior

  1. install copilot CLI in a basic Ubuntu Server 24
  2. gh is not installed on the machine
  3. set GH_TOKEN with a valid PAT
  4. start copilot

Expected behavior

it should login using GH_TOKEN, but it's not, without showing any error

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions