There's a small set of shell tasks that nearly every backend engineer has typed a hundred times and still can't quite recall. They live just past the edge of muscle memory. Here are five of them, replaced.
1. Kill the process holding a port
$ clai kill the process listening on port 8080→ lsof -ti :8080 | xargs -r kill -9[Safety: CAUTION] — sends SIGKILL. Press Enter to run.
The CAUTION badge is no accident — kill -9 skips the process's chance to clean up. The safety classification post explains the three tiers.
2. Find the PID by process name
$ clai find the PID of nginx→ pgrep -x nginx43214322
pgrep -x for an exact match — easy to forget when you reach for ps aux | grep.
3. Show the process tree under a service
$ clai show the process tree under postgres→ pstree -p $(pgrep -f postgres | head -1)postgres(1234)─┬─postgres(1245) ├─postgres(1246) └─postgres(1247)
4. Top 10 processes by memory
$ clai which 10 processes are using the most memory right now→ ps -eo pid,user,%mem,rss,comm --sort=-%mem | head -11PID USER %MEM RSS COMMAND1234 app 12.4 1.9G java4567 app 7.2 1.1G node
5. Children of a specific PID
$ clai list child processes of PID 1234→ pgrep -P 1234 -a1245 postgres: writer1246 postgres: checkpointer
What CliAI doesn't replace
It won't decide for you whether killing the process is safe. It tells you the badge — SAFE, CAUTION, DANGER — and lets you call it. For PID-1 territory or rebooting databases, get a real second opinion. The CLI gives you the trigger; judgment is still yours.
For the broader "I can't remember the syntax" pattern, see also the network triage post and the find post.