René's URL Explorer Experiment


Title: `gh auth login --with-token` hangs · Issue #9789 · cli/cli · GitHub

Open Graph Title: `gh auth login --with-token` hangs · Issue #9789 · cli/cli

X Title: `gh auth login --with-token` hangs · Issue #9789 · cli/cli

Description: Describe the bug gh auth login --with-token is described to accept a token on standard input. The usage example in the docs is gh auth login --with-token < mytoken.txt However, if I don't provide a token file using the redirect operator,...

Open Graph Description: Describe the bug gh auth login --with-token is described to accept a token on standard input. The usage example in the docs is gh auth login --with-token < mytoken.txt However, if I don't provide a...

X Description: Describe the bug gh auth login --with-token is described to accept a token on standard input. The usage example in the docs is gh auth login --with-token < mytoken.txt However, if I don't pr...

Opengraph URL: https://github.com/cli/cli/issues/9789

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`gh auth login --with-token` hangs","articleBody":"### Describe the bug\n\n`gh auth login --with-token` is [described](https://github.com/cli/cli/blob/92ff87c6b77f055b0446430bf8cf65025f2c64a7/pkg/cmd/auth/login/login.go#L71-L72) to accept a token on standard input. The [usage example](https://github.com/cli/cli/blob/92ff87c6b77f055b0446430bf8cf65025f2c64a7/pkg/cmd/auth/login/login.go#L93) in the docs is\n\n```shell\ngh auth login --with-token \u003c mytoken.txt\n```\n\nHowever, if I don't provide a token file using the redirect operator, the command `gh auth login --with-token` hangs.\n\n### Steps to reproduce the behavior\n\n1. Logout of github in the CLI using `gh auth logout`\n2. Run `gh auth login --with-token`\n3. See that the terminal hangs\n\n### Expected vs actual behavior\n\nIt isn't terribly clear what behavior is expected, here, but it seems like an [interactive prompt](https://github.com/cli/cli/blob/92ff87c6b77f055b0446430bf8cf65025f2c64a7/pkg/cmd/auth/login/login.go#L115-L117) for where to find the token may have been intended. However, that code seems unreachable given the [conditional above it](https://github.com/cli/cli/blob/92ff87c6b77f055b0446430bf8cf65025f2c64a7/pkg/cmd/auth/login/login.go#L106-L113), and [no implementation exists to prompt for a token](https://github.com/cli/cli/blob/92ff87c6b77f055b0446430bf8cf65025f2c64a7/pkg/cmd/auth/login/login.go#L155-L225) when one isn't provided.\n\nI would expect to be prompted for the token OR the token's file location if one wasn't provided using a redirect operator.\n","author":{"url":"https://github.com/jtmcg","@type":"Person","name":"jtmcg"},"datePublished":"2024-10-18T22:29:51Z","url":"https://github.com/cli/cli/issues/9789"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:199a700f-f4d4-61cf-3b87-192efadcf694
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAB28:3A73AA:134F1CA:186BE0F:6B015F98
html-safe-nonce7ffdec01727de1fb980f862b6871db14d899a6f902039d2f8daaaedd3eaa9e00
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjI4OjNBNzNBQToxMzRGMUNBOjE4NkJFMEY6NkIwMTVGOTgiLCJ2aXNpdG9yX2lkIjoiOTE0MzczMzIyNjAzOTIzODU1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac867508ad70d9b05debe238d8709be2d34bc4118662fa083f99f8f7d83eb0ea92
hovercard-subject-tagissue:2598490600
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cli/cli/9789/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b507374717ab5851e49ccb74997f785d3b1896192809cac0210c39e67a3c4c4d/cli/cli/issues/9789
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b507374717ab5851e49ccb74997f785d3b1896192809cac0210c39e67a3c4c4d/cli/cli/issues/9789
og:image:altDescribe the bug gh auth login --with-token is described to accept a token on standard input. The usage example in the docs is gh auth login --with-token < mytoken.txt However, if I don't provide a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejtmcg
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/cli/cli git https://github.com/cli/cli.git
octolytics-dimension-user_id59704711
octolytics-dimension-user_logincli
octolytics-dimension-repository_id212613049
octolytics-dimension-repository_nwocli/cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id212613049
octolytics-dimension-repository_network_root_nwocli/cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/cli/cli/issues/9789#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcli%2Fcli%2Fissues%2F9789
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcli%2Fcli%2Fissues%2F9789
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=cli%2Fcli
Reloadhttps://github.com/cli/cli/issues/9789
Reloadhttps://github.com/cli/cli/issues/9789
Reloadhttps://github.com/cli/cli/issues/9789
clihttps://github.com/cli
clihttps://github.com/cli/cli
Codehttps://github.com/cli/cli
Issues1.1k (1.1k)https://github.com/cli/cli/issues
Pull requests59 (59)https://github.com/cli/cli/pulls
Discussionshttps://github.com/cli/cli/discussions
Actionshttps://github.com/cli/cli/actions
Projectshttps://github.com/cli/cli/projects
Security and quality17 (17)https://github.com/cli/cli/security
Insightshttps://github.com/cli/cli/insights
https://github.com/cli/cli
New issuehttps://github.com/login?return_to=https://github.com/cli/cli/issues/9789
New issuehttps://github.com/login?return_to=https://github.com/cli/cli/issues/9789
#14679https://github.com/cli/cli/pull/14679
gh auth login --with-token hangshttps://github.com/cli/cli/issues/9789#top
#14679https://github.com/cli/cli/pull/14679
bugSomething isn't workinghttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22bug%22
gh-authrelating to the gh auth commandhttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22gh-auth%22
help wantedContributions welcomehttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
priority-3Affects a small number of users or is largely cosmetichttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22priority-3%22
https://github.com/jtmcg
jtmcghttps://github.com/jtmcg
on Oct 18, 2024https://github.com/cli/cli/issues/9789#issue-2598490600
describedhttps://github.com/cli/cli/blob/92ff87c6b77f055b0446430bf8cf65025f2c64a7/pkg/cmd/auth/login/login.go#L71-L72
usage examplehttps://github.com/cli/cli/blob/92ff87c6b77f055b0446430bf8cf65025f2c64a7/pkg/cmd/auth/login/login.go#L93
interactive prompthttps://github.com/cli/cli/blob/92ff87c6b77f055b0446430bf8cf65025f2c64a7/pkg/cmd/auth/login/login.go#L115-L117
conditional above ithttps://github.com/cli/cli/blob/92ff87c6b77f055b0446430bf8cf65025f2c64a7/pkg/cmd/auth/login/login.go#L106-L113
no implementation exists to prompt for a tokenhttps://github.com/cli/cli/blob/92ff87c6b77f055b0446430bf8cf65025f2c64a7/pkg/cmd/auth/login/login.go#L155-L225
jtmcghttps://github.com/jtmcg
bugSomething isn't workinghttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22bug%22
on Oct 18, 2024https://github.com/cli/cli/issues/9789#event-14728059939
cliAutomationhttps://github.com/cliAutomation
needs-triageneeds to be reviewedhttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22needs-triage%22
on Oct 18, 2024https://github.com/cli/cli/issues/9789#event-14728060915
jtmcghttps://github.com/jtmcg
needs-designAn engineering task needs design to proceedhttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22needs-design%22
coreThis issue is not accepting PRs from outside contributorshttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22core%22
gh-authrelating to the gh auth commandhttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22gh-auth%22
needs-triageneeds to be reviewedhttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22needs-triage%22
on Oct 18, 2024https://github.com/cli/cli/issues/9789#event-14728062449
https://github.com/williammartin
williammartinhttps://github.com/williammartin
on Oct 21, 2024https://github.com/cli/cli/issues/9789#issuecomment-2426092653
babakkshttps://github.com/babakks
gh auth login --with-token: provide clear, non-echoing token input when stdin is a terminal #14597https://github.com/cli/cli/issues/14597
on Oct 5, 2026https://github.com/cli/cli/issues/9789#event-32503119856
https://github.com/babakks
babakkshttps://github.com/babakks
on Oct 5, 2026https://github.com/cli/cli/issues/9789#issuecomment-5993632414
@williammartinhttps://github.com/williammartin
@vladkenshttps://github.com/vladkens
help wantedhttps://github.com/cli/cli/labels/help%20wanted
@vladkenshttps://github.com/vladkens
babakkshttps://github.com/babakks
help wantedContributions welcomehttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
priority-3Affects a small number of users or is largely cosmetichttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22priority-3%22
needs-designAn engineering task needs design to proceedhttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22needs-design%22
coreThis issue is not accepting PRs from outside contributorshttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22core%22
on Oct 5, 2026https://github.com/cli/cli/issues/9789#event-32503471799
goransh-waliahttps://github.com/goransh-walia
on Oct 14, 2026https://github.com/cli/cli/issues/9789#event-33184156264
fix: `gh auth login --with-token` hangs (cli#9789)https://github.com/goransh-walia/cli/commit/89ed17d91375327c622f653d1026deea6c517c9c
cli#9789https://github.com/cli/cli/issues/9789
89ed17dhttps://github.com/goransh-walia/cli/commit/89ed17d91375327c622f653d1026deea6c517c9c
test: add regression test for cli#9789https://github.com/goransh-walia/cli/commit/1786bb716d516b06a24ed3d0b4236b350f0ce961
cli#9789https://github.com/cli/cli/issues/9789
1786bb7https://github.com/goransh-walia/cli/commit/1786bb716d516b06a24ed3d0b4236b350f0ce961
https://github.com/mithilesh-iitm
mithilesh-iitmhttps://github.com/mithilesh-iitm
on Nov 6, 2026https://github.com/cli/cli/issues/9789#issuecomment-6679707396
@babakkshttps://github.com/babakks
Sign up for freehttps://github.com/signup?return_to=https://github.com/cli/cli/issues/9789
Sign in to commenthttps://github.com/login?return_to=https://github.com/cli/cli/issues/9789
bugSomething isn't workinghttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22bug%22
gh-authrelating to the gh auth commandhttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22gh-auth%22
help wantedContributions welcomehttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
priority-3Affects a small number of users or is largely cosmetichttps://github.com/cli/cli/issues?q=state%3Aopen%20label%3A%22priority-3%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.