acryl-dsh-editor-plugin-cli
其他 活跃维护

acryl-dsh-editor-plugin-cli

cordisplugins/acryl-dsh-editor-plugin-cli

为 acryl-cli 终端界面添加原生 /files 命令,可直接浏览目录、查看文件内容并就地编辑,无需切换工具;作为轻量级插件集成,保持终端工作流连贯,操作流畅。

1
Stars 标星
0
Forks 分支
1
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
73 KB
仓库大小
2 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:cordisplugins/acryl-dsh-editor-plugin-cli
git clone https://github.com/cordisplugins/acryl-dsh-editor-plugin-cli.git
git clone git@github.com:cordisplugins/acryl-dsh-editor-plugin-cli.git
README.md main

DSH Editor (CLI)

A native /files command for DeepSeek Harness (DSH)'s
terminal surface (acryl-cli) - browse, view, and edit files without
leaving the TUI.

This is the TUI-native sibling of
acryl-dsh-editor-plugin-web,
built for acryl-cli's own presentation-slot extension point
(tuiCommands, spec 034 T009) rather than a browser client bundle. There is
no Host/Client split here: the CLI and its Cordis Loader tree share one
process, so this plugin's own apply(ctx) both registers the /files
command and reads/writes files directly - no wire protocol to design.

Features (v2)

  • File tree - browse from your home directory, directories-first
    sorting, .. to go up. Vim-style h/j/k/l work alongside arrows.
  • Filter - / starts an incremental, case-insensitive name filter over
    the current directory's listing.
  • File viewer - scrollable, line-numbered.
  • Editor - press e while viewing a file to edit it in place: cursor
    movement, character insert/delete, newline splitting, and ctrl+s to
    save. Saves go through a same-directory temp-file-then-rename, so a
    mid-write failure never leaves a half-written file on disk.
  • Back navigation - Escape (or ←/h) steps back one directory level
    at a time, restoring your selection to wherever you drilled in from,
    before finally closing the overlay once you're back at the start.
    Escape also steps back out of search, view, and edit modes the same way.

Deliberately still not built: cross-file/recursive search, git diff,
Markdown rendering, syntax highlighting. Syntax highlighting in particular
was evaluated and skipped deliberately - see the top-of-file comment in
lib/index.js for why (it needs a different rendering model than this
plugin's plain pi-tui Component contract provides).

Install

dsh plugin --profile <name> add acryl-dsh-editor-plugin-cli

(Each profile is its own single-package pnpm workspace, which currently
needs -w to satisfy pnpm's own workspace-root safety check:
dsh plugin --profile <name> add acryl-dsh-editor-plugin-cli -w.)

After installing, restart acryl tui. Type /files at the prompt.

Requirements

  • Node.js >= 20
  • acryl-cli with tuiCommands (spec 034 T009 or later) - the extension
    point this plugin registers against. Installing this on a surface without
    it (Web, Desktop) leaves the plugin's row simply inactive, not crashed:
    tuiCommands is a hard inject requirement, so the Fiber just never
    activates there.

Architecture

A DSH TUI plugin declares itself via the npm package's dsh field
(dsh.bundle.patch -> cordis.patch.yml, which inserts the row) - the same
convention every DSH plugin uses. Unlike a Web plugin, there is no
dsh.client field: lib/index.js is a standard Cordis Host plugin whose
apply(ctx) calls ctx.tuiCommands.register({command, description, open}),
where open({tui, close}) returns a real pi-tui Component built and
owned entirely by this package.

License

MIT