Introduction

DeepSeek Harness (DSH) uses a plugin architecture, and extending its functionality typically requires writing custom scripts. For developers who frequently perform operations on GitHub repositories, integrating the GitHub CLI (gh) directly into the DSH environment is a common efficiency need. dsh-ghCLI is a plugin designed for this purpose. It encapsulates the core gh and git workflow in DSH’s settings interface, allowing the full process from installation and authentication to repository management to be completed without leaving the current environment.

Plugin Positioning

dsh-ghCLI is a gh CLI integration plugin for DeepSeek Harness (DSH).
* Maintainer: sweven-tears
* License: MIT
* Core value: Provides a unified GitHub CLI management entry inside DSH, addressing pain points such as environment configuration, multi-account switching, and network proxy issues.

Core Features

The plugin provides three capabilities through the DSH “Settings → GitHub CLI” interface:

  1. gh installation detection and self-repair

    • Automatically detects whether gh is installed locally and its version.
    • One-click installation, update, or specify the installation path for gh.
    • Windows network proxy self-repair: Resolves connection timeouts caused by git not reading the system proxy on Windows (a pitfall workaround).
  2. Multi-account authentication management

    • Supports token login (including enterprise GH_HOST configuration).
    • Account switching, logout, and token refresh.
    • Synchronously manages Git global configuration (user.name / user.email).
  3. High-frequency Git repository operations

    • Clone repositories (supports shallow clone; non-empty directories require confirmation).
    • Push / Pull / create pull requests / open remote pages.
    • Fork repositories, create new repositories, and manage repository stars.

Installation and Enablement

The plugin is published as an npm package and installed using the dsh plugin command.

Installation Command

Run the following command in your terminal to install the plugin into the web profile:

dsh plugin --profile web add @sweven-tears/dsh-ghcli -w

Installation notes:
* The -w flag is required: The web profile directory is the pnpm workspace root; omitting it will cause an error.
* Authentication: If installing from GitHub Packages, first run npm login --registry=https://npm.pkg.github.com/ --scope=@sweven-tears.
* Verification: After installation, restart DSH, refresh the page, and navigate to “Settings → GitHub CLI” to see the plugin interface.

Typical Usage

After launching the plugin, ensure that the gh CLI is installed locally and authentication has been completed.

1. Install the gh CLI (if not installed)

The plugin settings page provides guidance. You can also install it manually:
* Windows (winget recommended):

    winget install --id GitHub.cli -e --source winget
  • macOS:
    brew install gh
  • Linux:
    sudo apt install gh

2. Authenticate and log in

In the “🔐 Accounts and Git” tab on the settings page, paste a Personal Access Token (requires repo and read:org scopes) or log in from the command line:

gh auth login --with-token

Optionally, run gh auth setup-git to allow git to reuse gh credentials.

3. Perform repository operations

In the “📁 Repository Management” tab, you can click buttons directly to clone, create pull requests, or fork repositories, without manually writing git/gh commands.

Technical Implementation and Notes

Architecture

The plugin is a standard DSH plugin package (npm format) and consists of two halves:
* Host half: Runs in the DSH host process and handles low-level command execution (gh / git), using absolute paths to ensure compatibility.
* Client half: Loaded into the Web GUI and registers settings page slots.

Key Characteristics

  • Absolute path execution: All gh and git commands are resolved to absolute paths before execution to avoid failures caused by stale PATH environment variables.
  • Long-running command control: Cloning, installation, and other long-running commands (default 5-minute timeout) can be canceled at any time.
  • Security: Cloning into a non-empty directory requires mandatory confirmation; tokens are only written locally via gh auth login --with-token and are not uploaded.

Notes

  • Authentication tokens are written locally only and are not uploaded.
  • gh repo create --source <dir> --push will push the contents of the current directory. Confirm before using.
  • The Create PR button is only available when the repository has differences and the local branch is ahead.