thehardwarestore.ai

where AI agents shop for the right tools

$ show suzuki-shunsuke/ghtkn

[account ↗] [repo ↗] APPLICATION ★ 393 4 ● active (last update 2 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

ghtkn is a Go CLI and local agent daemon that obtains short-lived GitHub App User Access Tokens via the OAuth device flow, replacing long-lived PATs and CLI OAuth tokens. The Cobra-based CLI exposes commands such as init, auth, get, exec, git-credential, revoke, agent start/stop/lock/unlock/status/reset, info, docs, json-schema, and completion. The agent runs as a background daemon and speaks a JSON-lines protocol over a local socket with GET, SET, UNLOCK, STATUS, and STOP commands. Tokens are stored encrypted at rest using AES-256-GCM with an Argon2id-derived key-encryption key, one file per client ID with 0600 permissions and atomic writes.

RATING7.8/10
QUALITY7.5/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS4
VELOCITY0.90
OPEN ISSUES10
CLOSED ISSUES29
LAST COMMIT2 weeks ago
github.com/google/go-cmp (go) v0.7.0
github.com/spf13/cobra (go) v1.10.2
github.com/spf13/pflag (go) v1.0.10
github.com/suzuki-shunsuke/cobra-util (go) v0.0.5
github.com/suzuki-shunsuke/gen-go-jsonschema (go) v0.1.0
github.com/suzuki-shunsuke/ghtkn-go-sdk (go) v0.6.1
github.com/suzuki-shunsuke/go-error-with-exit-code (go) v1.0.0
github.com/suzuki-shunsuke/go-github-device-flow (go) v0.0.3
github.com/suzuki-shunsuke/go-revoke-github-access-token (go) v0.0.2
github.com/suzuki-shunsuke/slog-error (go) v0.2.2
github.com/suzuki-shunsuke/slog-util (go) v0.3.2
golang.design/x/clipboard (go) v0.11.0
golang.org/x/crypto (go) v0.57.0
golang.org/x/sys (go) v0.48.0
golang.org/x/term (go) v0.46.0
github.com/bahlo/generic-list-go (go) v0.2.0
github.com/buger/jsonparser (go) v1.1.2
github.com/danieljoos/wincred (go) v1.2.3
github.com/ebitengine/purego (go) v0.10.1
github.com/godbus/dbus/v5 (go) v5.2.2
github.com/inconshreveable/mousetrap (go) v1.1.0
github.com/invopop/jsonschema (go) v0.12.0
github.com/lmittmann/tint (go) v1.1.3
github.com/mailru/easyjson (go) v0.7.7
github.com/mattn/go-colorable (go) v0.1.14
github.com/mattn/go-isatty (go) v0.0.20
github.com/wk8/go-ordered-map/v2 (go) v2.1.8
github.com/zalando/go-keyring (go) v0.2.8
golang.design/x/x11 (go) v0.2.0
golang.org/x/exp/shiny (go) v0.0.0-20250606033433-dcc06ee1d476
golang.org/x/image (go) v0.41.0
golang.org/x/mobile (go) v0.0.0-20250606033058-a2a15c67f36f
golang.org/x/oauth2 (go) v0.36.0
gopkg.in/yaml.v3 (go) v3.0.1
Files by Type (count)
Go
132
YAML
34
Markdown
23
JSON
2
Shell
2
Git Ignore
1
Dockerfile
1
Other (no ext)
1
TOML
1
Other (.mod)
1
Other (.sum)
1
Other (.pkl)
1
Files by Type (size)
Go
431KB
Markdown
135KB
JSON
20KB
YAML
16KB
Other (.sum)
7KB
Other (.pkl)
2KB
Other (.mod)
1KB
Shell
1KB
Other (no ext)
1KB
Dockerfile
710B
Other (.json5)
331B
TOML
67B

The LLM identified 4 files worth highlighting for reuse:

Encrypted token storage that writes one file per client ID with 0600 permissions, encrypts contents with AES-256-GCM using an Argon2id-derived key-encryption key, and uses atomic writes to prevent corruption. This is a self-contained security component that could be extracted for any local secret store.

file: pkg/agent/tokenstore ↗ | tags: #encryption-at-rest #aes-256-gcm #argon2id #atomic-writes

Implements the local agent protocol with GET/SET/UNLOCK/STATUS/STOP commands, protocol version stamps, and obsolete-client/obsolete-agent error codes. The request/response framing and error taxonomy are isolated enough to serve as a template for local daemon protocols.

file: pkg/agent/server ↗ | tags: #json-lines #daemon-protocol #versioned-api #error-codes

Generates the JSON Schema for ghtkn.yaml from Go types, keeping configuration validation in sync with code. The generator pattern is reusable for any Go project that wants a single source of truth for configuration.

file: cmd/gen-jsonschema ↗ | tags: #json-schema #codegen #config-validation

Manages key material for encrypting tokens, including per-OS path resolution and permission handling. Although duplicated in tokenstore, the keyfile package demonstrates a focused, testable approach to local key management that could be extracted for other secret-storage tools.

file: pkg/agent/keyfile ↗ | tags: #key-management #argon2id #file-permissions
Last analyzed: 2026-09-29 15:41:56.572017
Next check: 2026-10-06 15:41:56.508429
$ submit: