DeepSeek Harness (DSH) provides a pluggable runtime environment. When developers need to directly leverage ChatGPT Codex for code generation, image creation, or web search within the DSH context, they typically have to maintain additional CLI processes or handle complex inter-process communication. The DSH Codex Adapter plugin uses the adapter pattern to integrate ChatGPT capabilities directly into DSH workflows, providing unified account management and interface entry points.
This is a DSH plugin maintained by baixianger, belonging to the model inference category. Its core value lies in reusing the ChatGPT Codex backend, supporting streaming responses, passing image context, and providing account login, usage monitoring, and localized settings interfaces, allowing developers to use ChatGPT capabilities without leaving the DSH environment.
Core Features¶
- Coding conversation: Provides
openai-codexmodel routing, supporting streaming responses and image context input. - Account and usage management: Supports ChatGPT account login, CLI login import, cancel operations, and logout. Supports viewing plans and usage windows (when the service returns data).
- Image generation: Integrates the
imagegentool, supporting inline previews during generation, size settings, downloads, and status display for saving to the workspace. - Reference image editing: Supports editing based on images in the workspace or recent image attachments.
- Web search: Provides a Codex search provider, supporting cached, indexed, and real-time search modes.
- Native settings: Provides a full Codex settings page, compact plugin cards, and supports light/dark theme switching and Chinese/English labels.
Installation and Enabling¶
Before installing, ensure your environment meets the following requirements:
* DSH version 0.1.5 or later (adapter interface version).
* Node.js version 22.19+ or 24+.
If the dsh-codex plugin is already installed, since both use the openai-codex route, the old plugin must be removed before installing:
dsh plugin --profile web remove dsh-codex
Install the new plugin and start the Web interface:
dsh plugin --profile web add dsh-codex-adapter@latest
dsh web
After installation, open Settings → Codex to configure login. You can log in to ChatGPT via browser or device login, or import existing CLI login credentials. The login state is uniformly managed by DSH’s credential service.
Typical Usage¶
Image Generation
Enter a prompt in the conversation, and the plugin will process the request through the imagegen tool. For example:
Generate one watercolor illustration of an orange cat by a sunny window, with a small green plant and no text. Save it as window-cat.png.
The generated result will be displayed as an image card, including dimensions, file size, a download button, and workspace saving status. Generated images are persisted as attachments, supporting context references in follow-up conversations.
Web Search Configuration
Specify Codex as the search provider in DSH’s configuration file (DSH’s fetch provider is still managed by DSH itself):
# ~/.dsh/profiles/web/cordis.patch.yml
- id: web
config:
searchProvider: openai-codex
fetchProvider: http
Status Query
Use CLI commands to check plugin status or import credentials:
dsh plugin --profile web exec dsh-codex-adapter status
dsh plugin --profile web exec dsh-codex-adapter import
Use Cases and Notes¶
This plugin is suitable for developers who need to embed ChatGPT’s coding, image, and search capabilities into DSH workflows. The plugin runs with the permissions of the current DSH process; review the source code and license before installation.
Note that the plugin does not implement fast mode, native compression, or the /codex terminal command. Generated images can only be saved to the workspace in remote file systems that expose binary write permissions; otherwise, they will be retained as attachments.
Summary¶
By reusing the pi-ai library’s authentication flow and DSH’s PiAiAdapter contract, DSH Codex Adapter achieves seamless integration of ChatGPT Codex capabilities. It not only provides functional interfaces but also improves account management and settings interfaces, lowering the barrier to using ChatGPT capabilities within DSH. For more details and feedback, refer to the GitHub repository.