Why I write a CLI for every repetitive task
> If I do the same thing by hand twice, the third time it becomes a script. Small internal tools pay off more than they first appear.
I have a rule: if I've done a task by hand three times, the fourth is a command. Not because it saves that much time, but because it takes the chance of error out of the process.
##The bar is lower than you think
People assume building a tool takes half a day. But for a well-scoped task you can put together something in 20 minutes that never forgets a step again.
$ deploy staging --migrate --seed
→ build ok (12s)
→ migrations: 3 applied
→ seed: skipped (--no-seed not set)
✓ staging is liveThe point is feedback: the tool tells you what it did and what it skipped. That's half your debugging already done.
##The hidden payoff
The biggest benefit isn't the time saved. It's that the knowledge lives in code, not in your head. When you go on holiday, the tool knows the steps, instead of a colleague scrambling.