- Home
- Plugin
- Integrazioni e accesso remoto
- dsh-ops-kit
dsh-ops-kit
shenlongze/dsh-ops-kit
Server operations over SSH from a DSH chat: multi-host overview, health score, service monitors, backups and restore, TLS certificates, cron, config rollback, one-click deploy and AI diagnosis.
Installazione
dsh plugin --profile web add github:shenlongze/dsh-ops-kitREADME
dsh-ops-kit
English | 简体中文
Server operations from a DeepSeek Harness chat: 34 tools plus a sidebar panel, no SDK, and no credentials stored by the plugin.
🔒 marks an action that needs confirm: true — the tool fails closed instead of
asking in a second turn.
Connect and inventory
| Tool | What it does |
|---|---|
ops_hosts | list / add / update / remove SSH hosts (~/.dsh/ops-kit/hosts.json) |
ops_ssh_test | connectivity, latency and the auth kind actually used |
ops_ssh_install_key | install this machine's public key using the stored password |
ops_inventory | read-only scan: listening ports, services, containers, nginx sites, java processes, crontab, mounts |
Look at a host (read-only)
| Tool | What it does |
|---|---|
ops_status | uptime + load, memory, root disk, failed systemd units, containers |
ops_check_all | every host in parallel, one summary row each, appends to history |
ops_health | 0–100 score plus the issues worth fixing first |
ops_metrics | CPU / memory / disk samples over a window (capped at 20 000 rows) |
ops_ps | top processes by CPU or memory |
ops_disk | directory sizes one level below a path |
ops_logs | journal unit or log-file tail |
ops_files | directory listing with sizes and mtimes |
ops_ssl | certificate subject, issuer, expiry for one domain |
ops_diagnose | plain-language diagnosis with suggested next actions |
Change something
| Tool | What it does |
|---|---|
ops_run | one shell command; a destructive denylist needs 🔒 |
ops_batch | the same command on several hosts in parallel |
ops_service | systemctl status/logs/start/stop/restart (start/stop/restart 🔒) |
ops_docker | docker ps/logs/inspect/restart (restart 🔒) |
ops_kill | TERM / KILL / HUP one pid 🔒 |
ops_cleanup | vacuum the journal, truncate rotated logs 🔒 |
ops_monitors | http / port / process / service / script heartbeat checks |
Config and files
| Tool | What it does |
|---|---|
ops_config | scheduler settings: interval, disk threshold, timeouts, quick commands, AI model |
ops_config_file | read one configuration file |
ops_save_config | write a config file after backing it up 🔒 |
ops_file_history | .bak.<ts> versions of a file, diff, rollback 🔒 |
Backups, certificates, schedule, deploy
| Tool | What it does |
|---|---|
ops_backup | MySQL dump or directory archive, list, restore, delete, retention N |
ops_cert | certificate days left, certbot renew --dry-run, real renewal |
ops_cron | list / add / remove crontab entries |
ops_deploy | git pull → build → restart → health check, automatic rollback |
Alerts and AI
| Tool | What it does |
|---|---|
ops_channels | alert delivery to Feishu / DingTalk / WeCom / any webhook, plus test send |
ops_alerts | recent alerts from the scheduled checks |
ops_ask | natural-language question; the model runs read-only commands itself |
ops_ai_command | turn an intent into ONE command, without executing it |
ops_ai_models | providers and models the ops AI can use |
Design
- No SDK, no credential storage by default. Key authentication goes through
the system
sshclient inBatchMode, so the plugin never reads your keys. Password authentication uses the plugin's ownssh2client and is the only case where a secret is stored (see below). - Password or key. A host can be added with only IP + user + password; that
path needs
ssh2present in the profile. A host without a stored password uses the systemsshclient and your keys or agent. - Inventory outside the profile. Hosts live in
$DSH_HOME/ops-kit/hosts.json(default~/.dsh/ops-kit/hosts.json), so upgrading or removing the plugin does not lose them. - Read/write separation. Health checks are always read-only. Anything that
changes a service or container requires
confirm: true. - Bounded output. Tool results are clipped at 8 KB with an explicit truncation marker, so a runaway log line cannot flood the model context.
Install
dsh plugin --profile desktop add dsh-ops-kit
A task-oriented walkthrough (setup checks, the ten panel pages, setting defaults, data sensitivity, troubleshooting) is in docs/USAGE.md, also available in Chinese: docs/USAGE.zh-CN.md.
Local development install (directory):
Plugins → Add plugin → select this directory
Panel
The bundle ships a sidebar page (Ops) with ten sub-pages per host: overview,
monitor, config, apps, logs, files, terminal (real PTY), backups, tasks, deploy.
The overview lists hosts and runs one host or all hosts at once; runs are
recorded in $DSH_HOME/ops-kit/history.json. The panel talks to the host half
through /ops-kit/api/*.
Restart, stop, restore and rollback all ask for confirmation in the panel first.
First run
ops_hosts action=add name=web-1 host=10.0.0.11 user=deploy key=~/.ssh/id_ed25519 defaultHost=true
Then just ask:
看一下 web-1 的状态
nginx 最近 50 行日志
把 web-1 上的 my-api 重启一下(我确认)
Limits (deliberately not implemented)
- No cloud APIs (Aliyun / Tencent / AWS). This kit only speaks SSH.
- No application-level deploys beyond
ops_deploy(no Docker Compose, no k8s). - No Windows remoting: SSH to Windows works only if the host runs an SSH server with a POSIX-like shell.
- Metric retention is a bounded row cap, not a time-series database.
0.3.0 — backups, health score, certificates, cron, config history, deploy
- Backups & restore.
mysqldumpfor a database ortar.gzfor a directory, stored under/home/backupby default, keep N copies, restore in one click. - Health score. 0–100 per host with the two or three issues that matter, shown on the server detail page.
- Certificates. Every nginx
server_nameis probed for its expiry date;certbot renew --dry-runbefore a real renewal; alerts at 14 / 7 / 3 days. - Scheduled tasks. The server crontab, readable and editable from the panel.
- Config history. Every
.bak.<ts>version of a file can be diffed and rolled back. - One-click deploy. git pull → build → restart → health check, with an automatic rollback to the previous commit when the health check fails.
Alert delivery
Alerts produced by the scheduler (host down, disk pressure, failed units, monitor failures, certificate expiry) are pushed to the configured channels:
feishu→{"msg_type":"text","content":{"text":...}}dingtalk/wecom→{"msgtype":"text","text":{"content":...}}webhook→{"text":...,"alerts":[...]}for anything else
Each channel chooses which levels it receives (critical / warning / info). The
same alert is not resent within 10 minutes. Channels live in
~/.dsh/ops-kit/channels.json with mode 0600, because the URL itself is a secret.
License
MIT
Plugin correlati
dsh-purge
kingcharleslzy-ai/dsh-purge
dsh-web (dsh-ssh)
zhu1090093659/dsh-web
dsh-web (dsh-remote-web-ui)
zhu1090093659/dsh-web
dsh-web-ui (dsh-ssh)
zhu1090093659/dsh-web-ui