XiaoWind/dsh-cron0

dsh-cron

提供 `/cron` 斜杠命令的 DSH 插件,用于配置基于 Cron 定时触发的周期性 Agent 任务循环。

AI 分析

核心用途是实现定时自动化的 Agent 任务。适合需要定期执行特定任务(如每日检查、定时维护)的用户,支持标准的 5 段式 Cron 表达式。

包名
dsh-cron
版本
0.1.0
许可证
MIT
最近更新
2026年8月21日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:XiaoWind/dsh-cron

Usage

CommandResult
/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 testsWeekdays at 09:00 toward an objective.
/cron fix the testsFire toward an objective at the default schedule.
/cron resumeResume the schedule saved before a restart.
/cron or /cron statusShow the running schedule.
/cron stopStop the schedule.
/cron helpShow 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 resume restarts it manually when needed, and /cron stop discards 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).