Repository navigation
Conversation
Pasting the Pexels key into .env by hand is error-prone: with a non-English keyboard layout active, a typed value can land in .env as non-ASCII text, which later crashes stock searches with a latin-1 header encoding error. scripts/set_pexels_key.sh prompts for the key with hidden input, rejects anything that isn't a plain alphanumeric key, and writes it to .env. .env.example points to the script next to PEXELS_API_KEY. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
scripts/set_pexels_key.sh, a small helper that prompts for the Pexels API key with hidden input, validates it, and writes it into.env. Editing.envby hand can go wrong silently: with a non-English keyboard layout active, the value saved can end up as non-ASCII text. Every Pexels search then crashes with aUnicodeEncodeError: 'latin-1' codec can't encode characterswhen the key goes into the request header. Nothing tells the user the key itself is the problem.Related issue
None.
Changes
scripts/set_pexels_key.sh(new): reads the key withread -s. It writes the key into thePEXELS_API_KEY=line of.envonly if the input is 30 or more ASCII letters and digits. Otherwise it printsNOT savedwith where to copy the key from, and leaves.envunchanged..env.example: one comment line next toPEXELS_API_KEYpointing to the script.Testing
.env.example:NOT saved, exit code 1, andPEXELS_API_KEY=stays empty.saved, exit code 0, and the line is updated.read "k?prompt",${0:A:h}) and BSDsed -i '', so as written it targets macOS. I can make it portable to bash/GNU sed if you'd rather.Checklist
make test-contracts/make test) where applicable. Not applicable: no Python code changed..env.example.Note for reviewers (separate issue, not fixed here)
On the same setup, Piper TTS (
piper-tts1.8.0) can't synthesize speech when the checkout path contains a space, for example under~/Library/Application Support/.... espeak-ng ignores the bundled data directory and falls back to a hard-coded build path,/Users/runner/work/piper1-gpl/.../espeak-ng-data/phontab, so the output WAV is empty. Moving the checkout to a path without spaces fixes it. Raising it here in case it's worth a note in the setup docs.🤖 Generated with Claude Code