Files
deepseek-harness/apps/cli
Turtle 870fb1cafa refactor(cli): make dsh the sole terminal front door, drop RESUME_SESSION_ID
Remove the redundant dsh-tui-demo bin and the RESUME_SESSION_ID environment
variable, leaving dsh as the one terminal entrypoint.

The dsh-tui-demo package was a plugin (the TUI app bundle mounted by dsh's
config) plus a bin that booted a leaf cordis.yml — the same job `dsh [config]`
does. The bin, its ./bin export, its built-bin.e2e.ts, the tsdown bin entry,
and the now-unused dsh-app-boot dependency are removed; the package keeps its
plugin and invariant. demo:cordis, demo:code-mode, and the tui-agent and
cordis-agent keyless PTY smokes now launch through apps/cli/src/bin.ts with the
config as the positional argument. cli-demo/acp-demo/jsonrpc-demo keep their
bins (distinct surfaces).

RESUME_SESSION_ID was the only bridge from --resume into the shipped config;
--resume now provides the id on the boot context via ctx.provide(
RESUME_SESSION_ID_KEY, id), and the four configs read it as a bare identifier
through a quoted typeof-guarded !!js expression. The TUI resumeCommand fixtures
and docs move to `dsh --resume {session}`.

Agent Note and its Chinese pair updated; config-catalog regenerated.
2026-07-25 12:43:59 +08:00
..

@deepseek-ai/dsh

The dsh command-line entry follows the apps/ assembly tier: apps/* are product assemblies over packages/* libraries. Plain dsh [config.yml] boots the interactive TUI coding agent, dsh -p "task" runs one headless turn, and dsh web serves the browser UI.

Argv is parsed once through a Commander adapter (src/args.ts) that resolves the invocation into a single mode; src/bin.ts switches on that mode and dynamic-imports only the chosen mode's module. dsh --help and dsh web --help render usage, dsh --version prints this app's version, and an unknown option or an invalid --host/--port/--resume value fails loud (stderr, exit 1) instead of misrouting.

The TUI surface:

  • boots the shipped default config (examples/tui-agent/cordis.yml) or an explicit config argument, through dsh-app-boot;
  • resumes a persisted session with dsh --resume <session-id> and, when the Node host exposes process.execve, supplies the TUI's in-place handoff host: after selector preflight and current-session flush, the host disposes the app and replaces the process with a normalized dsh --resume <id>; runtimes without process replacement keep the displayed command fallback. The flag provides the id on the boot context under RESUME_SESSION_ID_KEY (no environment variable), which the shipped config reads through !!js, and a missing or unreadable id fails loud instead of creating a fresh session;
  • treats the invoking directory as the workspace — sessions, relative paths, and workspace instructions resolve from the cwd;
  • tells the agent where its own source lives: after boot it adds a prompt section naming this harness checkout, resolved from the launcher's real path so it holds under a PATH symlink and an arbitrary cwd, so the self-referential cordis toolset can read and modify it;
  • applies the personal overlay from ~/.dsh (see app-boot's Personal config): .env fills environment gaps (ambient > project .env > personal .env), config.yaml patches the booted tree.

The Web surface treats its invoking directory as the default project, loads applicable AGENTS.md/CLAUDE.md instructions into each agent-loop request prefix with a 65,536-byte render budget, and opts into first-message model titles. The headless surface retains deterministic fallback titles without making the auxiliary title-model request.

Install (developer machine)

Symlink the source-running launcher onto your PATH; it resolves the checkout through its own real path, so code changes apply on the next launch with no build step:

ln -sf "$(pwd)/bin/dsh" ~/.local/bin/dsh

pnpm run demo:tui runs the same entry from the repo root. The built form (lib/bin.js, via pnpm run build) boots the same config under plain Node.