ghtkn

Shunsuke Suzuki·suzuki-shunsuke.ghtkn

A CLI to create short-lived (8 hours) GitHub App User Access Token for secure local development

winget install --id suzuki-shunsuke.ghtkn --exact --source winget

Latest 0.4.0·August 15, 2026

Release Notes

⚠️ Breaking Changes #580 Replace urfave/cli with cobra #583 Remove the -d option and GHTKN_ENABLE_DEVICE_FLOW

  • Long flags require two dashes. -config, -log-level, -min-expiration, -device-flow and -continue-on-error are no longer accepted; write --config and so on. The single-character aliases -c, -m, -d, -p, -e and -f are unaffected. The documentation is updated to match.
  • ghtkn completion pwsh is now ghtkn completion powershell. A completion script written to a file has to be regenerated after upgrading, for every shell.
  • An unknown command exits 1 rather than 3. urfave raised that code itself; cobra attaches none, and its unknown-command error carries nothing to recognize it by.
  • -e no longer splits its value on commas. urfave's slice flags did that, so -e A,B set two environment variables; that came from the flag library rather than from anything ghtkn meant to offer. Repeating -e is the supported way and is unchanged. A comma in the environment variable name is now an error that says so, rather than silently setting one variable named A,B.

Why did we migrate to cobra? urfave/cli/v3 (v3.10.1) has two bugs that ghtkn runs into, and neither reproduces with cobra. The first is that an argument spelled help is taken as a request for help. ghtkn get help printed the help of get instead of asking for the token of an app named help, so that name was simply unusable. The second is urfave/cli#1993: with shell completion enabled, pressing TAB after a -- runs the command instead of completing. It was reported against v2 and is still open, and it still reproduces on v3.10.1 when an argument follows the --: $ spike get -- foo ACTION RAN: app="foo" args=[] ghtkn exec -- sits exactly on that shape, so a TAB in the middle of writing an exec command line could run whatever was already typed. cobra completes through a separate hidden __complete command, which never reaches the action, so the failure mode does not exist there.

Remove the -d option and GHTKN_ENABLE_DEVICE_FLOW #474 #583 The device flow is now started by ghtkn auth alone. ghtkn get, ghtkn exec, ghtkn git-credential, and the Go SDK serve the cached token and otherwise fail fast with an actionable error. v0.3.0 disabled the automatic device flow by default but kept --device-flow (-d) and GHTKN_ENABLE_DEVICE_FLOW=true as a temporary opt-in. Both are removed here.

Why These commands are often run indirectly, by a wrapper script, the Git credential helper, or a third-party tool built on the SDK. A device flow started that way is a phishing risk: the user is asked to approve one they never initiated. With ghtkn auth as the only entry point, a one-time code you are shown is always one you asked for.

Features #572 shell completion: complete app names for 'get', 'auth', and 'revoke' #586 Add a json-schema command outputting the configuration file's JSON Schema ghtkn json-schema

Fixes #571 Remove the no-op app name argument from 'ghtkn info'

Documentation #570 Add a shell completion section to configuration #579 Stop describing the Go SDK as creating tokens and lead with the config file #587 Add description to JSON Schema

Fixes #571 Remove the no-op app name argument from 'ghtkn info'

Documentation #570 Add a shell completion section to configuration #579 Stop describing the Go SDK as creating tokens and lead with the config file #587 Add description to JSON Schema

Installer type: zip

x648E12491956A3B503FECFAD50DE7A8E0F244318E260D2A3ABC3628314F7D6BE48
arm64C5801C546867AF09414C6F25D5AD295DB05A06045A455663310FC1EB30B55994

Details

Homepage
https://github.com/suzuki-shunsuke/ghtkn
License
MIT
Publisher
Shunsuke Suzuki
Support
https://github.com/suzuki-shunsuke/ghtkn/issues
Copyright
Copyright (c) 2026 Shunsuke Suzuki
Moniker
ghtkn

Tags

cligithubgithub-app-tokengithub-tokensecurity

Older versions (12)

0.3.6
x647405A0EB146B686A7B4868348B0E89AA786D9562710C740092D87799C3549DC5
arm64A093AA823E597862B95946D1FAB25EC460AF736266A5D82EA5F9CB75479F01A9
0.3.5
x6497DFCF5F11F2C34CA839A43B816FB8ABE4987AD720E734AD5A8EF4E41625FAF7
arm64685A9B09102D27937DBF6642AF81459057B1BD3F404E92203094084FCDDB0251
0.3.4
x6433C1814DCB61710C2ADD618EEC2FDBCB101EFEA5779C9E6B3745BB91014D3A81
arm6470A69F1A67031C01AF6DCB1342EBAAEA391E3EA73BAB85E16B75F1AB7AD53B3C
0.3.3
x648C7C3AAF9C0E25F58E76E54B44591BAA28B8E4B5CB511F5617A6F39B736E588C
arm64EBDB1CD22C1BBD1364F7D01C17D6E1AD818B3834EF8A906A384A61FDEF98EDD6
0.3.2
x640FBDD8F44FC56766BAE3C6E9ECBB33E99AD0F9B1C518865336E9551B6796B6F3
arm64BE441F1CC1B7C162EE6BFEEDFBFA680F76017C3C49B6B2B38ECDDE89EE850EA2
0.3.1
x64791A5BA4227375122C1BD43E15AA6E41CBAAB31A15C74C5952D60166A2922AB6
arm64C176B993BD2E667481D9379E5446EE5E634B426F26C3084FD384DA893F668B64
0.3.0
x649AC6AE945DF5D8E52E21E72E131E5CB8F09361D4D5E074CD381986FF9A10AD6E
arm64B55842340A10A1C67D2FA593C05BE60C8D79C02294C469AECAB3373E4EAB79CD
0.2.8
x64D2D5F85234B3BA8AFA9F0174CDE71160FD43CA5FCBFDC92FE641BE6149D89A4A
arm64BC3CF9181D52174C2BD650EAEDDC7BD9EBD03D09902EA5712383DC49A565CA1B
0.2.7
x643BEC3B91A981222725D9643432631EFF0191F7FE7D97C22BFAC368688B7EC92D
arm6496188B91BB1AE60B0E67B6BBA12C6705D89D920192E273A619D106E58EE0FF84
0.2.6
x6482761A99B97336A671FFF16DA4950B4D76E969D386FBC5237361EB00D504CB3F
arm64140374320633C496AB8580F9406B72FD937C58F3CC14B085BE76BFDD556D8C45
0.2.5
x64A542B17FF12F210D6EA9444570CC707452842348979F0EA68161A19B40AC172C
arm64B1997561C309BB459F3CE1A1745AE403BC1D44BCBD3CE82C84D9F23777F7A11F
0.2.4
x642BBD58EDE5A24BA140927AB84CD7F72C57EC93971A0A7D58142AF85529007E02
arm6407D4EA8389F6047EF98542835677D6511F539F1FC2F096985252D6553428248D