Introduction¶
In agent development, you often need to operate files or execute commands on remote machines. If the target machine is on an intranet or accessed through NAT, direct connections are often difficult. Although DeepSeek Harness (DSH) provides a powerful plugin ecosystem, for the “remote machine as local workspace” scenario, integrating external services such as E2B is usually required.
The dsh-anywhere plugin solves this problem. It merges the “reachability layer” (Fleet) and the “execution world layer” (World), allowing you to deploy the DeepSeek Harness workspace on any machine, whether it is a public server, an intranet box, or a device behind NAT.
What Is This¶
dsh-anywhere is a DSH plugin maintained by tangwenhao616-netizen. It aims to turn a remote machine into the local session’s filesystem and subprocess runtime over the SSH protocol.
It does not depend on external npm packages. Instead, it directly uses the system SSH CLI for file read/write operations and command execution, while optimizing performance through OpenSSH’s ControlMaster connection reuse mechanism.
Core Features¶
- Fleet mode (reachability layer): Registers a machine behind NAT in your DSH cluster using one-time tokens and reverse tunnels, making it appear as a
dsh-sshhost. - World mode (execution world layer): Promotes any SSH-accessible machine into the session’s
ctx.fs(filesystem) andctx.subprocess(subprocess), so the model’s nativeread,write,bash, andgrepoperations act directly on the remote machine. - Native SSH execution: Fully based on the system SSH CLI, with no extra dependencies. Paths and content are transmitted via base64, eliminating concerns about shell injection.
- High-performance file operations: Uses OpenSSH
ControlMasterconnection reuse, keeping file micro-operation latency around 40ms. - Cancellable long-running commands: Supports interrupting long-running commands by terminating the connection.
Installation and Enablement¶
When installing the plugin, you must use --profile to specify the configuration file, and you should not use a link: symlink approach, because the name in --patch is resolved relative to the configuration file directory.
dsh plugin --profile <your-profile> add dsh-anywhere
After installation, the plugin provides the /fleet panel and the dsh-anywhere/world entry point. The dependencies @deepseek-ai/dsh-fs and @deepseek-ai/dsh-subprocess are provided by the DSH runtime.
Typical Usage¶
After installation, you can use the following commands to bring a remote machine into the workspace.
Example: Run a remote command and write a file
Assuming you have configured workspace-on-machine.patch.yml, you can specify the configuration with the -patch parameter:
dsh --profile headless --patch ./workspace-on-machine.patch.yml "run 'uname -n' and write MERGED-WORLD-OK to /tmp/selftest.txt"
Example: Install the plugin
dsh plugin --profile <your-profile> add dsh-anywhere
In World mode, it is recommended to set an environment variable to obtain full access:
DSH_PERMISSION_MODE=danger-full-access \
dsh --profile <your-profile> --patch ./workspace-on-machine.patch.yml "work on this machine"
Working Modes¶
dsh-anywhere provides two complementary modes:
1. Fleet Mode: Make Unreachable Machines Reachable¶
Fleet mode is mainly used to solve network topology problems.
- Flow: Run the initialization script on the Relay VPS to generate a rendezvous point; run curl <base>/join | bash on the target machine; verify the pairing code and approve it in the Hub /fleet panel.
- Security: The machine’s sshd binds only to the Relay’s loopback address, and tokens are one-time, expirable, and revocable.
- Usage: At this point, the machine appears as a fleet-* dsh-ssh host, and you can operate it with tools such as ssh_exec and ssh_upload.
2. World Mode: Make a Machine a Workspace¶
World mode is mainly used to improve productivity.
- Mechanism: By bridging ctx.fs and ctx.subprocess, it allows all of the Agent’s native file and Shell tools to run remotely.
- Capabilities: Supports tools such as read, write, edit, bash, grep, and LSP, automatically acting on the remote machine without modifying tool code.
- Limitation: It must satisfy the “one-world invariant”: fs.cwd must be equal to subprocess.cwd (usually specified by cwd in the patch configuration), otherwise relative paths will stop working.
Applicable Scenarios and Notes¶
Applicable scenarios:
- Development and debugging that require frequent operation of remote Linux servers.
- Agent systems that require direct control over edge devices located on intranets or behind NAT.
- Building lightweight remote development environments without external dependencies such as E2B.
Notes:
- Installation method: Be sure to install it correctly using dsh plugin add, and avoid module resolution errors caused by link:.
- Permission configuration: In World mode, the permission mode should be set to danger-full-access.
- Environment consistency: Ensure local and remote filesystem path configurations are consistent to avoid path misalignment.
- Operating system: Windows remote hosts require the OpenSSH client and server to be installed, and PowerShell to be configured.
Summary¶
dsh-anywhere bridges the boundary between the local Harness and remote machines over the SSH protocol. It provides both the network traversal capability of Fleet mode and the full workspace support of World mode, with no external dependencies. For those who need to build cross-machine agent workflows, it is a direct and efficient tool.
- Directory page: https://www.skillhub.cn/plugins/tangwenhao616-netizen/dsh-anywhere
- GitHub: https://github.com/tangwenhao616-netizen/dsh-anywhere