dsh-agent-picker: Selecting External Agent CLI via Dropdown in DSH

Preface

DeepSeek Harness (DSH) can invoke external Agent CLIs on the local machine, but “who executes by default” usually has to be written into the configuration. When switching tools or machines, you have to change the configuration. The community plugin dsh-agent-picker (directory identifier Ok541151/cwk, npm package name dsh-agent-picker) adds a control to the right side of the input box in the Web UI. It works similarly to selecting a reasoning profile: pick an external Agent CLI as the default executor for the current session, and automatically detect CLIs already installed on the local machine. The roster is driven by agents.json; adding a new Agent is mainly about adding data rather than modifying plugin code.

What is this

Maintainer Ok541151, GitHub repository Ok541151/cwk, classified as Workflow on SkillHub. The plugin only handles scheduling and does not bundle any Agent; the list content comes from local detection, and having an empty factory roster is intentional.

Core features

UI and executor selection

Provides an Agent mode picker to the right of the DSH Web input box. The selected item determines which external CLI executes the current task by default. The plugin turns “which Agents exist, and how to launch them” into data (agents.json and a user-side copy).

Auto-discovery of installed CLIs

Detection order: PATH → managed directory (default ~/dsh-clis/bin, can be overridden by the environment variable DSH_AGENT_PICKER_CLI_DIR) → ~/.local/bin. The README states that it has built-in recognition of 31 Agent names, 11 of which have verified launch recipes (callable once detected), and 20 are recognized only and require adding a launch in the roster or a conventional directory before they can be invoked.

Only detection names with 4 or more characters are accepted (amp, the official Sourcegraph CLI, is an exception), to reduce false positives from unrelated programs with the same name.

Data-driven roster

On first startup, it copies the bundled agents.json to $DSH_HOME/agent-picker.agents.json (default ~/.dsh/). After that, modifications follow this copy, and plugin upgrades do not overwrite it. It also supports landing entries via $DSH_HOME/agent-picker.d/*.agent.json (mentioned in the README’s security notes).

Roster fields include: id, name, tool, bin, available, kind (task / chat), expertise, note, desc, and an optional launch (including bin / argv / env / timeoutMs / graceMs / maxBytes). When launch is configured, the plugin registers a cli_<id>_direct tool.

In launch.argv, use bare filenames or {cliDir}/..., which are resolved by the runtime to cliBinDir; absolute paths can be kept as-is. Placeholders include {task}, {permflags}, {permission}, {model}, {image}; {permflags} is expanded from permFlags / defaultPermFlags in the roster.

Permission levels and tool parameters

The tool’s optional parameter permission accepts read-only / workspace-write / danger-full-access, which are translated into each CLI’s own arguments (not a sandbox created by the plugin itself). When omitted, it uses the default level documented for each Agent to avoid headless execution getting stuck on approval. The body argument for all Agent tools is uniformly prompt (task is a compatibility alias).

Compatibility with DSH versions

dsh.compatibility declares >=0.1.5. The plugin only uses ctx.tools.register, ctx.tools.guard, ctx.subprocess, ctx.webServer.register, and does not rely on removed settings registration APIs.

Installation and activation

The official installation command is:

dsh plugin add dsh-agent-picker

Restart DSH after installation. To customize the Agent list or launch methods, edit $DSH_HOME/agent-picker.agents.json or follow the in-UI “How to add? ▼” guidance to write .agent.json in a conventional directory, then restart DSH again.

Typical usage

1. Use CLIs with built-in recipes after installation

Install locally the Agents listed in the README that have launch recipes (such as Aider, Qwen Code, Gemini CLI, Codex, Claude Code, Cursor CLI, etc.). After restarting DSH, select the corresponding item in the dropdown as the default executor. Some Agents also require credentials or local services (for example, Ollama requires a local service and the model name in the recipe is qwen3:4b; Qwen Code requires DEEPSEEK_API_KEY, etc.). The README explains these separately in the “Additional requirements” table.

2. Add a launch recipe for a “recognized only” CLI

When the list shows “Detected, launch method required”, expand “How to add? ▼”: copy the --help command with the real path, confirm the flags for one-shot execution, then modify argv according to the template and save it to a conventional directory, for example:

{
  "id": "copilot",
  "name": "GitHub Copilot CLI",
  "tool": "cli_copilot_direct",
  "kind": "task",
  "launch": { "bin": "C:\\your-path\\copilot.CMD", "argv": ["-p", "{task}"] }
}

After saving, restart DSH, and the entry will move from pending configuration to a callable state.

3. Manually add an Agent to the roster

Append an object to the agents array in $DSH_HOME/agent-picker.agents.json, filling in fields such as id, name, tool, bin; add launch if the plugin should directly start the process. Restart DSH after changes.

Use cases and notes

Who it is for: Users who frequently switch between different CLIs such as Claude Code, Codex, Aider, and local Ollama on the same machine, and want to select via the UI instead of changing global configuration; also suitable for extending self-developed Agent wrappers via JSON.

Platforms: The README states that the author mainly tested on Windows; the macOS / Linux code is written for POSIX but not fully validated on real machines. Behavior such as bare-name detection via PATH on POSIX has assertion protection, and each CLI’s own behavior should be verified separately.

Security and permissions: The plugin starts external programs locally according to the roster, and child processes inherit the current user’s permissions; it is not a sandbox. launch.bin / launch.argv in the roster, JSON files in conventional directories, and same-named commands on PATH can all become part of the execution surface. Before installation, it is recommended to read the repository source code and the MIT license (package.json version 0.5.2), and restrict permissions on the $DSH_HOME directory. When starting child processes, the plugin strips environment variables whose names contain KEY/TOKEN/SECRET/PASSWORD and all DSH_*, and has default timeouts and output caps.

Common misconceptions: Appearing in the list does not mean it can be invoked—missing recipes, leftover npm shims, missing credentials, or missing services can still cause failures. The README uses PowerShell examples to explain how to check whether a shim still points to a valid executable.

The DSH ecosystem emphasizes “everything is a plugin”; community directories such as SkillHub are independent sites and have no official affiliation with DeepSeek / HiuFang.

Links

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye