openclaw - ✅(Solved) Fix No non-interactive CLI path for github-copilot provider auth [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#50002Fetched 2026-04-08 01:00:23
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1

Error Message

Additionally, when --auth-choice github-copilot is passed in non-interactive mode today, it silently falls through and does nothing (no error, no config change).

Fix Action

Fixed

PR fix notes

PR #50003: onboard: add --github-copilot-token for non-interactive auth

Description (problem / solution / changelog)

Summary

  • Adds --github-copilot-token <token> flag to openclaw onboard --non-interactive for importing a pre-obtained GitHub OAuth access token (ghu_...) without requiring a TTY
  • Falls back to COPILOT_GITHUB_TOKEN / GH_TOKEN / GITHUB_TOKEN env vars when the flag is not provided
  • Normalizes tokens with normalizeSecretInput (strips embedded CR/LF, non-Latin1 chars)
  • Sets github-copilot/gpt-4o as the default model, matching the interactive device flow
  • Previously, --auth-choice github-copilot in non-interactive mode silently fell through with no error or config change

Uses the new plugin-manifest-driven architecture:

  • CLI flag registered automatically from manifest optionKey/cliFlag/cliOption
  • Auth-choice inference works automatically (passing only --github-copilot-token infers --auth-choice github-copilot)
  • No changes needed to core auth-choice.ts, auth-choice-inference.ts, or register.onboard.ts

Closes #50002

Test plan

  • tsgo — no new type errors
  • oxlint — 0 warnings, 0 errors on changed files
  • CLI registration test passes (7/7, +1 for new flag)
  • Happy path: stores token profile + sets default model
  • Inference: --github-copilot-token alone infers auth choice
  • Env var fallback: COPILOT_GITHUB_TOKEN works without flag
  • Missing token: clear error message
  • CR/LF normalization: embedded line breaks stripped

Changed files

  • extensions/github-copilot/index.ts (modified, +94/-2)
  • extensions/github-copilot/openclaw.plugin.json (modified, +5/-1)
  • src/commands/onboard-non-interactive.provider-auth.test.ts (modified, +95/-0)
  • src/commands/onboard-types.ts (modified, +1/-0)

Code Example

openclaw onboard --non-interactive --accept-risk \
  --auth-choice github-copilot \
  --github-copilot-token ghu_xxxxx \
  --skip-channels --skip-health
RAW_BUFFERClick to expand / collapse

Problem

There is no non-interactive CLI path to configure the github-copilot provider. The interactive flow runs the GitHub OAuth device flow, which requires a TTY. Automation environments (containers, CI, or external OAuth portals) that already have the OAuth access token (ghu_...) have no supported way to import it — they must manually write to auth-profiles.json and call openclaw config set, both undocumented internal formats.

Additionally, when --auth-choice github-copilot is passed in non-interactive mode today, it silently falls through and does nothing (no error, no config change).

Proposed solution

Add a --github-copilot-token <token> flag to openclaw onboard --non-interactive that accepts a pre-obtained GitHub OAuth access token and configures the github-copilot provider non-interactively, following the same pattern as other provider auth flags.

Example usage

openclaw onboard --non-interactive --accept-risk \
  --auth-choice github-copilot \
  --github-copilot-token ghu_xxxxx \
  --skip-channels --skip-health

extent analysis

Fix Plan

To address the issue, we will implement the proposed solution by adding a --github-copilot-token flag to the openclaw onboard --non-interactive command. This flag will accept a pre-obtained GitHub OAuth access token and configure the github-copilot provider non-interactively.

Code Changes

We need to update the openclaw command-line interface to include the new flag. Here's an example code snippet:

import argparse

# ...

parser = argparse.ArgumentParser()
# ...
parser.add_argument('--github-copilot-token', help='GitHub OAuth access token for github-copilot provider')
# ...

def onboard_non_interactive(args):
    # ...
    if args.github_copilot_token:
        # Configure github-copilot provider using the provided token
        configure_github_copilot(args.github_copilot_token)
    # ...

def configure_github_copilot(token):
    # Implement the logic to configure the github-copilot provider using the provided token
    # ...
    pass

Configuration Changes

No specific configuration changes are required, as the new flag will be used to configure the github-copilot provider programmatically.

Verification

To verify that the fix worked, you can run the openclaw onboard --non-interactive command with the new flag, like this:

openclaw onboard --non-interactive --accept-risk \
  --auth-choice github-copilot \
  --github-copilot-token ghu_xxxxx \
  --skip-channels --skip-health

If the command completes successfully, the github-copilot provider should be configured correctly using the provided token.

Extra Tips

  • Make sure to handle errors and exceptions properly when configuring the github-copilot provider using the provided token.
  • Consider adding additional validation and sanitization for the provided token to prevent potential security issues.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix No non-interactive CLI path for github-copilot provider auth [1 pull requests, 1 participants]