Skip to content
dsh.fish
Bundle

dsh-oauth

DeepSeek Harness (dsh) out-of-tree OAuth plugin for Grok/xAI, Codex, and Claude Code. Community plugin, not official.

Source
hahaha-taotao
stars
1 stars
License
MIT
Updated
Updated 16 days ago

Readme

# dsh-oauth-api

[中文说明](README.zh.md)

Out-of-tree [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) plugin for third-party **OAuth login**. It is a community plugin, not an official DeepSeek product and not an upstream PR.

After install, **Settings → OAuth 登录** shows one card per provider. Successful login does **not** change the current default model — pick the provider in the official model picker.

## Providers

| Settings card | Model picker group | Auth | Inference |
|---|---|---|---|
| Grok / xAI | `xai-oauth` | Device code (`auth.x.ai`) | `https://api.x.ai/v1/responses` |
| Codex / ChatGPT | `codex-oauth` | Device code (`auth.openai.com/codex/device`) | `https://chatgpt.com/backend-api/codex` |
| Claude Code | `claude-oauth` | PKCE: open authorize URL, paste `code#state` | `https://api.anthropic.com/v1/messages` |
| Kimi Code | `kimi-oauth` | Device code (`auth.kimi.com`) | `https://api.kimi.com/coding/v1` |

## Install

```bash
git clone https://github.com/hahaha-taotao/dsh-oauth-api.git
cd dsh-oauth-api
pnpm install
pnpm build
dsh plugin --profile web add .
```

Confirm the Cordis rows:

```bash
dsh --profile web --dump-config
```

You should see `dsh-oauth-host` and `dsh-oauth-client`.

## Login

1. Start the UI: `dsh web`
2. Open **Settings → OAuth 登录**
3. Click **登录** on a provider card
4. Finish the browser step (device code, or paste Claude’s `code#state`)
5. Select the matching group in the model picker (`xai-oauth`, `codex-oauth`, `claude-oauth`, or `kimi-oauth`)

Grok tokens need the `api:access` scope. If inference says the scope is missing, log in again.

## Token store

Tokens live only in this plugin’s store:

- `$DSH_HOME/oauth/xai.json`
- `$DSH_HOME/oauth/codex.json`
- `$DSH_HOME/oauth/claude.json`
- `$DSH_HOME/oauth/kimi.json`

Default `$DSH_HOME` is `~/.dsh`.

## Develop

```bash
pnpm install
pnpm test
pnpm run typecheck
```

## License

MIT

Install

dsh plugin --profile web add github:hahaha-taotao/dsh-oauth-api

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source