Visual GitHub login without a terminal: in-window device flow, token synced into the gh CLI, and host status/launch endpoints.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Noob-stupid/dsh-github-login
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
DSH GitHub Login —— 独立的 GitHub 可视化登录插件
一个零终端的 GitHub 登录小工具:打开窗口 → 生成设备码 → 授权 → 完成。 设备码流程在窗口内(Chromium 网络栈)执行,与你的浏览器共用同一网络通道—— 浏览器能打开 GitHub,这里就能完成登录,不受终端/代理配置差异影响。
安装(DSH 插件模式)
一条命令装进 DSH,并自动启用宿主端插件(提供登录状态接口 + 一键唤起登录窗口):
dsh plugin --profile web add github:Noob-stupid/dsh-github-login
宿主端环回接口:
GET /github-auth/status→{ok, loggedIn, login}(只含账号名,绝不下发令牌)POST /github-auth/open→ 唤起登录工具窗口(本机存在 exe 时直接启动)
独立工具用法(不带 DSH 也行):
功能
- 窗口内授权:授权页直接内嵌在窗口里(
<webview>),带 前进 / 后退 / 刷新 按钮, 也可以一键改用外部浏览器打开; - 登录成功后令牌保存在
~/.dsh/github-auth.json; - 同时同步进 gh CLI 的
~/.config/gh/hosts.yml,gh 命令行立即可用(keyring 存在时 gh 以 keyring 优先); - 托盘常驻:随时查看账号状态 / 一键退出登录;
- 复用 GitHub CLI 的公开 OAuth client_id(
178c6fc778ccc68e1d6a),权限范围repo workflow gist read:org。
用法
npm install # 安装 electron(已配置国内镜像)
npm start # 直接运行
npm run dist # 打包为便携版单文件 exe(dist/DSH-GitHub-Login.exe)
与 dsh-plugin-hub 配套
dsh-plugin-hub(插件管理面板)会读取 本工具写入的同一份令牌文件:登录后面板的 GitHub 市场显示"已登录 GitHub:<账号>", 且服务端回退通道自动带认证(搜索配额 10 → 30 次/分钟)。
集成到其他应用(如桌面客户端)
把它当作一个独立进程调用即可:登录状态通过同一份文件(~/.dsh/github-auth.json)
共享,任何 DSH 生态工具都能读取:
spawn('<path>/DSH-GitHub-Login.exe', [], { windowsHide: false })
之后用 gh auth status 或直接读取 ~/.dsh/github-auth.json 验证登录状态。
原理
GitHub Device Flow:
POST https://github.com/login/device/code→user_code+device_code- 在窗口内嵌浏览器(或外部浏览器)打开
https://github.com/login/device,输入user_code授权 - 按 GitHub 给出的
interval轮询POST https://github.com/login/oauth/access_token - 拿到
access_token→ 主进程落盘 + 写入 gh 配置
轮询严格遵循服务器间隔;网络抖动不中断(验证码 15 分钟有效期);授权成功 即完成,用户名查询是尽力而为的补充。
与桌面端的关系
本仓库只包含登录插件本身,不包含任何桌面客户端代码。桌面客户端可在本地 集成它(见上);两者通过令牌文件共享登录状态。
帮助 / Help
遇到问题先看这里;仍有疑问请到 议题 提问。
- 一直"等待授权":轮询与浏览器共用同一网络通道,浏览器能打开 GitHub 就一定能完成; 提示行会显示轮询次数,卡住时把提示文字发到 Issue。
- 显示 unknown:授权已成功、令牌已保存,只是用户名查询失败;重启程序后状态页会重试。
- gh 仍显示未登录:本工具写入
~/.config/gh/hosts.yml;若系统 keyring 里有旧凭证, gh 会优先用 keyring——先gh auth logout清掉旧凭证即可。 - 浏览器打开 GitHub 显示未登录:gh/DSH 令牌登录与浏览器网页登录是两套独立会话——
本工具认证的是 gh 命令行层(令牌写进
github-auth.json与hosts.yml),并不会登录你的浏览器; 浏览器需单独登录一次 github.com(或在授权时选"改用外部浏览器打开",完成授权会顺带登录该浏览器)。 - 如何退出登录:托盘菜单
GitHub: <账号> (click to log out),或窗口中点"退出登录"。
License
MIT
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-git-graph★ 8121
Git branch selector and Git graph for the dsh web GUI: switch branches and explore branch-lane and commit history from the conversation header.
Akimiya-z/codex-guard#dsh★ 138
Pre-submit pull-request hygiene checks inside DeepSeek Harness: scans the current diff for TODO leftovers, hardcoded secrets, and non-conventional commit subjects.
Cerbur/clutch-dsh#clutch-dsh-worktree★ 29
Adds a Worktree view to DSH Web UI that groups Sessions by Git worktree while keeping DSH as the source of truth.
lehhair/dsh-diff-viewer★ 27
PiUI-style diff viewer replacing the stock DiffBlock for write/edit tool calls.
DietCokewithSugar/dsh-user-experience★ 20
Finds potential UX issues in your project: automatically reviews React/TypeScript code, pinpoints each problem, and gives concrete suggestions.
DamonKoy/dsh-web-ui#dsh-git-graph★ 19
Git branch selector and Git graph in the conversation header of the dsh web GUI.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.