Codex and I deleted production

• Read Time: 1 MIN • Category: code

Last night I deleted production -- with a command Codex gave me!

The command itself seemed sound. However, it was not really, even though it was. So yeah, it was and was not in the same time. 🫠 It was late night, I apparently did not pay close enough attention -- it looked fine to me.

I essentially got:

foo && rm -rf /srv/bar/domain.tld/something && foo

But in reality it was:

foo && rm -rf /srv/bar/domain.tld/
something && foo

As soon as I hit enter I knew: oopsie woopsie we made a fucky wucky!

What effectively ran was:

rm -rf /srv/bar/domain.tld/

Poof. Gone. 🤷‍♂️

Notice it? Right, the Codex UI added a line break. It was positioned so unfortunate that I also didn’t notice it when pasting it to my editor. My bad, clearly.

Sometimes Codex is smart enough to add escaped line breaks itself when a command is longer. Not this time. And that got me! 🥳

So, ladies & gentlemen, better pay very close attention to what you copy & paste from your TUI!

👨‍💻 Author

Hey, I am Nick -- all-rounder, master of none, dangerous in many. Building and marketing online businesses since the early 2000s. Wanna be frens? Get in touch via Mail, Twitter or BlueSky.

Feeds: All Code Cash Life Misc