Add bin/fill-keys.nu — fill API-key placeholders into a gitignored dist/#4
Merged
Conversation
Nushell script that substitutes the four template placeholders
(YOUR_CONTEXT7_API_KEY, YOUR_BRAVE_API_KEY, YOUR_GITHUB_PAT,
/path/to/your/workspace) with values from env vars — prompting (hidden
input) for any unset ones when interactive, leaving them as placeholders
when not (CI/agent-safe). Filled copies are written to a gitignored dist/
mirror; the tracked templates are never modified, so no secret is committed.
VS Code (uses ${input:}/${workspaceFolder}) and the docs are excluded from
substitution. Adds .gitignore (/dist/), a README "Filling in your keys"
section, and a CLAUDE.md tooling note. reuse lint clean (script is GPL,
two-tag SPDX header); CI validator unaffected (skips .nu, dist/ ignored).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bin/fill-keys.sh (POSIX sh — Bash/Brush/dash/ash) and bin/fill-keys.ion (Ion) mirror bin/fill-keys.nu exactly: same four placeholders → env vars, hidden-input prompt fallback, gitignored dist/ mirror, partial-fill and non-interactive/agent safety. The shell ports use `sd -s` (literal) for substitution; the Nushell port uses native string ops. Notable shell quirks handled: Ion's `test -t` is unreliable (uses `tty -s`), Ion eats -h/--help, and Ion's `test` needs the POSIX x-prefix guard for --leading operands; POSIX prompts read from /dev/tty so the here-doc data on stdin isn't consumed. README + CLAUDE.md updated; both scripts carry SPDX headers (reuse lint clean, 23/23). Co-Authored-By: Claude Opus 4.8 <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.
A small Nushell tool that takes your API keys once and writes ready-to-use,
key-filled copies of the host configs — without ever touching the tracked templates.
What it does
Substitutes the four template placeholders with real values:
CONTEXT7_API_KEYYOUR_CONTEXT7_API_KEYBRAVE_API_KEYYOUR_BRAVE_API_KEYGITHUB_PATYOUR_GITHUB_PATWORKSPACE_PATH/path/to/your/workspaceValues come from env vars; any unset ones are prompted for (hidden input) when
interactive, or left as placeholders when not (CI/agent-safe — never hangs).
Filled copies are written to a gitignored
dist/mirror; the tracked templates arenever modified, so no secret is committed. The script prints each file's intended
install destination.
Notes
${input:}+${workspaceFolder}); copied verbatim. The Markdown docs are excluded too..gitignore(/dist/), a README "Filling in your keys" section, and a CLAUDE.md tooling note.reuse lintclean (script isGPL-3.0-or-later); the lone executable (755). CI validator is unaffected (skips.nu;dist/is ignored).Verified locally: full fill (4/4), partial fill (only context7), no-vars non-interactive (0/4, exit 0, no prompt hang),
dist/parses via the existing validator, sentinels gone fromdist/but retained in templates.🤖 Generated with Claude Code