dshbase

插件目录 / Developer / dsh-openai-codex-oauth

dsh-openai-codex-oauth

已验证 · 实测可装 dyuan311

✓ 持续维护 基于 7 个官方 DSH 包 纯 TypeScript

查看 GitHub ↗ ← 返回插件目录

1Stars
0Forks
0未关闭 issue
TypeScript语言
2026-08-15最近推送
跨平台平台

功能简介

dsh-openai-codex-oauth — DSH 插件(工具)

✅
我们的评价
可用 — 实测通过,早期项目

dsh-openai-codex-oauth — DSH 插件(工具) 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

dsh-openai-codex-oauth

简体中文

ChatGPT subscription OAuth for the openai-codex provider in DeepSeek Harness.

This package adds interactive login, credential persistence, token refresh, login status, and logout commands. DeepSeek Harness remains the agent runtime. The package uses the OAuth implementation exposed by @earendil-works/pi-ai and the model adapter supplied by @deepseek-ai/dsh-llm-pi-ai.

Just for fun.

How it works

DeepSeek Harness
  ├─ dsh-openai-codex-oauth
  │    └─ @earendil-works/pi-ai OAuth implementation
  │         └─ OpenAI browser or device-code authorization
  └─ @deepseek-ai/dsh-llm-pi-ai
       └─ openai-codex model requests

@earendil-works/pi-ai runs as a JavaScript library inside Harness. The Pi coding-agent application and its agent loop do not participate in this integration.

The browser flow uses OAuth 2.0 Authorization Code with PKCE and a local callback at http://localhost:1455/auth/callback. A successful callback may display a Pi-branded local success page because that HTML is provided by the library.

Requirements

  • DeepSeek Harness 0.1.0-rc.6
  • Node.js 22.19.0 or newer
  • pnpm
  • An OpenAI account with Codex subscription access
  • Local TCP port 1455 available during browser login

Build

From the repository root:

pnpm install --frozen-lockfile
pnpm build
pnpm pack

The last command creates dsh-openai-codex-oauth-0.1.1.tgz.

Install into DeepSeek Harness

With a globally available dsh command:

dsh plugin --profile web add ./dsh-openai-codex-oauth-0.1.1.tgz
dsh web

With the published Harness package through npx:

npx --yes @deepseek-ai/[email protected] plugin --profile web add ./dsh-openai-codex-oauth-0.1.1.tgz
npx --yes @deepseek-ai/[email protected] web

The bundled Cordis patch loads @deepseek-ai/dsh-llm-pi-ai, configures its openai-codex provider to read OPENAI_CODEX_ACCESS_TOKEN, and loads this plugin.

Sign in

Open the Harness Web interface and submit:

/codex-login

Select browser login in the prompt. The command also accepts an explicit method:

/codex-login browser
/codex-login device

After authorization, select an openai-codex model from the model picker.

Commands

Command Description
/codex-login [browser|device] Start OAuth authorization and store the credential.
/codex-status Show credential state, source, and access-token expiry.
/codex-logout Clear the stored OAuth credential and access token.

Configuration

The generated Harness plugin entry accepts:

- id: openai-codex-oauth
  name: dsh-openai-codex-oauth
  config:
    oauthCredentialRef: OPENAI_CODEX_OAUTH_CREDENTIAL
    refreshBeforeMs: 300000

The plugin stores the complete OAuth credential under OPENAI_CODEX_OAUTH_CREDENTIAL and the current access token under OPENAI_CODEX_ACCESS_TOKEN. With the default local credential source, Harness commonly writes these values to ~/.dsh/.credentials.yaml with permissions scoped to the local user.

Security and service terms

OAuth access and refresh tokens grant access to the associated OpenAI account. Keep the Harness credential file private, keep the account under one user's control, and use the integration within the account's usage allowance. OpenAI service terms and plan-specific rules govern subscription access.

The Codex backend and its request format may change. A future OpenAI or pi-ai release can require a compatibility update.

Acknowledgements

This project uses DeepSeek Harness's official @deepseek-ai/dsh-llm-pi-ai adapter to connect the Harness LLM interface with pi-ai. It uses @earendil-works/pi-ai for the OpenAI Codex OAuth and provider implementations.

Both upstream projects are distributed under the MIT License. Their copyright notices and license texts are included in THIRD_PARTY_NOTICES.md.

Project status

This is an independent community integration for DeepSeek Harness. OpenAI, DeepSeek, and Pi retain their respective names and trademarks.

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-openai-codex-oauth」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:dyuan311/dsh-openai-codex-oauth

Headless(CLI)profile:

dsh plugin --profile headless add github:dyuan311/dsh-openai-codex-oauth

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

使用场景

扩展 agent 的编码能力面——给它一个新工具、工作流或集成,让它接手以前做不了的开发任务。

适合谁

想让 dsh 在真实代码库上像队友一样干活的开发者——能改、能跑、能验证,而不只是回答问题。

二次开发建议

工具/命令面就是缝:暴露更多 SDK 能力、加更聪明的上下文接线,或收紧改代码与验证之间的循环。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7797 个插件 →