Skip to content

Login to Github Enterprise Cloud non-interactivly doesn't work #296

@Xaseron

Description

@Xaseron

Describe the bug

I want to use copilot cli non-interactivly with GHE. It is either not documented how to do it or it is broken. When i set export GITHUB_HOST=octocorp.ghe.com and GH_TOKEN the GITHUB_HOST gets ignored and it still tries to log into github.com

% cat log/session-2de987b2-73d0-4296-b3fb-cb3c10dcd070.log
2025-10-14T08:19:05.923Z [START-GROUP] gh auth token --hostname github.com
2025-10-14T08:19:07.031Z [DEBUG] ******

2025-10-14T08:19:07.031Z [END-GROUP]
2025-10-14T08:19:07.031Z [DEBUG] GitHub CLI authenticated with valid token
2025-10-14T08:19:08.507Z [START-GROUP] gh auth token --hostname github.com
2025-10-14T08:19:09.065Z [DEBUG] ******

2025-10-14T08:19:09.065Z [END-GROUP]
2025-10-14T08:19:09.066Z [DEBUG] GitHub CLI authenticated with valid token

Affected version

0.0.340

Steps to reproduce the behavior

  1. export GITHUB_HOST=octocorp.ghe.com
  2. export GH_TOKEN=****
  3. copilot -p "hey"

Expected behavior

Login non-interactivly to Github Enterprise Cloud with GITHUB_HOST or copilot parameter

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions