delayed-command by paulrberg/agent-skills
npx skills add https://github.com/paulrberg/agent-skills --skill delayed-command等待指定时长后,执行 Bash 命令。
30s、5m、1h、1h30m)| 格式 | 示例 | 含义 |
|---|---|---|
Xs | 30s | 30 秒 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Xm | 5m | 5 分钟 |
Xh | 1h | 1 小时 |
XhYm | 1h30m | 1 小时 30 分钟 |
XhYmZs | 1h5m30s | 1 小时 5 分 30 秒 |
将时长参数转换为秒:
h)、分钟(m)和秒(s)部分小时数 * 3600 + 分钟数 * 60 + 秒数解析逻辑:
duration="$1"
seconds=0
# 提取小时
if [[ $duration =~ ([0-9]+)h ]]; then
seconds=$((seconds + ${BASH_REMATCH[1]} * 3600))
fi
# 提取分钟
if [[ $duration =~ ([0-9]+)m ]]; then
seconds=$((seconds + ${BASH_REMATCH[1]} * 60))
fi
# 提取秒
if [[ $duration =~ ([0-9]+)s ]]; then
seconds=$((seconds + ${BASH_REMATCH[1]}))
fi
对于 最多 10 分钟(600 秒)的时长:
使用 Bash 工具以适当的超时时间同步运行:
sleep <seconds> && <command>
将 Bash 工具的 timeout 参数设置为至少 (秒数 + 60) * 1000 毫秒。
对于 超过 10 分钟 的时长:
使用 run_in_background: true 在后台运行:
sleep <seconds> && <command>
通知用户命令正在后台运行,并提供任务 ID 以供检查状态。
执行完成后:
用户:/delayed-command 5m npm test
sleep 300 && npm test(超时时间:360000 毫秒)用户:/delayed-command 1h git commit -m "auto-commit"
sleep 3600 && git commit -m "auto-commit"用户:/delayed-command 1h30m ./deploy.sh
sleep 5400 && ./deploy.sh| 错误 | 响应 |
|---|---|
| 无效的时长格式 | 显示支持的格式和示例 |
| 缺少命令参数 | 提示输入要执行的命令 |
| 未找到命令 | 延迟完成后报告错误 |
| 时长超过 24 小时 | 警告用户并建议替代方案(cron、at) |
每周安装量
102
代码仓库
GitHub 星标数
41
首次出现
2026 年 2 月 5 日
安全审计
安装于
claude-code96
codex84
gemini-cli80
github-copilot80
amp80
kimi-cli80
Wait for a specified duration, then execute a Bash command.
30s, 5m, 1h, 1h30m)| Format | Example | Meaning |
|---|---|---|
Xs | 30s | 30 seconds |
Xm | 5m | 5 minutes |
Xh | 1h | 1 hour |
XhYm | 1h30m | 1 hour 30 minutes |
XhYmZs | 1h5m30s | 1 hour 5 min 30 s |
Convert the duration argument to seconds:
h), minutes (m), and seconds (s) componentshours * 3600 + minutes * 60 + secondsParsing logic:
duration="$1"
seconds=0
# Extract hours
if [[ $duration =~ ([0-9]+)h ]]; then
seconds=$((seconds + ${BASH_REMATCH[1]} * 3600))
fi
# Extract minutes
if [[ $duration =~ ([0-9]+)m ]]; then
seconds=$((seconds + ${BASH_REMATCH[1]} * 60))
fi
# Extract seconds
if [[ $duration =~ ([0-9]+)s ]]; then
seconds=$((seconds + ${BASH_REMATCH[1]}))
fi
For durations up to 10 minutes (600 seconds):
Run synchronously using the Bash tool with appropriate timeout:
sleep <seconds> && <command>
Set the Bash tool's timeout parameter to at least (seconds + 60) * 1000 milliseconds.
For durations over 10 minutes :
Run in background using run_in_background: true:
sleep <seconds> && <command>
Inform the user the command is running in background and provide the task ID for checking status.
After execution completes:
User: /delayed-command 5m npm test
sleep 300 && npm test (timeout: 360000ms)User: /delayed-command 1h git commit -m "auto-commit"
sleep 3600 && git commit -m "auto-commit"User: /delayed-command 1h30m ./deploy.sh
sleep 5400 && ./deploy.sh| Error | Response |
|---|---|
| Invalid duration format | Show supported formats and examples |
| Missing command argument | Prompt for the command to execute |
| Command not found | Report error after delay completes |
| Duration exceeds 24h | Warn user and suggest alternative (cron, at) |
Weekly Installs
102
Repository
GitHub Stars
41
First Seen
Feb 5, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykFail
Installed on
claude-code96
codex84
gemini-cli80
github-copilot80
amp80
kimi-cli80
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
138,800 周安装