Posted by raskrebs 9 hours ago
I primarily write typescript and python for work. But have dabbled in bunch of other languages at different jobs and for different tasks. Yet to pick up rust, but have been wanting to. But tend to pick what seems most right for the task, while also considering what i most want to be working with
I like clack/prompts. See its multiselect API.
https://github.com/bombshell-dev/clack/tree/main/packages/pr...
3000 wud (getwud/wud:latest) wud getwud/wud:latest 3000 http://localhost:3000
3001 dockhand (fnsys/dockhand:latest) dockhand fnsys/dockhand:latest 3000 http://localhost:3001And I would want someone to use that to one-shot a python implementation. And on and on like a game of telephone until the context degrades so far that it becomes an entirely different program.
sonar list -c port,process,pid,type,url,container
or just show all columns:
sonar list --all-columns
But yeah, it's quite cool. I believe the future lies in software distillation, so cool to see it happen on my own project :D
So I built this lightweight CLI. Single binary, no dependencies. It shows everything listening on localhost with process names, Docker container info, clickable URLs etc.
Sure there are workarounds, but none that satisfied my need for a short, easily rememberable command. Also nothing really has the same satisfaction as running sonar kill 3000 — it just feels nice. I’ve already been approached by a few agent orchestration tools that have been struggling with the same thing. It's really useful when you have multiple agents running, but it's not built for just that use case, I have also find it handy when killing off all containers after a failed cleanup and so on. Also know that MCPs are dead and CLIs are the new thing in agentic coding, this might be a useful tool for Claude, particularly when a compose process exits before all containers are stopped.
Open for contributions, ideas and feedback.
Wow, this says more about the agent orchestration tool ecosystem than what you might think, that they're unable to kill child processes they themselves spawn makes it seem like they have zero clue about what they're doing.
Probably why my impression always end up with "Wow, what a vibe-coded mess" when I look through the source of all these harnesses, they don't seem engineered at all.
puts 'usage:'
puts 'murder 123 # kill by pid'
puts 'murder ruby # kill by process name'
puts 'murder :3000 # kill by port'https://github.com/clutchski/dotfiles/blob/main/home/bin/por...
For the even less patient there's also this (not mine): https://github.com/jkfran/killport
Started with the same, but found my self wanting a bit more, so just built it
Although i have a feature branch with a tray app (for macos) that let's you monitor and track any process (will send notifications when one goes up or down). But it's just gimmicks i felt i needed to make life a bit easier when working with compose and across worktrees
lk() {
if [ $# -eq 0 ]; then
local output=$(sudo lsof -iTCP -sTCP:LISTEN -n -P)
elif [ $# -eq 1 ]; then
local output=$(sudo lsof -iTCP -sTCP:LISTEN -n -P | grep -i --color=always $1)
else
echo "find and kill processes listening on ports. Usage: lk [pattern]"
return 1
fi
if [ -z "$output" ]; then
echo "No listening processes found."
return 0
fi
# Show header + results
echo "$(sudo lsof -iTCP -sTCP:LISTEN -n -P | head -1)"
echo "$output"
echo ""
# Extract unique PIDs (skip the header row if no grep was applied)
local pids=($(echo "$output" | awk '{print $2}' | grep -E '^[0-9]+$' | sort -u))
if [ ${#pids[@]} -eq 0 ]; then
echo "No PIDs found."
return 0
fi
echo "PIDs to kill: ${pids[*]}"
echo -n "Kill these ${#pids[@]} process(es)? [y/N] "
read -r confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
for pid in "${pids[@]}"; do
echo "Killing PID $pid..."
sudo kill -9 $pid
done
echo "Done."
else
echo "Aborted."
fi
}