Back to marketplace

dsh-docker

Coding Tools

STARDUSTLC666/dsh-docker

Container management plugin for DeepSeek Harness agents, providing docker_ps/logs/inspect/exec/manage tools via the official subprocess service with argv-based no-shell injection protection, exec approval gate, and zero runtime dependencies.

  • deepseek-harness
  • devops
  • docker
  • dsh-plugin
GitHub Stars
3GitHub
Views
0DSH Plugin Hub
Forks
0GitHub
Open issues
0GitHub Issues
Manifest version
0.3.0@stardustlc/dsh-docker
Latest push
Aug 26, 2026GitHub
License
MITTypeScript
Plugin type
HostRuns in the DSH Host

README

View source

English

dsh-docker

你的 agent 会管容器了:六个工具覆盖容器/镜像列表、日志、详情、容器内执行与生命周期管理。

DSH(DeepSeek Harness)容器管理插件:走官方 subprocess 服务跑 docker CLI,argv 数组无 shell 注入,docker_exec 默认审批门,零运行时依赖

npm version npm downloads license stars

Awesome DSH Plugin

兼容性

@deepseek-ai/dsh@0.1.1-rc.2 上验证(2026-08-26)。遵循 cordis 组合包补丁模型(cordis.patch.yml + dsh.bundle.patch),运行时不 import 任何 @deepseek-ai/* 内部模块。

安装

dsh plugin --profile web add @stardustlc/dsh-docker

需要本机装有 Docker(docker version 能出结果即可);不在 PATH 上时用 dockerPath 指定。

卸载

dsh plugin --profile web remove @stardustlc/dsh-docker

卸载后重启 Web 服务。如需彻底清理,可再手动删除自己 profile cordis.patch.yml 中覆盖的插件行。

配置

- id: docker
  name: '@stardustlc/dsh-docker'
  config:
    # dockerPath: C:\Program Files\Docker\Docker\resources\bin\docker.exe
    dockerPath: docker     # 可选;也可用环境变量 DSH_DOCKER_PATH
    timeoutMs: 60000       # 单次操作超时(默认 60 秒,5 秒 - 10 分钟)
    # execApproval: false  # 关闭 docker_exec 审批门(默认 true)

工具一览

工具作用安全
docker_ps列出容器(状态/镜像/运行态,可过滤)
docker_images列出本地镜像(仓库/标签/大小/创建时间,可只看悬空镜像)
docker_logs查看日志尾部(行数钳制,可短时 follow)
docker_inspect容器详情(镜像/状态/端口)
docker_exec容器内执行命令审批门 + 容器名白名单校验
docker_managestart / stop / restart / rm明确提示破坏性

示例

docker_ps {}
docker_ps { all: true, name: web }
docker_images { dangling: true }
docker_logs { container: web, tail: 200 }
docker_inspect { container: web }
docker_exec { container: web, command: 'df -h' }
docker_manage { container: web, action: restart }

安全设计

  • 无 shell:全部参数独立 argv 数组,命令注入不可能
  • 审批门:docker_exec 默认弹审批(对齐 dsh-email / dsh-sql),headless 无审批通道时拒绝
  • 容器名校验:只允许 [A-Za-z0-9][A-Za-z0-9_.:-]*,杜绝参数注入
  • 超时钳制:单次操作 5 秒 - 10 分钟;follow 模式额外限 30 秒
  • 日志钳制:tail 1-2000 行

开发

pnpm install
pnpm test       # 构建 + 24 个测试

License

MIT

Comments

0
Newest first