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
Domain: github.com
{"@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-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:199a700f-f4d4-61cf-3b87-192efadcf694 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AB28:3A73AA:134F1CA:186BE0F:6B015F98 |
| html-safe-nonce | 7ffdec01727de1fb980f862b6871db14d899a6f902039d2f8daaaedd3eaa9e00 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjI4OjNBNzNBQToxMzRGMUNBOjE4NkJFMEY6NkIwMTVGOTgiLCJ2aXNpdG9yX2lkIjoiOTE0MzczMzIyNjAzOTIzODU1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 867508ad70d9b05debe238d8709be2d34bc4118662fa083f99f8f7d83eb0ea92 |
| hovercard-subject-tag | issue:2598490600 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cli/cli/9789/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b507374717ab5851e49ccb74997f785d3b1896192809cac0210c39e67a3c4c4d/cli/cli/issues/9789 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b507374717ab5851e49ccb74997f785d3b1896192809cac0210c39e67a3c4c4d/cli/cli/issues/9789 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jtmcg |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/cli/cli git https://github.com/cli/cli.git |
| octolytics-dimension-user_id | 59704711 |
| octolytics-dimension-user_login | cli |
| octolytics-dimension-repository_id | 212613049 |
| octolytics-dimension-repository_nwo | cli/cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 212613049 |
| octolytics-dimension-repository_network_root_nwo | cli/cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width