Tristan Dunn

Found 2 entries tagged "cli".

Claude CLI deleted my entire home directory! Wiped my whole Mac. (cache, source)

I found the problem and it’s really bad. Looking at your log, here’s the catastrophic command that was run: rm -rf tests/ patches/ plan/ ~/

Not that it’s a foolproof solution, but I’ve aliased rm to a trash command for almost ten years now to move files to the trash instead of deleting them. A trash command is built into macOS Sequoia and newer.

The one downside is the command doesn’t support the -f or -r arguments, so it often causes issues with Claude Code. Sometimes it’ll switch to using rmdir, so I’m also aliasing that now.

I’m not sure how much moving the home directory to the trash would have helped, since the trash command does completely remove files and directories prefixed with a period.

at 5:34 PMai, cli

Command Line Interface Guidelines (cache)

An open-source guide to help you write better command-line programs, taking traditional UNIX principles and updating them for the modern day.

Found this while working on a small CLI utility and searching to see if there are standards for outputting help. The real-world applications they link to were helpful for inspiration.

at 9:55 AMcli