March 20, 2026
Ports behaving badly
Show HN: Sonar – A tiny CLI to see and kill whatever's running on localhost
Meet Sonar, the laptop “port police” fans begged for
TLDR: Sonar is a tiny tool that shows what’s running on your computer and lets you stop it by port, with helpful names and Docker support. The crowd cheered the time-saver, joked about the Sonar vs. SonarQube name, and asked for customizable links for non-local networks—small debate, big relief.
Developers on Show HN rallied around Sonar, a tiny command-line tool that shows what’s hogging your laptop’s ports and lets you shut it down by number—no more arcane “lsof” incantations. The creator admitted they built it out of frustration with ghost apps and forgotten Docker containers, and the crowd said: same.
The loudest vibe? Pure relief. One fan confessed they’re “tired of spamming” that long-winded terminal spell, while others cheered that Sonar lists what’s running, shows friendly names (including Docker containers), and even gives clickable links and quick kill commands. For those who don’t speak tech: it’s basically a find it and stop it button for stuff clogging your computer.
But there was spice. A practical voice asked for a way to customize the links Sonar shows—because they connect over Tailscale (a private network), not “localhost” (your own machine). Translation: “Let me choose the address these links use.” Then the name stirred a side convo: “Sonar… as in SonarQube?” quipped one commenter, nodding to a popular code scanner. The thread quickly split into two camps: the “love it, ship it” crowd and the “nice tool, please tweak the name and URLs” contingent.
Bottom line: Sonar is simple, sharp, and already collecting wish-list items. Try it here: github.com/raskrebs/sonar.
Key Points
- •Sonar is a single-binary CLI that lists all services listening on localhost, including Docker/Compose details, resource usage, and clickable URLs.
- •It supports actions by port number: inspect (info), kill/kill-all (Docker-aware), tail logs for containers and native processes, and attach to containers or TCP.
- •The list command offers stats, filters (e.g., Docker-only), sorting, JSON output, custom columns, health checks, and remote scanning via SSH.
- •Watch mode provides periodic polling with diffs, live resource stats, faster intervals, notifications, and remote watching.
- •A dependency graph shows inter-service connections with JSON or Graphviz DOT output, and a profiles feature allows saving expected ports.