Skip to content

fix: scaffold .env from .env.example in setup scripts#15

Merged
beonde merged 3 commits into
mainfrom
fix/setup-env-scaffolding
May 8, 2026
Merged

fix: scaffold .env from .env.example in setup scripts#15
beonde merged 3 commits into
mainfrom
fix/setup-env-scaffolding

Conversation

@beonde

@beonde beonde commented May 7, 2026

Copy link
Copy Markdown
Member

Summary

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.

Changes

  • demo-one/setup.sh — copies .env.example.env if missing, prints which fields to fill in
  • demo-two/setup.sh — same, plus simplified "Next steps" (removed redundant cp .env.example .env instruction)
  • scripts/setup.sh — scaffolds .env for all demo directories (demo-one, demo-two, mcp-demo, root) in one pass

Testing

  • bash -n syntax check passes on all three scripts
  • Verified logic: only copies when .env is absent, skips when already present

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.
Copilot AI review requested due to automatic review settings May 7, 2026 18:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .env scaffolding to the top-level scripts/setup.sh for demo-one, demo-two, mcp-demo, and repo root when missing.
  • Update demo-one/setup.sh and demo-two/setup.sh to auto-create .env locally when absent and adjust “Next steps” output accordingly.
  • Simplify demo-two/setup.sh instructions 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 thread scripts/setup.sh Outdated
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 thread demo-two/setup.sh Outdated
Comment on lines +67 to +69
cp .env.example .env
echo "⚠️ Created .env from .env.example — edit it with your credentials:"
echo " $(pwd)/.env"
beonde added 2 commits May 7, 2026 14:54
- 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
Copilot AI review requested due to automatic review settings May 7, 2026 19:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread demo-two/setup.sh
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')"
@beonde beonde merged commit dd4278c into main May 8, 2026
14 checks passed
@beonde beonde deleted the fix/setup-env-scaffolding branch May 8, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants