fix: scaffold .env from .env.example in setup scripts#15
Merged
Conversation
Setup scripts now auto-copy .env.example → .env when no .env exists, so users get a working config file on first run instead of a cryptic KeyError. Existing .env files are never overwritten.
There was a problem hiding this comment.
Pull request overview
This PR improves first-run developer experience across the demos by automatically scaffolding missing .env files from .env.example, preventing “missing env var / KeyError”-style failures during setup while ensuring existing .env files are not overwritten.
Changes:
- Add
.envscaffolding to the top-levelscripts/setup.shfordemo-one,demo-two,mcp-demo, and repo root when missing. - Update
demo-one/setup.shanddemo-two/setup.shto auto-create.envlocally when absent and adjust “Next steps” output accordingly. - Simplify
demo-two/setup.shinstructions by removing the redundant manual copy step.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/setup.sh | Scaffolds .env files across demo directories + root and updates “Next steps” messaging based on whether any files were created. |
| demo-one/setup.sh | Auto-copies .env.example → .env when missing and prints required fields to fill in. |
| demo-two/setup.sh | Auto-copies .env.example → .env when missing, prints required fields, and simplifies “Next steps”. |
Comment on lines
+136
to
+138
| echo " 1. Edit the .env files with your credentials:" | ||
| echo " - CAPISCIO_API_KEY (from app.capisc.io → Settings → API Keys)" | ||
| echo " - OPENAI_API_KEY (required for agents)" |
Comment on lines
+67
to
+69
| cp .env.example .env | ||
| echo "⚠️ Created .env from .env.example — edit it with your credentials:" | ||
| echo " $(pwd)/.env" |
- Remove 'cp .env.example .env' instructions (setup.sh does this now) - Fix trust level table: place_order is level 1 (PoP), not 2 (DV) - Fix code snippet: cancel_all_orders is level 2, not 4 - Add Scenario 5 (badge revocation) to the outcomes table
- Quote cp paths in demo-two/setup.sh for consistency (SCRIPT_DIR) - Expand credential guidance in scripts/setup.sh to mention CAPISCIO_SERVER_ID and point users to demo-specific .env files
| echo "" | ||
| echo " Required:" | ||
| echo " CAPISCIO_API_KEY — from https://app.capisc.io → Settings → API Keys" | ||
| echo " CAPISCIO_SERVER_ID — from https://app.capisc.io → MCP Servers (or set to 'auto')" |
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
Setup scripts now auto-copy
.env.example→.envwhen no.envexists, so users get a working config file on first run instead of a crypticKeyError.Existing
.envfiles are never overwritten.Changes
demo-one/setup.sh— copies.env.example→.envif missing, prints which fields to fill indemo-two/setup.sh— same, plus simplified "Next steps" (removed redundantcp .env.example .envinstruction)scripts/setup.sh— scaffolds.envfor all demo directories (demo-one,demo-two,mcp-demo, root) in one passTesting
bash -nsyntax check passes on all three scripts.envis absent, skips when already present