agent-aware process cleanup KDS

Your agent burns hundreds of tokens hunting rogue dev servers.

kds does it in one.

A tiny, zero-dependency bash CLI that finds and kills leftover JS dev servers — vite, next, bun, wrangler & friends — without touching Docker or your editor. The installer drops a one-line instruction into your agent files, so instead of an ss/ps/kill expedition through your process table, your agent just runs kds.

$curl -fsSL https://raw.githubusercontent.com/zanellig/kds/main/install.sh | bash
KDS mascot — a masked operative with a red crosshair eyepiece

see it work

Preview the candidates. Then pick your target.

~/work — zsh
$
candidate 1: pid=48213 pgid=48213 cmd=node /work/app/node_modules/.bin/vite | stop with: kds --pid 48213
candidate 2: pid=51877 pgid=51877 cmd=next dev --turbopack | stop with: kds --pid 51877
candidate 3: pid=52432 pgid=52432 cmd=bun run dev | stop with: kds --pid 52432
$ kds --pid 48213
stopping: pid=48213 pgid=48213 cmd=node /work/app/node_modules/.bin/vite
$ kds --dry-run
candidate 1: pid=51877 pgid=51877 cmd=next dev --turbopack | stop with: kds --pid 51877
candidate 2: pid=52432 pgid=52432 cmd=bun run dev | stop with: kds --pid 52432
// one target. no collateral damage.

rules of engagement

Kills the right things. Spares everything else.

Kill list

  • bun / npm / pnpm / yarn running dev
  • vite
  • next dev
  • turbo … dev
  • wrangler dev
  • workerd

Protected

  • Docker & container-owned processes
  • Electron / VS Code listener processes
  • Databases, ssh, and everything else on your box
  • Only TCP listeners that look like host dev servers match
Preview firstkds --dry-run lists numbered candidates and the exact command to stop one. Add --pretty for runtime, resource, binding, and working-directory details.
Pick onekds --pid PID rechecks the target, then stops its whole process group.
Graceful, then notSends TERM, waits 2 seconds, then KILLs anything still standing.