Skip to content

Noob-stupid/dsh-github-login

60Last commit Aug 15, 2026

dsh-github-login DSH plugin

This plugin provides a graphical GitHub login interface for DSH. It opens a window, generates device codes, and performs OAuth authorization within an embedded Chromium webview, sharing the same network channel as your browser. After successful login, tokens are saved locally and synchronized with the gh CLI.

How to install the dsh-github-login DSH plugin

dsh plugin --profile web add github:Noob-stupid/dsh-github-login

Copying does not run this command. Review the repository and version before installing the dsh-github-login DSH plugin.

dsh-github-login DSH plugin data source

dsh-github-login DSH plugin snapshot date: Aug 16, 2026

discovered

What the dsh-github-login DSH plugin can do

  • Embedded authorization window with navigation buttons (back/forward/refresh)
  • Option to switch to external browser for authorization
  • Token persistence to `~/.dsh/github-auth.json` and sync to `~/.config/gh/hosts.yml`
  • System tray icon showing account status and one-click logout
  • Host-side loopback endpoints: `/github-auth/status` and `/github-auth/open` for integration

Where the dsh-github-login DSH plugin fits

  • Quickly log into GitHub to use DSH ecosystem features that require GitHub authentication
  • Perform GitHub OAuth in a GUI environment without terminal access (e.g., Windows desktop)
  • Provide a unified login state for desktop clients that integrate this plugin
  • Pair with dsh-plugin-hub to increase search quota after GitHub login

Who the dsh-github-login DSH plugin is for

  • Developers using DSH who need a convenient GitHub login flow
  • Users who prefer a graphical interface over command-line OAuth
  • Integrators building desktop applications that require GitHub authentication

dsh-github-login DSH plugin limitations

  • Only supports GitHub login (uses a fixed OAuth client_id from GitHub CLI)
  • Token is for command-line tools only; browser web sessions remain independent
  • Currently only provides a pre-packaged Windows .exe; other platforms require manual build from source
  • If system keyring has old credentials, `gh` may disregard the synced host file until old credentials are cleared

dsh-github-login DSH plugin: from the repository README

Quoted from the Noob-stupid/dsh-github-login README, the upstream source of the dsh-github-login DSH plugin. Copyright remains with the original authors.

一个零终端的 GitHub 登录小工具:打开窗口 → 生成设备码 → 授权 → 完成。 **设备码流程在窗口内(Chromium 网络栈)执行**,与你的浏览器共用同一网络通道—— 浏览器能打开 GitHub,这里就能完成登录,不受终端/代理配置差异影响。 ## 安装(DSH 插件模式) 一条命令装进 DSH,并自动启用宿主端插件(提供登录状态接口 + 一键唤起登录窗口): ```sh 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`。 ## 用法 ```sh npm install # 安装 electron(已配置国内镜像) npm start # 直接运行 npm run dist # 打包为便携版单文件 exe(dist/DSH-GitHub-Login.exe) ``` ## 与 dsh-plugin-hub 配套 [dsh-plugin-hub](https://github.com/Noob-stupid/dsh-plugin-hub)(插件管理面板)会读取 本工具写入的同一份令牌文件:登录后面板的 GitHub 市场显示"已登录 GitHub:<账号>", 且服务端回退通道自动带认证(搜索配额 10 → 30 次/分钟)。 ## 集成到其他应用(如桌面客户端) 把它当作一个独立进程调用即可:登录状态通过同一份文件(`~/.dsh/github-auth.json`) 共享,任何 DSH 生态工具都能读取: ```js spawn

Read the full READMEThe repository declares no license. Check with the authors before using it.

dsh-github-login DSH plugin questions

Why does the window keep showing 'Waiting for authorization'?

The polling uses the same network channel as the embedded browser. If your browser can open GitHub, the process should complete. The status line shows the polling count; if it gets stuck, report the count in an issue. The verification code is valid for 15 minutes, so brief network jitter won't break it.

The login shows 'unknown' for the username. What went wrong?

Authorization succeeded and the token has been saved. The 'unknown' means the username query failed, which is a best-effort step. Restart the program and the tray will retry fetching the username; the token is still valid.

After login, `gh` still says I'm not authenticated. How to fix?

This tool writes the token to `~/.config/gh/hosts.yml`. However, `gh` prefers credentials stored in the system keyring. If you have old credentials there, run `gh auth logout` first to clear them, then the host file will be used.

Why am I not logged in to GitHub in my browser after using this plugin?

The plugin authenticates the GitHub CLI layer (tokens saved to `github-auth.json` and `hosts.yml`), not the browser's web session. To log into the browser, either visit github.com and sign in manually, or use the 'Open in external browser' option during authorization, which will also log you into that browser.

How do I log out of this plugin?

Click the system tray icon and select the account entry (e.g., 'GitHub: username (click to log out)'). You can also click 'Log out' in the authorization window. This will delete the token file and remove the entry from `hosts.yml`.