Introduction¶
In the DSH plugin ecosystem, the terminal frontend needs to handle streaming text, tool calls, session recovery, and permission approval simultaneously. dsh-pi-tui provides one such implementation: the UI interaction is based on pi’s TUI (@earendil-works/pi-tui), with the kernel provided by the official DSH mechanism.
What is this¶
dsh-pi-tui is a DSH plugin with a repository path of lqhl/dsh-pi-tui and an MIT license. It integrates the terminal interface of pi TUI with the official DSH mechanism, making it suitable as an interactive terminal frontend for DSH agents.
Core Features¶
- Streaming rendering of incremental Markdown for
assistant/chunkand displaying thinking collapsible tags. - Tool call cards: three states (Running, Success, Failure), with parameters and result previews.
- Colored diff highlighting for
write/editresults. - Inline rendering of
read_imageresults in kitty/iTerm2 terminals. - Slash command auto-completion and dynamic discovery.
- Permission approval popups and
ask_user_questioninteractive forms. - Session management: Create, Resume, Fork, Sub-agent tree, Selector.
- Transcript search,
/retryto resend failed turns,/copyto copy assistant/tool results/errors/id/resume commands. - Long session collapsing and
/expand-allto expand. - Status bar displaying provider/model, preset, plan, goal, context pressure, session id, git branch, token stats, todo progress, and background task count.
- Startup banner and switching official
/permissionpresets.
Installation and Enabling¶
Prerequisites: Official dsh CLI and pnpm.
First, add the plugin profile, then start:
dsh plugin --profile pi-tui add dsh-pi-tui
dsh --profile pi-tui
dsh --profile pi-tui --resume <session-id>
dsh --profile pi-tui --preset <id>
The first command adds dsh-pi-tui and initializes the pi-tui profile; the latter three are used for new sessions, resuming a specific session, and selecting an agent preset.
Typical Usage¶
dsh --profile pi-tui
dsh --profile pi-tui --resume <session-id>
dsh --profile pi-tui --preset <id>
Common operations within a session:
- Enter to submit, Shift+Enter for a new line.
- Ctrl+T to expand/collapse thinking blocks.
- Ctrl+F to search within the transcript.
- /model [query] to switch models.
- /resume [query] to list/resume persisted sessions.
- /permission [preset] to switch the official permission preset.
- /retry to resend a failed turn.
- /copy to copy assistant, tool results, errors, ids, or resume commands.
- /expand-all to toggle long session collapsing.
Applicable Scenarios and Notes¶
Suitable for developers already using DSH and wishing to handle streaming output, tool cards, session management, and permission approval in the terminal. It is recommended to check the source code and license before installation; the plugin runs with the permissions of the current dsh process. When switching /permission [preset], ensure that the sandbox mode and approval strategy align with expectations.
Version support is based on the tested range: dsh 0.1.0-rc.6 and node >= 22.19 have been tested; other rc versions are unverified. The license is MIT; component logic adapted from pi coding-agent interactive mode retains the original author’s copyright. The release is handled by GitHub Actions via npm Trusted Publishers (OIDC), signed with provenance, and triggered by v* tags, requiring no tokens.
Links¶
- GitHub: https://github.com/lqhl/dsh-pi-tui
- Directory page lead: https://www.skillhub.cn/plugins/lqhl/dsh-pi-tui (provided as a lead, not verified in the retrieved materials)