dsh-cron
提供 `/cron` 斜杠命令的 DSH 插件,用于配置基于 Cron 定时触发的周期性 Agent 任务循环。
AI 分析
核心用途是实现定时自动化的 Agent 任务。适合需要定期执行特定任务(如每日检查、定时维护)的用户,支持标准的 5 段式 Cron 表达式。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:XiaoWind/dsh-cron说明文档
阅读完整 README ↗Usage
| Command | Result |
|---|---|
/cron "*/30 * * * *" | Fire at :00 and :30 every hour. Keeps any current objective. |
/cron "0 9 * * 1-5" | Fire weekdays at 09:00. |
/cron "0 9 * * 1-5" fix the tests | Weekdays at 09:00 toward an objective. |
/cron fix the tests | Fire toward an objective at the default schedule. |
/cron resume | Resume the schedule saved before a restart. |
/cron or /cron status | Show the running schedule. |
/cron stop | Stop the schedule. |
/cron help | Show help. |
The schedule is standard 5-field cron (minute hour day-of-month month
day-of-week), minute resolution, evaluated in local time. Supported
per-field syntax: *, */n, n, a-b, a-b/n, a,b,c, and month/day
names (JAN..DEC, SUN..SAT, case-insensitive). Seconds are not
supported.
A leading 5-field cron expression is the schedule and the remainder is the objective; with no leading cron, the whole input is the objective and the default schedule applies.
Semantics
- Wall-clock anchored. Unlike
/loop, there is no immediate first tick — the first tick fires at the next wall-clock minute matching the cron expression. - Never interrupts a running turn. If a fire time arrives while the agent is busy, the tick waits for idle and then fires (it catches up the missed occurrence).
- Saved across restarts. The schedule is persisted to
$DSH_HOME/dsh-cron/.json. When you reopen the session after a restart, the plugin resumes the schedule automatically and tells you it is running;/cron resumerestarts it manually when needed, and/cron stopdiscards the saved schedule. - Manual stop. The schedule runs until you run
/cron stop, the agent is disposed, or the plugin is unloaded. There is no automatic completion detection.
Configuration
Set config.defaultCron (a 5-field cron string) to change the schedule used by
a bare /cron with no leading cron expression. The default is
*/10 * * * * (every 10 minutes).