feat: Add direnv support for automatic API key management#1
Open
jcorbettfrank wants to merge 1 commit intorichawo:masterfrom
Open
feat: Add direnv support for automatic API key management#1jcorbettfrank wants to merge 1 commit intorichawo:masterfrom
jcorbettfrank wants to merge 1 commit intorichawo:masterfrom
Conversation
jcorbettfrank
added a commit
to jcorbettfrank/blocksmith
that referenced
this pull request
Nov 12, 2025
Move "Environment Setup" section to the top of DEVELOPMENT.md so developers configure their environment BEFORE running Quick Start commands. This prevents the confusing flow where users would follow export instructions before learning about the recommended direnv approach. **Changes:** - Move "Environment Setup (Recommended: direnv)" to position richawo#1 - Update Quick Start sections to reference env setup instead of inline exports - Add note to BLENDER_PATH section about using direnv - Add "Alternative (manual export)" inline for quick reference **New flow:** 1. Environment Setup (direnv recommended, manual export alternative) 2. Quick Start (uv) - references env setup above 3. Alternative (pip/venv) - references env setup above 4. Install Blender - mentions direnv for BLENDER_PATH 5. Rest unchanged This creates a logical progression: setup → install → test 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add direnv configuration with automatic .env setup: - .envrc automatically creates .env from template on first use - .env.example provides template with all environment variables - Update README with direnv as recommended setup method - Keep shell RC file method as alternative option Benefits: - Project-scoped environment variables - Auto-loads when entering repo directory - Zero manual file copying required - Prevents accidental API key commits 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> comment out .env.example values docs: Improve direnv documentation and add error handling Comprehensive documentation improvements for direnv support: **Error Handling:** - Add safety check to .envrc for missing .env.example - Provides helpful error message if template is missing - Prevents silent failures during setup **DEVELOPMENT.md:** - Add dedicated "Environment Setup" section for direnv - Include installation and setup instructions - Update troubleshooting section with direnv-specific guidance - Maintain manual export as alternative approach **examples/README.md:** - Add direnv as recommended option for API key setup - Reference main README for detailed setup - Keep manual export as Option 2 **tests/integration/README.md:** - Clarify that direnv users don't need `source .env` - Add note explaining auto-loading behavior - Prevent confusion about when to use `source .env` All documentation now consistently promotes direnv as the recommended approach while maintaining compatibility with manual environment variable export. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> docs: Restructure DEVELOPMENT.md for better flow Move "Environment Setup" section to the top of DEVELOPMENT.md so developers configure their environment BEFORE running Quick Start commands. This prevents the confusing flow where users would follow export instructions before learning about the recommended direnv approach. **Changes:** - Move "Environment Setup (Recommended: direnv)" to position richawo#1 - Update Quick Start sections to reference env setup instead of inline exports - Add note to BLENDER_PATH section about using direnv - Add "Alternative (manual export)" inline for quick reference **New flow:** 1. Environment Setup (direnv recommended, manual export alternative) 2. Quick Start (uv) - references env setup above 3. Alternative (pip/venv) - references env setup above 4. Install Blender - mentions direnv for BLENDER_PATH 5. Rest unchanged This creates a logical progression: setup → install → test 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4454fa6 to
95a4c81
Compare
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
This PR adds direnv support for automatic, project-scoped API key management.
Changes
.envrc- Automatically creates.envfrom template on firstdirenv allow.env.example- Template with all environment variables (GEMINI_API_KEY, OPENAI_API_KEY, BLENDER_PATH)Benefits
.envrcauto-creates.envfrom template.envis gitignored, prevents accidental key commitsUser Experience
Before:
After:
Testing
.envrcsuccessfully creates.envfrom.env.example.envis already in.gitignore🤖 Generated with Claude Code