Skip to content

Completion should not require authentication #4188

@cuonglm

Description

@cuonglm

Describe the bug

gh shell completion requires authenticated to work properly.

$ gh version
gh version 2.0.0 (2021-08-23)
https://github.com/cli/cli/releases/tag/v2.0.0

Steps to reproduce the behavior

$ eval gh __complete au

Expected vs actual behavior

Expected:

auth	Login, logout, and refresh your authentication
:4
Completion ended with directive: ShellCompDirectiveNoFileComp

Actual:

Welcome to GitHub CLI!

To authenticate, please run `gh auth login`.

Note that shell completion is setup properly, since when I can do completion ok after login.

This takes me an hour to figure it out why completion not work at first, since when I setup everything properly, until I look into the completion script generated by gh, and notice the eval gh __complete au to understand the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions