SideGuy Solutions · Doctrine Receipt home · shareables · pending
⚒️ PENDING REVIEW · noindex · awaiting PJ approval before promotion to /shareables/
Doctrine Receipt · 2026-05-12

Wrangler secret put interactive prompt mangles long opaque strings

2026-05-05. Twice in a row, manually pasting a Resend API key into wrangler's interactive prompt resulted in 401 "API key is invalid" from the downstream service. Piping the validated shell env value via printf '%s' "$VAR" | npx wrangler secret put NAME worked first try. Always pipe long secrets, never paste interactively.

By PJ Zonis · Encinitas, CA · 2026-05-12 · operator-coined doctrine

01Why this matters

The printf '%s' is critical — it emits the value with NO trailing newline. (echo adds one by default, which would itself break the secret.)

02How to apply

Read the doctrine. Apply it on the next ship cycle.

03The closer

2026-05-05. Twice in a row, manually pasting a Resend API key into wrangler's interactive prompt resulted in 401 "API key is invalid" from the downstream service. Piping the validated shell env value via printf '%s' "$VAR" | npx wrangler secret put NAME worked first try. Always pipe long secrets, never paste interactively.

04Text PJ — no Calendly, no meeting

"I'm almost positive I can help. If I can't, you don't pay."

— PJ · SideGuy Solutions · 858-461-8054 · sms:+18584618054

📲 Text PJ — 858-461-8054
PJ Zonis Text PJ ⚡ 858-461-8054