github / github/copilot-cli

`copilot` should not use whatever valid token it can find if I set `GITHUB_TOKEN`

Abierto
#237 0 comentarios 0 reacciones 0 asignados Ver en GitHub
area:authentication
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

### Describe the feature or problem you'd like to solve

If I try to auth via env var, I expect `copilot` to use it even if it is invalid, and not to fallback to another source like the keyring or `gh`. This can result in highly confusing behaviour when scopes or accessible resources are different.

### Proposed solution

`copilot` should error, indicating that the token in was invalid.

### Example prompts or workflows

```
➜ runc git:(main) GITHUB_TOKEN=foo copilot -p "hello"
● Hello! I'm GitHub Copilot CLI, ready to help you with tasks in your runc repository. What would
you like to do?

Total usage est: 1 Premium request
Total duration (API): 3.4s
Total duration (wall): 5.2s
Total code changes: 0 lines added, 0 lines removed
Usage by model:
claude-sonnet-4.5 5.9k input, 33 output, 2.1k cache read, 3.8k cache write (Est. 1 Premium request)
```

### Additional context

_No response_

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.