...` | parallel research workers (`--depth quick\|standard\|deep`, `--focus`) | | `dsho materials` | one worker per kind (`--kinds`, `--count`, `--url`) | | `dsho status [ref]` | overview, or details of a job or batch | | `dsho ls [--batches]` | list jobs or batches | | `dsho wait ...` | block until done (`--timeout`, `--any`) | | `dsho result ` | final answer(s) (`--files`) | | `dsho logs ` | timeline of tool calls (`-f`, `--full`, `--raw`, `--stderr`) | | `dsho files ` | files the job created | | `dsho continue ` | continue the same session | | `dsho cancel ` | stop a job or a whole batch | | `dsho collect ` | write `INDEX.md`, merge `manifest.json` and `sources.json` | | `dsho capture shot\|scroll ` | screenshots and scroll videos | | `dsho ws init ` | create a workspace with conventions in `AGENTS.md` | | `dsho ui [start\|login]` | open, start or log in to the DSH web UI | | `dsho skill install` | install or refresh the agent skill | | `dsho setup` / `dsho doctor` | one-time setup / environment check | | `dsho config [set\|unset]` | persistent settings | | `dsho guide` | the manual for agents | References: job id, batch id, unique prefix, name, `last`, `last-batch`. Common options: `-C ` workspace folder, `-m flash|pro|v4-flash|vision`, `--effort off|low|high|max`, `-t ` time limit, `-p ` parallelism, `-b auto|web|headless` backend. Every command has `--help`. ### JSON and exit codes Every command accepts `--json` and prints one object: `{ "ok": true, ... }` or `{ "ok": false, "error", "code", "hint" }`. | Exit code | Meaning | |---|---| | 0 | success | | 1 | a job failed, timed out or was cancelled | | 2 | usage error | | 3 | job or batch not found | | 4 | wait timeout reached, or the job is not finished yet | | 5 | environment problem (dsh missing, UI unreachable, Playwright missing) | ## The DSH web UI backend When the web UI is reachable, dsh-cli talks to its HTTP API (`POST /api/ / `): it registers the workspace folder, creates a session in it, names it, optionally selects a model, sends the task, and polls the session log until the turn that answers the task has ended. The session log is translated into the same event format the headless mode produces, so `logs`, `status` and `result` work the same everywhere. - `dsho ui start` starts `dsh web` in the background, captures the token URL it prints and logs in. - If you start `dsh web` yourself, pass the URL it prints once: `dsho ui login "http://127.0.0.1:3080/?token=..."`. The resulting cookie is stored in `~/.dsho/web-auth.json` (mode 0600) and stays valid for 30 days, also across restarts. - `-b web` makes a missing UI an error instead of falling back to headless. ## The headless backend and `dsho setup` Headless jobs run `dsh --profile orchestra --json -` in the job folder. `dsho setup` builds that profile from the shipped headless template plus: - MCP servers copied from another profile (default `web`): `--mcp research` (firecrawl, Brave, context7, Exa, Tavily, Perplexity, Jina and similar; default), `all`, `none` or a comma list of ids. Copied rows can contain API keys, so the profile file is written with mode 0600 and nothing is printed. - A curated skill folder (`~/.dsh/skills-orchestra`, symlinks into `~/.agents/skills`) instead of your whole skill pool, which keeps the worker prompt about a third smaller. `--skills a,b,c` picks others, `--skills all` keeps dsh defaults. - `.dsho-workspace` as an extra project root marker, so workers in batch subfolders still load the workspace `AGENTS.md`. ## Configuration `dsho config set ` stores settings in `~/.dsho/config.json`. Environment variables win over the file. | Key | Environment | Meaning | |---|---|---| | `dshRepo` | `DSHO_DSH_REPO` | use a dsh source checkout (wins over `dshBin`) | | `dshBin` | `DSHO_DSH_BIN` | path to the `dsh` executable (default: `dsh` on `PATH`) | | `webUrl` | `DSHO_WEB_URL` | origin of the DSH web UI (default `http://127.0.0.1:3080`) | | `backend` | `DSHO_BACKEND` | `auto`, `web` or `headless` | | `workspaces` | `DSHO_WORKSPACES` | root for new workspaces (default `~/dsh-workspaces`) | | `python` | `DSHO_PYTHON` | Python with Playwright for captures | Other variables: `DSHO_HOME` (state folder, default `~/.dsho`), `DSH_HOME` (dsh home, default `~/.dsh`), `DSHO_WEB_TOKEN_URL` / `DSHO_WEB_TOKEN_FILE` (token URL of the web UI). ## Files ``` ~/.dsho/ config.json settings web-auth.json cookie for the DSH web UI (0600) jobs/ / job.json, task.md, events.jsonl, stderr.log, result.md batches/ / batch.json logs/ runner logs / AGENTS.md, .dsho-workspace / one folder per batch job INDEX.md after dsho collect ``` ## Troubleshooting | Symptom | Fix | |---|---| | `dsh not found` | `npm install -g @deepseek-ai/dsh`, or `dsho config set dshBin ` | | jobs do not show up in the UI | `dsho doctor`; `dsho ui start` or `dsho ui login `; start jobs with `-b web` | | a job is `lost` | its runner process died (reboot, kill); start it again | | headless workers stall | set dsh's permission preset to full access for unattended runs (`dsho doctor` shows it) | | `dsho capture` fails | `pip install playwright && python3 -m playwright install chromium`; scroll videos need ffmpeg | | a page hangs during capture | the watchdog stops it after `--max-time` (default 90 s for shots) | ## Safety dsh workers can run shell commands; many setups run dsh with full access and no sandbox. Keep tasks scoped to the workspace and never delegate deletes, deploys, git pushes or anything that touches secrets. Material found by workers is not automatically yours to publish: check licence and source in `manifest.json`. See [SECURITY.md](SECURITY.md) for reporting vulnerabilities. ## Development ```sh git clone https://github.com/nicremo/dsh-cli && cd dsh-cli npm install npm test # node:test with a fake dsh and a fake web UI; never touches your real setup node bin/dsho.mjs help ``` Architecture notes: [docs/architecture.md](docs/architecture.md). Contributions are welcome, see [CONTRIBUTING.md](CONTRIBUTING.md). ## License [MIT](LICENSE). The logos in the demo animation belong to their owners (Anthropic, OpenAI, OpenCode, Pi, DeepSeek) and only identify compatible tools.