跳到正文
cccskills
免费在 GitHub 公开

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.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(2)

  • SKILL.md2.4 KB
  • scripts/persistent-localhost.sh7.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Persistent localhost servers (macOS launchd)

One script does everything. Resolve scripts/persistent-localhost.sh relative to this SKILL.md, never from the current directory.

Workflow

  1. Check what already exists:
scripts/persistent-localhost.sh list
  1. Start the server. --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.

  1. Inspect, restart, read logs, stop:
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

Hot reload

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.

Rules the script enforces

  • Runs as 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 already taken by the same app (our own label, or a stray process with the same working directory) is replaced. A different app is left alone and the next free port is used. Read the printed PORT=.
  • The caller's PATH and a PORT variable are passed into the job. Add more with --env KEY=VAL.
  • Logs: ~/Library/Logs/persistent-localhost/<name>.log. State: ~/Library/Application Support/persistent-localhost/<name>.state. Plist: ~/Library/LaunchAgents/.

Fallback

Never start servers with nohup, &, disown, setsid, or run_in_background. If launchctl bootstrap fails, report the failure and stop.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

4x4

免费

Pull 16 fast decisions out of the user with 4 sets of 4 open questions, then present an implementation plan. Only for risky changes, large product decisions, or large refactors. Run when the user types /4x4. Agents may suggest it in one line but never start it on their own.

中文简介正在准备中。当前显示原文说明。

davidondrej/skills41592026年10月19日 更新

Record concise ADRs that preserve the user's decisions without conversational noise. Use for "adr-verbatim", "new ADR", "document that as an ADR", "record this decision", or supplied ADR wording.

中文简介正在准备中。当前显示原文说明。

davidondrej/skills41592026年10月19日 更新

Keep a Mac awake for a set duration or while a process runs. Use only when the user explicitly invokes /anti-sleep.

中文简介正在准备中。当前显示原文说明。

davidondrej/skills41592026年10月19日 更新

Clarify a feature, change, or refactor through questions, then write a build prompt for another agent. Use for /ask-then-build or requests to ask questions before producing an implementation prompt.

中文简介正在准备中。当前显示原文说明。

davidondrej/skills41592026年10月19日 更新

bb-cli

免费

Use this when controlling bb. The bb CLI inspects and manages threads, environments, projects, machines, providers, skills, plugins, settings, terminals, and other BB services.

中文简介正在准备中。当前显示原文说明。

davidondrej/skills41592026年10月19日 更新

Build, install, and debug bb plugins. Use when the user wants a bb plugin, a sidebar panel, a bb CLI subcommand, an agent tool, a theme, a provider, or to extend bb itself. For running threads and the core bb CLI, use bb-cli instead.

中文简介正在准备中。当前显示原文说明。

davidondrej/skills41592026年10月19日 更新

查看 davidondrej 的全部技能

报告此技能的问题