计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
persistent-localhost【效率与协作】Manage persistent dev servers, APIs, and other local processes on a port using macOS LaunchAgents. Use when starting, stopping, restarting, inspecting, or troubleshooting local servers that should survive shell exit and restart after crashes.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
One script does everything. Resolve scripts/persistent-localhost.sh relative to this SKILL.md, never from the current directory.
scripts/persistent-localhost.sh list
--name is the handle. --port enables readiness checks and duplicate handling. --dir defaults to the current directory.scripts/persistent-localhost.sh start --name myproj --port 5111 --cmd "./bin/serve"
The command returns only after the port is listening, or fails with the last 20 log lines. Report the printed URL= to the user.
scripts/persistent-localhost.sh status myproj
scripts/persistent-localhost.sh restart myproj # after editing code that has no reloader
scripts/persistent-localhost.sh logs myproj 100
scripts/persistent-localhost.sh stop myproj
Prefer the framework's own reloader in --cmd (flask run --debug, vite, uvicorn --reload, node --watch). If the server has none, add --watch. It wraps the command in watchexec -r on the working directory. Never use both. Requires brew install watchexec.
com.persistent-localhost.<name> in the user gui domain via launchctl bootstrap. Restart uses kickstart -kp, stop uses bootout. No deprecated load, start, stop, no broad pkill.KeepAlive only on crash. A clean exit stays down. Throttle 5s so a syntax error cannot spin.PORT=.PATH and a PORT variable are passed into the job. Add more with --env KEY=VAL.~/Library/Logs/persistent-localhost/<name>.log. State: ~/Library/Application Support/persistent-localhost/<name>.state. Plist: ~/Library/LaunchAgents/.Never start servers with nohup, &, disown, setsid, or run_in_background. If launchctl bootstrap fails, report the failure and stop.