Preface

The plugin ecosystem for DeepSeek Harness is designed to address feature extension and workflow automation. During local development or debugging of Harness, developers often face repetitive operations such as code synchronization, dependency installation, and service restarts. The dsh-selfup plugin encapsulates these operations and provides a unified maintenance entry point, allowing developers to directly manage the state and deployment of the Harness repository within a DSH session.

What This Is

This is a plugin package maintained by geokkjer for managing self-updates and deployment of the DeepSeek Harness repository. It consolidates Git operations, dependency installation, CLI installation, and systemd service management into four tool commands, running within the checkout directory of the Harness repository.

Core Features

The plugin provides four main tools:

  1. dsh_update_status
    A read-only snapshot of repository and deployment status. It includes the repository path, branch, HEAD commit, ahead/behind status relative to origin/master, the number of dirty files in the working tree, CLI version, whether the built binary exists, and the systemd unit status.

  2. dsh_update
    Executes the update workflow in the following order: git fetch, git merge --ff-only, pnpm install, and pnpm run build. Each step runs independently and can be skipped. If the build fails, it automatically attempts cleanup and retries. After a successful update, the service can be restarted automatically.

  3. dsh_install
    Installs the dsh CLI tool. mode=local (default) writes the built CLI to ~/.local/bin/dsh, or falls back to a source launcher; mode=arch uses makepkg to build an Arch package from the npm tarball.

  4. dsh_systemd
    Manages the systemd user service for dsh web. It supports writing the service file, starting, stopping, restarting, and querying status.

Installation and Enablement

Install the plugin into the web profile:

dsh plugin --profile web add dsh-selfup

After installing the plugin, restart the dsh web server to use the tools above in a session.

Typical Usage

  1. Check the current status:
   dsh_update_status
  1. Update the code and rebuild:
   dsh_update
  1. Install the CLI tool locally:
   dsh_install mode=local
  1. Restart the dsh web service:
   dsh_systemd action=restart

Applicable Scenarios and Notes

  • Environment Requirements: A checkout of the DeepSeek Harness repository is required (located using git rev-parse --show-toplevel), along with the git, node, and pnpm commands. If using the Arch package build mode, makepkg must be installed additionally.
  • Session Impact: The start or restart actions of dsh_systemd will terminate the current calling session. New code only takes effect after the session ends.
  • Permission Restrictions: The plugin follows sandbox policies. Write operations in Shell calls (such as installing a launcher or writing service files) are restricted by the current session’s sandbox policy, not by the executor’s default restrictions.

Short Conclusion

By encapsulating code updates, dependency management, and service operations into a DSH plugin, dsh-selfup reduces the manual effort required for local Harness development. Combined with its MIT license, developers can freely integrate and extend it.