{"record":{"id":"c4667dba21f7e3fe","repo":"cli/cli","slug":"token-is-required","errorCode":null,"errorMessage":"token is required","messagePattern":"token is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/prompter/huh_prompter.go","lineNumber":194,"sourceCode":"func (p *huhPrompter) Confirm(prompt string, defaultValue bool) (bool, error) {\n\tform, result := p.buildConfirmForm(prompt, defaultValue)\n\terr := p.runForm(form)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn *result, nil\n}\n\nfunc (p *huhPrompter) buildAuthTokenForm() (*huh.Form, *string) {\n\tvar result string\n\tform := p.newForm(\n\t\thuh.NewGroup(\n\t\t\thuh.NewInput().\n\t\t\t\tEchoMode(huh.EchoModePassword).\n\t\t\t\tTitle(\"Paste your authentication token:\").\n\t\t\t\tValidate(func(input string) error {\n\t\t\t\t\tif input == \"\" {\n\t\t\t\t\t\treturn fmt.Errorf(\"token is required\")\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t}).\n\t\t\t\tValue(&result),\n\t\t),\n\t)\n\treturn form, &result\n}\n\nfunc (p *huhPrompter) AuthToken() (string, error) {\n\tform, result := p.buildAuthTokenForm()\n\terr := p.runForm(form)\n\treturn *result, err\n}\n\nfunc (p *huhPrompter) buildConfirmDeletionForm(requiredValue string) *huh.Form {\n\treturn p.newForm(\n\t\thuh.NewGroup(","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/cli/cli/blob/0eeec0b92edbe70199f9768522f831d3534f41ad/internal/prompter/huh_prompter.go#L176-L212","documentation":"Error \"token is required\" thrown in cli/cli.","triggerScenarios":"Thrown at internal/prompter/huh_prompter.go:194 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enter a non-empty token at the prompt, or pass it non-interactively via `gh auth login --with-token`."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eeec0b92edbe70199f9768522f831d3534f41ad","analyzedAt":"2026-08-15T12:31:05.478Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}