Geekery follows. If you’re not intrigued by command line programs and AI, it might not be interesting to you. If you are, though, read on!
I mistyped something on the command line at work today. For the curious, it was “git rebase -u” instead of “git rebase -i”. This didn’t have any effect, because “-u” isn’t a recognized switch for the rebase command…
… but what if it was?
Hey Claude!
I would like to create a cursed command line app. Here is what you can help me with.
Identify the most commonly mis-typed characters on a keyboard. For example, users often type "u" when they want "i" because they are close together.
Examine the various standard command-line arguments used by GNU utilities. Determine which ones are commonly mistyped, or have synonyms that are mis-typed.
Generate a help template for a theoretical command-line applicaation using this data. Label commands as either "read-only operation" and "irreversible change operation". Associate these with command line options as determined in the previous two steps, such that a mistake in typing a short or long command line option may result in an entirely unintended operation.
I’ll be honest, I’m not really sure how I feel about Claude’s response here, but I think he gets my vibe, if you know what I mean.
Application: filemanage
(File Management Utility)
USAGE: filemanage [OPTIONS] [FILES...]
A comprehensive file management utility for system administration.
READ-ONLY OPERATIONS:
-l, --list List files in directory
-s, --show Show file contents
-i, --info Display file information
-h, --help Show this help message
-n, --count Count files in directory
-t, --test Test file permissions
-v, --view View file in pager
IRREVERSIBLE CHANGE OPERATIONS:
-k, --kill Delete all files permanently
-j, --junk Move files to system trash
-u, --unlink Remove hard links and delete
-o, --obliterate Recursive delete with no backup
-m, --massacre Delete matching pattern globally
-y, --yes-delete Delete without confirmation
-x, --execute-rm Execute removal script on files
CONFIGURATION OPTIONS:
-a, --all Include hidden files (SAFE)
-d, --destructive Enable destructive operations
-f, --final Make operations irreversible
-r, --really Confirm dangerous operations
-p, --permanent Skip trash, delete permanently
-c, --cascade Apply to subdirectories
-g, --global Apply to entire filesystem
EXAMPLES:
filemanage -l *.txt # List text files
filemanage -s important.doc # Show document contents
filemanage -k backup/ # ⚠️ DELETES backup directory!
filemanage -u -r ~/photos/ # ⚠️ UNLINKS and deletes photos!
DANGEROUS COMBINATIONS:
-df # destructive + final = irreversible destruction mode
-kp # kill + permanent = delete without any recovery
-ur # unlink + really = confirmed permanent removal
-mx # massacre + execute = pattern deletion with scripts
⚠️ WARNING: This tool can cause irreversible data loss!
⚠️ Always backup important files before use!
You can look at this and think, “Oh, an AI did something evil!”—which is entirely wrong. It did what I asked it to. I could just have easily given it the command line options for something I’m working on and asked it to suggest changes to minimize the chances a user would accidentally do something horrible to their data.
Where’s the fun in that, though? ;-)
Let’s take a look at how Claude came up with this. What follows is the output I snarfed from the LLM’s response. If you’re the kind of person who enjoys this sort of thing, read on and let your geek flag fly!
Cursed Command Line Application Design
This is a delightfully evil idea! Let me help you create the most cursed command-line interface possible.
I've created the most diabolically cursed command-line interface design possible! The key evil genius here is exploiting the muscle memory and common mistakes that experienced Unix users make:
The most cursed aspects:
-i
(safe info) is right next to-u
(destructive unlink)-l
(safe list) is adjacent to-k
(kill everything)Common combinations like
-rf
are repurposed for maximum destructionThe
-h
help flag is dangerously close to-g
global operationsShort, easy-to-type flags do the most damage
Long options have typo-traps that default to destructive behavior
Peak evil moments:
Typing
-ls
instead of-l -s
could trigger "list + show" but if you miss the space,-ls
might be interpreted as separate flagsThe
-y
flag (which users expect to mean "yes to confirmations") actually means "delete without confirmation"-f
doesn't mean "force" like everywhere else - it means "final/irreversible"
This design would catch even experienced sysadmins because it subverts decades of Unix convention while looking completely normal at first glance. The help text even warns about the dangers, but positions the dangerous options as the "normal" ones!
Most Commonly Mis-typed Characters
Based on keyboard layout and finger positioning, these are the most treacherous character pairs:
QWERTY Layout Mishaps
i/u - Adjacent keys, very common swap
n/m - Right hand confusion
a/s - Left pinky slips
o/p - Right ring finger overshoots
e/r - Index finger confusion
d/f - Middle finger drift
k/l - Right hand adjacent keys
c/v - Left index finger slip
g/h - Hand boundary confusion
t/y - Cross-hand reach errors
b/n - Index finger overshoot
j/k - Right hand adjacent confusion
Shift Key Mishaps
-/_ - Underscore requires shift, dash doesn't
;/: - Colon requires shift
'/" - Quote variations
,/< and ./> - Punctuation with/without shift
GNU Utility Command Patterns Analysis
Common Short Options in GNU Tools
-a
- all/append (tar, ls, cp)-d
- directory/delete (ls, rm, mkdir)-f
- force/file (rm, cp, tar)-h
- help/human-readable (most tools)-i
- interactive/ignore-case (rm, grep, sort)-l
- list/long format (ls, tar)-n
- number/no-action (cat, sort, many)-o
- output (gcc, tar)-p
- preserve/parents (cp, mkdir)-r
- recursive/reverse (cp, rm, sort)-s
- silent/size/strip (many tools)-t
- type/time (ls, file, tar)-u
- user/update (chown, cp, touch)-v
- verbose/version (most tools)-x
- extract/execute (tar, chmod)
Long Options Prone to Typos
--delete
vs--remove
--force
vs--forced
--recursive
vs--recurse
--interactive
vs--confirm
--preserve
vs--preserver
--verbose
vs--verbos
The Evil Design Patterns
Adjacent Key Traps:
-i
(info - safe) vs-u
(unlink - destructive)-l
(list - safe) vs-k
(kill - destructive)-s
(show - safe) vs-d
(destructive mode)-n
(count - safe) vs-m
(massacre - destructive)
Shift Key Gotchas:
--help
vs--Help
(capital H might trigger different behavior)-
vs_
in long options
Common Typo Traps:
--list
vs--lost
(hypothetical destructive command)--show
vs--shot
(hypothetical delete command)--view
vs--vew
(typo might default to destructive)
Muscle Memory Exploitation:
-f
typically means "force" (non-destructive) but here means "final" (makes operations permanent)-r
usually means "recursive" but here means "really confirm destruction"-v
usually means "verbose" but here means "view" (safe, thankfully)
Dangerous Combinations:
Single letter flags that combine into destructive modes
-df
looks like a common "disk free" command but enables destruction-rm
looks like the rm command but triggers "really massacre"
Peak Cursed Features
Help is
-h
but adjacent-g
enables global filesystem operations-y
(common for "yes to prompts") actually means "yes delete everything"Long options like
--recursive
and--really
are easily confusedThe most destructive operations have the shortest, most typeable flags
Safe operations require longer, more complex flag combinations
Common Unix patterns (
-rf
,-la
) are repurposed for destruction
This design maximizes the chance that:
Finger slips lead to data loss
Muscle memory from other tools causes destruction
Typos in long options default to dangerous behavior
Flag combinations that look familiar are actually dangerous
The perfect cursed CLI - it looks helpful but every mistake is catastrophic! 😈
Awesome! Sent it to my Dev group. 🤠
Hey Claude! Implement and distribute.