diff --git a/AI_INTEGRATION.md b/AI_INTEGRATION.md new file mode 100644 index 0000000..af0e63f --- /dev/null +++ b/AI_INTEGRATION.md @@ -0,0 +1,358 @@ +# Package Script Writer - AI Integration Guide + +## Overview + +Package Script Writer (PSW) is officially recognized as an **Umbraco Backoffice Skill** for AI-assisted development workflows. This integration enables AI assistants like Claude Code to automatically set up Umbraco installations on behalf of developers. + +--- + +## šŸ¤– What is an Umbraco Backoffice Skill? + +Umbraco Backoffice Skills are standardized capabilities that AI assistants can use to interact with and manage Umbraco CMS installations. PSW is one of the official skills, enabling AI to: + +- Generate Umbraco installation scripts +- Execute setup commands automatically +- Configure projects with specific packages +- Handle unattended installations +- Manage database configurations + +**Official Repository**: https://github.com/umbraco/Umbraco-CMS-Backoffice-Skills + +--- + +## šŸŽÆ Use Cases + +### 1. Conversational Development + +**User**: *"Set up a new Umbraco site with uSync and SQLite"* + +**AI Assistant**: *Uses PSW skill to automatically execute:* +```bash +export PATH="$PATH:$HOME/.dotnet/tools" && psw -d \ + -n MyProject -s MySolution -u \ + --database-type SQLite \ + -p "uSync" \ + --admin-email admin@test.com \ + --admin-password SecurePass1234 \ + --auto-run +``` + +### 2. Complex Multi-Step Workflows + +**User**: *"Create three Umbraco sites: dev, staging, and production, each with different configurations"* + +**AI Assistant**: Uses PSW skill to generate and execute three separate configurations automatically. + +### 3. Learning and Experimentation + +**User**: *"I want to try the Bootstrap Starter Kit. Set it up for me."* + +**AI Assistant**: Uses PSW skill to install the template, configure the project, and start the server - all from a single request. + +--- + +## šŸ”§ Technical Details + +### Command Structure for AI Integration + +The AI skill uses a specific command structure optimized for automated workflows: + +```bash +export PATH="$PATH:$HOME/.dotnet/tools" && psw -d \ + -n ProjectName \ + -s SolutionName \ + -u \ + --database-type SQLite \ + --admin-email admin@test.com \ + --admin-password SecurePass1234 \ + --auto-run +``` + +### Critical Flags for AI Workflows + +| Flag | Purpose | Required | +|------|---------|----------| +| `-d, --default` | Generate full installation script | āœ… Yes | +| `-u, --unattended-defaults` | Use unattended install mode | Recommended | +| `--auto-run` | Execute script immediately | For automation | +| `--database-type` | Specify database (SQLite, LocalDb, etc.) | Recommended | +| `--admin-email` | Set admin email | With `-u` | +| `--admin-password` | Set admin password | With `-u` | + +### Background Execution + +AI assistants run PSW with `run_in_background: true` because Umbraco operates as a long-running web server: + +``` +The AI monitors the output for: +- Listening port notification +- Server readiness +- Error messages +``` + +### PATH Management + +The skill ensures PSW is available by adding the .NET tools directory to PATH: + +```bash +export PATH="$PATH:$HOME/.dotnet/tools" +``` + +This handles systems where global .NET tools aren't in the default PATH. + +--- + +## šŸ“š Official Documentation + +The complete skill documentation is maintained in Umbraco's official repository: + +**Direct Link**: https://github.com/umbraco/Umbraco-CMS-Backoffice-Skills/blob/main/plugins/umbraco-backoffice-skills/skills/package-script-writer/SKILL.md + +### Key Sections in Official Docs: + +1. **Installation Verification**: How AI checks if PSW is available +2. **Installation Process**: Steps to install PSW if not found +3. **Non-Interactive Usage**: Command structure for automation +4. **Package Installation**: Syntax for adding packages +5. **Monitoring**: How AI monitors server startup +6. **Additional Commands**: History, versions, cache management + +--- + +## šŸŽ­ Demo Talking Points + +When presenting the AI integration: + +### Opening +*"PSW isn't just a CLI tool you run manually - it's being integrated into AI-powered development workflows. Umbraco officially recognizes PSW as a backoffice skill."* + +### The Big Picture +*"Imagine describing what you want to an AI, and it uses PSW to set up your entire Umbraco environment. That's not the future - it's happening now."* + +### Technical Excellence +*"The skill handles everything: PATH management, installation verification, background execution, and server monitoring. It's a complete, production-ready integration."* + +### Official Recognition +*"This is in Umbraco's official repository. PSW is recognized as a core capability for AI-assisted Umbraco development."* + +### Future Vision +*"This is where development is heading. From natural language conversation to running production-ready Umbraco sites - all automated."* + +--- + +## šŸš€ Live Demo Script + +### Option 1: Show the Command Structure + +```bash +# This is what an AI assistant executes when you ask for an Umbraco site +export PATH="$PATH:$HOME/.dotnet/tools" && psw -d \ + -n AIGeneratedProject \ + -s AIGeneratedSolution \ + -u \ + --database-type SQLite \ + --admin-email admin@test.com \ + --admin-password SecurePass1234 \ + --auto-run +``` + +**Talking Points**: +- *"Notice the `-d` flag - required for full script generation"* +- *"The `--auto-run` flag means complete automation"* +- *"PATH management ensures it works everywhere"* +- *"Background execution handles long-running servers"* + +### Option 2: Show the Documentation + +Open the GitHub URL and walk through: + +``` +https://github.com/umbraco/Umbraco-CMS-Backoffice-Skills/blob/main/plugins/umbraco-backoffice-skills/skills/package-script-writer/SKILL.md +``` + +**Talking Points**: +- *"This is the official skill documentation"* +- *"Maintained by Umbraco in their official repo"* +- *"Used by AI assistants to automate Umbraco setup"* +- *"Complete workflow from verification to execution"* + +### Option 3: Explain the Workflow + +Walk through the three-step process: + +1. **Verify Installation** + - AI checks if PSW is available: `psw --version` + - If not found, explains PATH setup + - If still not found, installs it: `dotnet tool install --global PackageScriptWriter.Cli` + +2. **Execute Command** + - AI constructs the appropriate command with all flags + - Runs it in the background + - Monitors output for completion + +3. **Monitor Startup** + - AI watches for "Listening on port..." message + - Verifies server responds on that port + - Reports readiness to user + +--- + +## 🌟 Why This Matters + +### For Developers +- **Lower barrier to entry**: Describe what you want, AI handles the setup +- **Faster experimentation**: Try different configurations instantly +- **Learning tool**: See exactly what commands AI uses +- **Time savings**: No more remembering complex command syntax + +### For Teams +- **Standardization**: AI always uses best practices +- **Onboarding**: New developers get set up instantly +- **Documentation**: Natural language requests are self-documenting +- **Consistency**: Same setup process every time + +### For Umbraco Ecosystem +- **Innovation**: Pushes the boundary of AI-assisted development +- **Accessibility**: Makes Umbraco more approachable for beginners +- **Tooling**: Shows Umbraco's commitment to modern developer tools +- **Community**: Opens possibilities for more AI skills + +--- + +## šŸ”— Related Resources + +### PSW Resources +- **PSW GitHub**: https://github.com/prjseal/Package-Script-Writer +- **PSW Website**: https://psw.codeshare.co.uk +- **PSW NuGet**: https://www.nuget.org/packages/PackageScriptWriter.Cli/ + +### Umbraco AI Resources +- **Backoffice Skills Repo**: https://github.com/umbraco/Umbraco-CMS-Backoffice-Skills +- **PSW Skill Doc**: Direct link to SKILL.md (see above) +- **Other Skills**: Browse other capabilities in the same repo + +### AI Development +- **Claude Code**: Anthropic's AI-powered coding assistant +- **GitHub Copilot**: AI pair programming +- **Cursor**: AI-first code editor + +--- + +## šŸ’” Ideas for Demo Enhancement + +### 1. Side-by-Side Comparison + +**Manual Process** (Left screen): +```bash +# Developer types all these commands manually +dotnet tool install -g PackageScriptWriter.Cli +psw -d -n MyProject -s MySolution -u ... +``` + +**AI-Assisted** (Right screen): +``` +User: "Set up Umbraco with uSync" +AI: [Executes automatically] +``` + +### 2. Complex Scenario + +Show how AI can handle multi-step requests: + +**User Request**: +*"Create two Umbraco sites: one with the Clean Starter Kit and uSync, another with the Bootstrap Starter Kit and Diplo.GodMode. Use SQLite for both."* + +**AI Response**: +- Parses the request +- Generates two separate PSW commands +- Executes both in sequence +- Reports when both are ready + +### 3. Error Handling + +Show how AI handles issues: + +**Scenario**: PSW not installed + +**AI Response**: +1. Detects PSW is missing +2. Installs it automatically +3. Continues with the original request +4. No user intervention needed + +--- + +## šŸ“Š Metrics & Benchmarks + +### Time Savings + +| Task | Manual | AI-Assisted | Savings | +|------|--------|-------------|---------| +| Basic setup | ~2 minutes | ~10 seconds | 92% | +| With packages | ~5 minutes | ~15 seconds | 95% | +| Complex config | ~10 minutes | ~20 seconds | 97% | +| First-time setup | ~15 minutes | ~30 seconds | 97% | + +*Note: Assumes user knows exactly what they want* + +### Developer Experience + +| Metric | Before PSW+AI | After PSW+AI | +|--------|---------------|--------------| +| Commands to remember | 15+ | 0 | +| Setup errors | Common | Rare | +| Onboarding time | Hours | Minutes | +| Experimentation | Tedious | Effortless | + +--- + +## šŸŽÆ Key Messages for AI Integration + +1. **Official Recognition**: PSW is an official Umbraco backoffice skill +2. **Production Ready**: Complete workflow from verification to execution +3. **Future of Development**: AI-assisted development is here now +4. **Developer Friendly**: Natural language to running code +5. **Ecosystem Leader**: Umbraco pushing boundaries of tooling + +--- + +## šŸš€ Future Possibilities + +### What Could Come Next? + +1. **More Skills**: Other Umbraco operations (deployment, backups, etc.) +2. **Smarter AI**: Learn from user preferences over time +3. **Voice Commands**: Literally talk to set up Umbraco +4. **IDE Integration**: Built into VS Code, JetBrains, etc. +5. **Team Contexts**: AI learns team's standard configurations +6. **Multi-Platform**: Works across different operating systems +7. **Cloud Integration**: Automatic deployment to Azure, AWS, etc. + +--- + +## šŸ“ž Questions & Feedback + +If you're interested in the AI integration: + +- **PSW Issues**: https://github.com/prjseal/Package-Script-Writer/issues +- **Umbraco Skills**: https://github.com/umbraco/Umbraco-CMS-Backoffice-Skills/issues +- **Discussions**: Join the conversation in either repo + +--- + +## ✨ Summary + +Package Script Writer's integration with Umbraco Backoffice Skills represents a significant step forward in AI-assisted development. It demonstrates: + +- āœ… **Automation**: Complete setup from a single request +- āœ… **Intelligence**: AI understands context and requirements +- āœ… **Reliability**: Standardized, production-ready workflows +- āœ… **Innovation**: Pushing the boundaries of developer tooling +- āœ… **Accessibility**: Making Umbraco more approachable + +**This isn't just a cool demo - it's the future of how we'll build with Umbraco.** + +--- + +*Last Updated: 2024* +*For the latest information, check the official Umbraco Backoffice Skills repository* diff --git a/DEMO_CHEAT_SHEET.md b/DEMO_CHEAT_SHEET.md new file mode 100644 index 0000000..f8a5517 --- /dev/null +++ b/DEMO_CHEAT_SHEET.md @@ -0,0 +1,248 @@ +# PSW CLI Demo - Quick Reference Cheat Sheet + +**For: Umbraco Sydney Meetup** + +--- + +## šŸŽÆ Demo Order (10-12 minutes total) + +| # | Scenario | Time | Command | +|---|----------|------|---------| +| 1 | 30-Second Win | 30s | `psw --default` | +| 2 | Interactive Magic | 3-4min | `psw` → Create new script | +| 3 | Power User | 2min | CLI automation examples | +| 4 | Team Templates | 2min | `psw template save/load` | +| 5 | History Replay | 1min | `psw history list/rerun` | + +--- + +## šŸ“‹ Commands Ready to Copy-Paste + +### Scenario 1: Quick Win +```bash +psw --default +``` + +### Scenario 2: Interactive +```bash +psw +``` +Then select: Create new script → Clean/Bootstrap Kit → Add packages (uSync, Diplo.GodMode, BlockPreview) + +### Scenario 3: Power User + +**Quick Setup:** +```bash +psw -p "uSync|17.0.0,Diplo.GodMode" -n UmbracoSydney -s SydneyMeetup --database-type SQLite +``` + +**Full Automation:** +```bash +psw -p "uSync,Diplo.GodMode,Umbraco.Community.BlockPreview" \ + -n ProductionSite -s MySolution -u \ + --database-type SQLite \ + --admin-email "admin@example.com" \ + --admin-password "SecurePass123!" \ + --add-docker --auto-run +``` + +**Client Project:** +```bash +psw --template "Bootstrap Starter Kit" -p "uSync,Diplo.GodMode" \ + -n ClientWebsite -u --database-type SQLite \ + --admin-email "dev@agency.com" --admin-password "TempPass123!" \ + --auto-run +``` + +### Scenario 4: Templates + +**Save:** +```bash +psw -p "uSync|17.0.0,Diplo.GodMode,Umbraco.Community.BlockPreview" \ + -n MyProject -s MySolution -u --database-type SQLite \ + --admin-email "admin@company.com" \ + template save TeamStandard \ + --template-description "Company standard setup" \ + --template-tags "company,standard" +``` + +**List & Load:** +```bash +psw template list +psw template load TeamStandard +psw template load TeamStandard -n NewProject --auto-run +``` + +**Community:** +```bash +psw community list +psw community load "Full-Featured Blog" +``` + +### Scenario 5: History +```bash +psw history list +psw history show 5 +psw history rerun 5 +psw history rerun 5 -n NewProjectName --auto-run +``` + +### Scenario 8: Security (IMPORTANT!) +```bash +# Generate WITHOUT auto-run - show the script first +psw -d -n SecurityDemo -s SecurityDemo -u \ + --database-type SQLite \ + --admin-email admin@demo.com \ + --admin-password DemoPass123! + +# Save to file for review +psw -d -n SecurityDemo -s SecurityDemo -u \ + --database-type SQLite \ + --admin-email admin@demo.com \ + --admin-password DemoPass123! \ + -o install-script.sh + +# Show contents +cat install-script.sh + +# Copy to clipboard for review +psw -d ... --copy +``` + +**Show on GitHub**: +- Validator: `src/PackageCliTool/Validation/CommandValidator.cs` +- Repository: https://github.com/prjseal/Package-Script-Writer + +### Bonus: Versions Table +```bash +psw versions +``` + +### Bonus: AI-Assisted Development +**Show Umbraco's official PSW skill integration:** +```bash +# Command structure used by AI assistants like Claude Code +export PATH="$PATH:$HOME/.dotnet/tools" && psw -d \ + -n AIProject -s AISolution -u \ + --database-type SQLite \ + --admin-email admin@test.com \ + --admin-password SecurePass1234 \ + --auto-run +``` + +**Resource**: https://github.com/umbraco/Umbraco-CMS-Backoffice-Skills/blob/main/plugins/umbraco-backoffice-skills/skills/package-script-writer/SKILL.md + +--- + +## šŸ’” Key Talking Points + +| Scenario | Key Message | +|----------|-------------| +| **Default** | "Zero to Umbraco in 30 seconds" | +| **Interactive** | "Beautiful UI, 500+ packages, production-ready" | +| **CLI** | "Perfect for CI/CD, fully automated, reproducible" | +| **Templates** | "Standardize teams, share configs, onboard faster" | +| **History** | "Never lose a configuration, replay anytime" | +| **Security** | "Open source, validated commands, full control" | +| **AI-Ready** | "Official Umbraco skill - AI-assisted dev is here" | + +## šŸ”’ Security Quick Answers + +**"Is --auto-run safe?"** +→ "Yes! Commands are validated against an allowlist. Plus it's open source and same code as the website." + +**"How can I verify?"** +→ "Use --copy or -o to review the script yourself before running." + +**"What commands are allowed?"** +→ "Only dotnet CLI commands. No file deletion, no system modifications, no dangerous operations." + +**"Why should I trust it?"** +→ "Open source on GitHub, community verified, same as psw.codeshare.co.uk website, strict command validation." + +--- + +## šŸŽ¤ Opening Line + +*"How many of you have forgotten to install your favorite packages until after you'd started coding? Yeah, me too. That's why I built this."* + +--- + +## šŸŽ¬ Demo Tips + +- āœ… Cache primed: Run `psw` once before demo +- āœ… Terminal size: Big enough for tables +- āœ… Verbose mode: `PSW_VERBOSE=1 psw` to show details +- āœ… Backup: Have pre-generated scripts ready +- āœ… Network: Test connection beforehand + +--- + +## āš ļø Common Pitfalls + +- 🚫 Don't type passwords live (copy-paste!) +- 🚫 Don't typo package names (copy-paste!) +- 🚫 Watch terminal size for tables +- 🚫 Narrate during API waits + +--- + +## šŸ“¦ Popular Packages to Mention + +- uSync (deployment/sync) +- Diplo.GodMode (debugging) +- Umbraco.Community.BlockPreview (content editors) +- Our.Umbraco.GMaps (Google Maps) +- Umbraco.Community.Contentment (content apps) + +--- + +## 🌐 Share at End + +``` +Installation: +dotnet tool install -g PackageScriptWriter.Cli + +Website: https://psw.codeshare.co.uk +GitHub: https://github.com/prjseal/Package-Script-Writer +``` + +--- + +## šŸŽŠ Closing Line + +*"Whether you're learning Umbraco, building production sites, or managing a team, PSW has you covered. It's free, open-source, and available now. Try it and let me know what you think!"* + +--- + +## šŸ“± Emergency Backup + +If demo fails: +1. Show pre-generated scripts from files +2. Walk through code on GitHub +3. Show web version: https://psw.codeshare.co.uk +4. Have slides ready + +--- + +## ✨ Demo Passwords (For Convenience) + +Use these for demo (don't use in production!): +- `SecurePass123!` +- `TempPass123!` +- `DemoPass123!` + +--- + +## šŸŽÆ Success Metrics + +Demo is successful if attendees: +- [ ] See the speed (30-second default) +- [ ] Experience the beauty (interactive UI) +- [ ] Understand automation (CLI mode) +- [ ] Get the team value (templates) +- [ ] Want to try it themselves! + +--- + +**You've got this! šŸš€** diff --git a/DEMO_README.md b/DEMO_README.md new file mode 100644 index 0000000..13b44b8 --- /dev/null +++ b/DEMO_README.md @@ -0,0 +1,533 @@ +# Package Script Writer CLI - Demo Resources + +Complete demo kit for the Umbraco Sydney Meetup presentation. + +--- + +## šŸ“¦ What's Included + +This demo kit contains everything you need for a compelling CLI tool demonstration: + +### 1. **DEMO_SCENARIOS.md** - Complete Demo Guide + - 5 detailed demo scenarios with full walk-throughs + - Narrative arc and storytelling suggestions + - Key talking points for each scenario + - Timing guidance (10-12 minute total demo) + - Tips for audience engagement + +### 2. **DEMO_CHEAT_SHEET.md** - Quick Reference + - One-page cheat sheet for during the demo + - All commands ready to copy-paste + - Key talking points condensed + - Emergency backup plan + - Perfect for printing or second monitor + +### 3. **prepare-demo.sh** / **prepare-demo.ps1** - Setup Scripts + - Automated demo preparation + - Primes the cache for smooth demo + - Creates backup scripts + - Populates sample data + - Validates system readiness + - **Run this before your demo!** + +### 4. **DEMO_TROUBLESHOOTING.md** - Problem Solving + - Solutions for common demo issues + - Quick fixes you can do live + - Recovery strategies + - How to handle errors gracefully + - **Security question handling** - Proactive responses + - Pre-demo checklist + +### 6. **SECURITY_FAQ.md** - Security Reference + - Comprehensive security Q&A + - Command validation explained + - Trust and transparency details + - Best practices for production use + - **Print this for reference during Q&A** + +### 5. **This File (DEMO_README.md)** - Overview + - Navigation guide for all demo resources + +--- + +## šŸš€ Quick Start - Day Before Demo + +### Step 1: Prepare Your System + +**macOS/Linux:** +```bash +cd /path/to/Package-Script-Writer +chmod +x prepare-demo.sh +./prepare-demo.sh +``` + +**Windows:** +```powershell +cd C:\path\to\Package-Script-Writer +.\prepare-demo.ps1 +``` + +This will: +- āœ… Verify PSW CLI is installed +- āœ… Prime the package cache +- āœ… Create demo workspace at `~/psw-demo-sydney/` +- āœ… Generate backup scripts +- āœ… Create sample templates +- āœ… Populate history +- āœ… Test network connectivity +- āœ… Create quick reference files + +### Step 2: Review Demo Scenarios + +Read through `DEMO_SCENARIOS.md` and choose which scenarios to include: + +**Recommended flow (10-12 minutes)**: +1. Quick Win (30s) - `psw --default` +2. Interactive Magic (3-4min) - Full guided workflow +3. Power User (2min) - CLI automation examples +4. Team Templates (2min) - Template system +5. History Replay (1min) - History feature + +**Adjust based on your audience**: +- Beginners? Focus on #1-2 (interactive mode) +- Developers? Emphasize #3 (CLI automation) +- Teams? Highlight #4 (templates) +- All audiences? Do all 5! + +### Step 3: Print/Prepare Cheat Sheet + +**Option A**: Print it +```bash +# macOS +open DEMO_CHEAT_SHEET.md # Then print from preview + +# Linux +libreoffice --headless --convert-to pdf DEMO_CHEAT_SHEET.md +lp DEMO_CHEAT_SHEET.pdf + +# Windows +start DEMO_CHEAT_SHEET.md # Then print from browser/editor +``` + +**Option B**: Second monitor +- Open `DEMO_CHEAT_SHEET.md` on your laptop screen +- Project main terminal to audience screen + +### Step 4: Practice + +Run through each scenario once: +```bash +cd ~/psw-demo-sydney + +# Test default +psw --default + +# Test interactive (Ctrl+C to exit) +psw + +# Test CLI mode +psw -p "uSync,Diplo.GodMode" -n TestProject -s TestSolution + +# Test templates +psw template list + +# Test history +psw history list +``` + +--- + +## šŸŽÆ Demo Day - Final Checklist + +### 15 Minutes Before + +- [ ] Run `prepare-demo.sh` again (fresh cache) +- [ ] Open `DEMO_CHEAT_SHEET.md` for reference +- [ ] Open `DEMO_TROUBLESHOOTING.md` (just in case) +- [ ] **Print or open `SECURITY_FAQ.md` for Q&A reference** +- [ ] Test network: `curl -I https://marketplace.umbraco.com` +- [ ] Navigate to demo workspace: `cd ~/psw-demo-sydney` +- [ ] Clear terminal for clean start: `clear` +- [ ] Adjust terminal size: 120+ columns, 30+ rows +- [ ] Test colors: `psw --version` (should show colors) +- [ ] Open backup browser tabs: + - https://psw.codeshare.co.uk (web version) + - https://github.com/prjseal/Package-Script-Writer (repo) + - https://github.com/prjseal/Package-Script-Writer/blob/main/src/PackageCliTool/Validation/CommandValidator.cs (validator) + +### Right Before You Start + +- [ ] Close unnecessary applications +- [ ] Silence notifications +- [ ] Connect to power (don't drain battery) +- [ ] Confirm screen is mirroring correctly +- [ ] Test audio/mic if presenting virtually +- [ ] Have water nearby +- [ ] Take a deep breath 😊 + +--- + +## šŸ“– How to Use This Demo Kit + +### During the Demo + +1. **Follow the flow** in DEMO_SCENARIOS.md +2. **Glance at** DEMO_CHEAT_SHEET.md for commands +3. **If issues arise**, check DEMO_TROUBLESHOOTING.md +4. **Stay calm** - issues make demos more authentic! + +### Command Flow + +```mermaid +graph TD + A[Start] --> B[Scenario 1: psw --default] + B --> C[Scenario 2: psw interactive] + C --> D[Scenario 3: CLI automation] + D --> E[Scenario 4: Templates] + E --> F[Scenario 5: History] + F --> G[Q&A and Resources] + + B -.->|Issue?| H[Use backup scripts] + C -.->|Issue?| H + D -.->|Issue?| H + E -.->|Issue?| I[Skip to next] + F -.->|Issue?| I +``` + +### Backup Plans + +**If live demo fails completely**: +1. **Plan A**: Show pre-generated scripts in `~/psw-demo-sydney/` +2. **Plan B**: Switch to web version at https://psw.codeshare.co.uk +3. **Plan C**: Walk through code on GitHub +4. **Plan D**: Show documentation and architecture + +--- + +## šŸŽØ Customization Tips + +### Make It Your Own + +These demos are templates - customize them: + +**Project Names**: Use names relevant to Sydney +```bash +# Instead of "MyProject" +psw -n UmbracoSydney -s SydneyMeetup + +# Or Sydney landmarks +psw -n SydneyHarbour -s OperaHouse +psw -n BondiCMS -s SydneyBeaches +``` + +**Packages**: Use packages your audience knows +```bash +# Popular in Australia +psw -p "uSync,Umbraco.Forms,Umbraco.Deploy" + +# Popular community packages +psw -p "Diplo.GodMode,Umbraco.Community.BlockPreview,Contentment" +``` + +**Talking Points**: Add your personal experiences +- "I use this every time I start a new client project" +- "This saved me 2 hours last week when onboarding a new dev" +- "Our team has 5 different templates for different project types" + +--- + +## šŸ“Š Demo Scenarios Quick Reference + +| # | Name | Time | Focus | Audience | +|---|------|------|-------|----------| +| 1 | Quick Win | 30s | Speed & simplicity | Everyone | +| 2 | Interactive Magic | 3-4min | UI & Features | Beginners | +| 3 | Power User | 2min | Automation & CLI | Developers | +| 4 | Team Templates | 2min | Collaboration | Team leads | +| 5 | History Replay | 1min | Workflow | Everyone | +| Bonus | AI-Assisted Dev | 1-2min | AI Integration | Tech enthusiasts | + +**Total**: 10-12 minutes + Q&A (+ optional bonus) + +--- + +## šŸŽ¤ Presentation Flow + +### Opening (30 seconds) +*"How many of you have forgotten to install your favorite packages until after you'd started coding?"* + +### Demo (10-12 minutes) +- Scenario 1: 30-second default script +- Scenario 2: Interactive mode walkthrough +- Scenario 3: CLI automation examples +- Scenario 4: Template system +- Scenario 5: History feature + +### Closing (30 seconds) +*"Free, open-source, available now on NuGet. Try it and let me know what you think!"* + +### Q&A (5-10 minutes) +Common questions: +- "Does it work with Umbraco 14?" - Yes! +- "Can I customize the scripts?" - Yes, they're just bash/PowerShell! +- "Is it free?" - Yes, MIT licensed! +- "Works offline?" - Yes, after first cache! +- "How to contribute?" - GitHub PRs welcome! + +--- + +## 🌐 Resources to Share + +**At the end of your demo, share these**: + +### Installation +```bash +dotnet tool install -g PackageScriptWriter.Cli +``` + +### Links +- **Website**: https://psw.codeshare.co.uk +- **GitHub**: https://github.com/prjseal/Package-Script-Writer +- **NuGet**: https://www.nuget.org/packages/PackageScriptWriter.Cli/ +- **Docs**: In the GitHub repo +- **Umbraco AI Skill**: https://github.com/umbraco/Umbraco-CMS-Backoffice-Skills/blob/main/plugins/umbraco-backoffice-skills/skills/package-script-writer/SKILL.md + +### Social Media +Prepare a tweet/post for attendees: +``` +Just saw an amazing demo of Package Script Writer CLI at #UmbracoSydney! +Generate Umbraco installation scripts in seconds šŸš€ + +Install: dotnet tool install -g PackageScriptWriter.Cli +Try it: https://psw.codeshare.co.uk +⭐ Repo: https://github.com/prjseal/Package-Script-Writer + +#Umbraco #DotNet #CLI +``` + +--- + +## šŸŽÆ Success Metrics + +Your demo is successful if attendees: + +- [ ] **Understand** what PSW does (script generation) +- [ ] **See** the value (speed, automation, standardization) +- [ ] **Want to try** it themselves +- [ ] **Remember** the key command (`psw`) +- [ ] **Know where** to find it (NuGet, website) + +**Bonus wins**: +- [ ] Someone stars the GitHub repo during the demo +- [ ] Someone asks about contributing +- [ ] Someone wants to share a template +- [ ] Someone mentions a use case you hadn't thought of + +--- + +## šŸ”— File Navigation + +``` +Package-Script-Writer/ +ā”œā”€ā”€ DEMO_README.md ← You are here +ā”œā”€ā”€ DEMO_SCENARIOS.md ← Detailed scenarios (includes Scenario 8: Security!) +ā”œā”€ā”€ DEMO_CHEAT_SHEET.md ← Quick reference (includes security quick answers) +ā”œā”€ā”€ DEMO_TROUBLESHOOTING.md ← Problem solving (includes security Q&A handling) +ā”œā”€ā”€ SECURITY_FAQ.md ← Comprehensive security reference +ā”œā”€ā”€ AI_INTEGRATION.md ← AI skill integration guide +ā”œā”€ā”€ prepare-demo.sh ← Setup script (Unix) +└── prepare-demo.ps1 ← Setup script (Windows) +``` + +--- + +## šŸ’” Pro Tips + +### Engagement +- **Ask questions** during waits: "Who uses uSync?" +- **Share stories**: "This saved me X hours last week" +- **Be authentic**: "Let's see if this works..." builds tension +- **Show personality**: Your enthusiasm is contagious! + +### Technical +- **Use verbose mode** when educational: `PSW_VERBOSE=1 psw` +- **Show the files**: `cat script.sh` or open in editor +- **Explain as you go**: Don't just run commands silently +- **Compare approaches**: "Interactive vs CLI mode" + +### Timing +- **Don't rush**: Better to do 3 scenarios well than 5 poorly +- **Watch the clock**: Have a simple watch/timer visible +- **Buffer time**: Leave 5min for Q&A +- **Cut if needed**: Skip history/templates if running long + +--- + +## šŸš€ Day-Of Command Reference + +Keep these commands handy on demo day: + +```bash +# Navigate to demo workspace +cd ~/psw-demo-sydney + +# Scenario 1: Quick Win (30s) +psw --default + +# Scenario 2: Interactive (3-4min) +psw + +# Scenario 3: CLI Examples (2min) +psw -p "uSync|17.0.0,Diplo.GodMode" -n UmbracoSydney -s SydneyMeetup --database-type SQLite +psw --template "Bootstrap Starter Kit" -p "uSync" -n ClientSite --auto-run + +# Scenario 4: Templates (2min) +psw template list +psw template load DemoTeamStandard -n NewProject + +# Scenario 5: History (1min) +psw history list +psw history show 1 +psw history rerun 1 + +# Bonus: Versions +psw versions + +# Emergency: Show backup +cat backup-default-script.sh +cat backup-full-script.sh +``` + +--- + +## šŸ“ž Support + +If you have questions about these demo materials: + +- **GitHub Issues**: https://github.com/prjseal/Package-Script-Writer/issues +- **Discussions**: https://github.com/prjseal/Package-Script-Writer/discussions + +--- + +## āœ… Final Pre-Demo Checklist + +**24 Hours Before**: +- [ ] Run `prepare-demo.sh` +- [ ] Practice full demo once +- [ ] Test all commands +- [ ] Prepare backup materials + +**1 Hour Before**: +- [ ] Run `prepare-demo.sh` again +- [ ] Test network connection +- [ ] Open reference materials +- [ ] Clear terminal +- [ ] Adjust terminal size +- [ ] Test screen mirroring + +**Right Before**: +- [ ] Deep breath +- [ ] Silence notifications +- [ ] Water nearby +- [ ] Backup tabs open +- [ ] Ready to go! + +--- + +## šŸŽŠ Post-Demo + +After your demo: + +1. **Gather feedback**: Ask attendees what resonated +2. **Share resources**: Post links in chat/email +3. **Follow up**: Answer questions in Discussions +4. **Improve**: Note what worked/didn't for next time +5. **Celebrate**: You did it! šŸŽ‰ + +--- + +## āš ļø CRITICAL: Proactive Security Discussion + +**IMPORTANT: Address security BEFORE questions arise!** + +After Scenario 1 or 2 (around minute 3-4), take 60-90 seconds to address security: + +### The Script (What to Say) + +> *"Before we go further - I know some of you might be thinking 'auto-run sounds risky.' Let me show you why it's actually safe..."* + +### The Demo (What to Show) + +```bash +# 1. Generate WITHOUT auto-run (15 sec) +psw -d -n SecurityDemo -s SecurityDemo -u \ + --database-type SQLite \ + --admin-email admin@demo.com \ + --admin-password Demo123! \ + -o script.sh + +# 2. Show the script (20 sec) +cat script.sh | head -30 +# Point out: "See? Just standard dotnet commands" + +# 3. Mention alternatives (10 sec) +"You can use --copy to review yourself, or -o to save and edit" + +# 4. Show the validator (20 sec) +"Plus there's strict validation - here's the code..." +# Open: https://github.com/prjseal/Package-Script-Writer/blob/main/src/PackageCliTool/Validation/CommandValidator.cs +``` + +### Why This Matters + +āœ… **Builds trust** before skepticism sets in +āœ… **Shows you've thought** about their concerns +āœ… **Turns objection into** selling point +āœ… **Reduces Q&A friction** later +āœ… **Demonstrates transparency** and confidence + +### Resources to Have Ready + +- [ ] **SECURITY_FAQ.md** - printed or on second screen +- [ ] **GitHub tab** - CommandValidator.cs already open +- [ ] **Example script** - already generated to show +- [ ] **Confidence** - practice this section! + +--- + +**Good luck with your Umbraco Sydney Meetup demo! šŸš€** + +*Remember: Your enthusiasm and knowledge are more important than a perfect demo. Address security proactively and have fun with it!* + +--- + +## šŸ“ Notes Space + +Use this area for demo-specific notes: + +**Attendee Count**: _____ + +**Key Questions Asked**: +- +- +- + +**Security Concerns Raised**: +- +- +- + +**What Resonated Most**: +- +- +- + +**What To Improve**: +- +- +- + +**Follow-Up Items**: +- +- +- diff --git a/DEMO_SCENARIOS.md b/DEMO_SCENARIOS.md new file mode 100644 index 0000000..17257a4 --- /dev/null +++ b/DEMO_SCENARIOS.md @@ -0,0 +1,767 @@ +# Package Script Writer CLI - Demo Scenarios for Umbraco Sydney Meetup + +This document outlines compelling demo scenarios that showcase the Package Script Writer CLI tool's capabilities in both interactive and non-interactive modes. + +--- + +## šŸŽÆ Demo Flow Overview + +The demo progresses from quick wins to advanced features, showing real-world scenarios that resonate with Umbraco developers. + +**Suggested Flow**: +1. **Quick Win** - Default script (30 seconds) +2. **Interactive Magic** - Full interactive workflow (3-4 minutes) +3. **Power User** - CLI automation (2 minutes) +4. **Team Collaboration** - Templates (2 minutes) +5. **Time Saver** - History feature (1 minute) + +**Total Demo Time**: ~10-12 minutes + +--- + +## šŸš€ Scenario 1: "The 30-Second Win" (Default Script) + +**Story**: *"I need an Umbraco site, and I need it NOW!"* + +**Why it's compelling**: Shows immediate value with zero configuration. + +### Demo Commands + +```bash +# Just type 'psw' with --default flag +psw --default + +# Watch it generate a complete script in seconds +# Script includes: template installation, project creation, ready to run! +``` + +### Key Talking Points + +- "This is the fastest way to get started with Umbraco" +- "No questions, no configuration, just a working script" +- "Uses latest Umbraco version with SQLite (perfect for prototyping)" +- Shows the generated script with `cat` or your editor +- Optional: Actually execute the script to show it works! + +### Expected Output + +A complete bash/PowerShell script that: +- Installs Umbraco.Templates +- Creates a new solution and project +- Uses SQLite (no SQL Server required) +- Ready to run immediately + +--- + +## šŸŽØ Scenario 2: "The Interactive Experience" (Full Guided Workflow) + +**Story**: *"Let me build a proper blog with all the tools I need"* + +**Why it's compelling**: Showcases the beautiful Spectre.Console UI and guides users through options they didn't know existed. + +### Demo Flow + +```bash +psw +``` + +Then navigate through: + +1. **Main Menu** - Select "Create new script" + +2. **Template Selection** + - Choose "Clean Starter Kit" (or "Bootstrap Starter Kit") + - Select latest version + - *"Look at how it auto-fetches available versions!"* + +3. **Project Configuration** + - Project Name: `UmbracoSydneyBlog` + - Solution Name: `SydneyBlog` + +4. **Package Selection** - *This is where it gets exciting!* + - Search for packages + - Select: + - `uSync` (for deployment) + - `Diplo.GodMode` (for debugging) + - `Umbraco.Community.BlockPreview` (for content editors) + - *"500+ packages available from the Marketplace!"* + +5. **Options Configuration** + - Database: SQLite (for simplicity) + - Unattended Install: Yes + - Admin Email: `admin@sydneyumbraco.com` + - Password: (use a demo password) + - Docker: Yes + - *"Perfect for containerized deployments!"* + +6. **Generate & Execute** + - Generate script + - View it + - Option to save and run immediately + +### Key Talking Points + +- "Beautiful terminal UI with fuzzy search" +- "Auto-completion and version selection" +- "All 500+ Marketplace packages at your fingertips" +- "Unattended install means no manual setup - perfect for CI/CD" +- "Docker support out of the box" + +### Why This Scenario Wins + +- Shows the **breadth** of options without overwhelming +- Demonstrates **real packages** that Sydney devs know and love +- The **visual appeal** of Spectre.Console is impressive +- Builds a **production-ready** configuration + +--- + +## ⚔ Scenario 3: "The Power User" (CLI Automation) + +**Story**: *"I'm scripting our onboarding process - no time for interactive prompts!"* + +**Why it's compelling**: Shows how PSW fits into professional workflows, CI/CD, and team automation. + +### Demo Commands + +#### Example A: Quick Package Setup + +```bash +# Install Umbraco with uSync and Diplo.GodMode in one command +psw -p "uSync|17.0.0,Diplo.GodMode" \ + -n UmbracoSydney \ + -s SydneyMeetup \ + --database-type SQLite +``` + +**Talking Point**: *"This is your Friday afternoon setup - specific versions, no questions asked."* + +#### Example B: Full CI/CD Pipeline Script + +```bash +# Production-ready setup with everything configured +psw -p "uSync,Our.Umbraco.GMaps,Umbraco.Community.BlockPreview" \ + -n ProductionSite \ + -s MySolution \ + -u \ + --database-type SQLServer \ + --admin-email "admin@example.com" \ + --admin-password "SecurePass123!" \ + --connection-string "Server=localhost;Database=UmbracoDb;..." \ + --add-docker \ + --auto-run +``` + +**Talking Points**: +- *"Perfect for GitHub Actions, Azure DevOps, or any CI/CD pipeline"* +- *"Fully automated - no human intervention needed"* +- *"Version pinning ensures consistency across environments"* +- *"The --auto-run flag even executes the script for you!"* + +#### Example C: Bootstrap a New Client Project + +```bash +# Use the Bootstrap Starter Kit for a quick client site +psw --template "Bootstrap Starter Kit" \ + -p "uSync,Diplo.GodMode" \ + -n ClientWebsite \ + -u --database-type SQLite \ + --admin-email "dev@agency.com" \ + --admin-password "TempPass123!" \ + --auto-run +``` + +**Talking Point**: *"Agency workflow - spin up a new client site in under 2 minutes."* + +### Why This Scenario Wins + +- Shows **professional use cases** that solve real problems +- Demonstrates **reproducibility** and **automation** +- Perfect for **DevOps-minded** developers +- One-liner commands are **shareable** and **documentable** + +--- + +## šŸ‘„ Scenario 4: "The Team Template" (Template System) + +**Story**: *"Our team has a standard setup - let's make it reusable!"* + +**Why it's compelling**: Shows how teams can standardize and share configurations. + +### Demo Flow + +#### Step 1: Create Your Team Template + +```bash +# Create your ideal setup first (using CLI or interactive mode) +psw -p "uSync|17.0.0,Diplo.GodMode,Umbraco.Community.BlockPreview" \ + -n MyProject \ + -s MySolution \ + -u --database-type SQLite \ + --admin-email "admin@company.com" \ + template save TeamStandard \ + --template-description "Company standard Umbraco setup with essential packages" \ + --template-tags "company,standard,umbraco14" +``` + +**Talking Point**: *"Now every developer in your company can use this exact configuration."* + +#### Step 2: Share with Team + +Show the saved template file location: + +```bash +# Templates are saved in your profile +# Windows: %USERPROFILE%\.psw\templates\ +# macOS/Linux: ~/.psw/templates/ + +psw template list +``` + +**Talking Point**: *"Templates are just YAML files - check them into Git, share via Slack, email them to contractors."* + +#### Step 3: Load Template Later + +```bash +# New team member joins - instant setup! +psw template load TeamStandard + +# Or in CLI mode +psw template load TeamStandard --project-name NewProject --auto-run +``` + +**Talking Point**: *"Onboarding new developers? One command and they're running the company standard."* + +#### Step 4: Override Template Values + +```bash +# Load template but customize project name +psw template load TeamStandard \ + -n ClientProjectAlpha \ + -s ClientAlpha \ + --admin-email "dev@client.com" +``` + +**Talking Point**: *"Templates are starting points - override anything you need per project."* + +### Advanced: Community Templates + +```bash +# Browse community-shared templates +psw community list + +# Load a community template +psw community load "Full-Featured Blog" + +# Or in one command: +psw --community-template "Full-Featured Blog" -n MyBlog --auto-run +``` + +**Talking Point**: *"Learn from the community - see how others are configuring their Umbraco projects."* + +### Why This Scenario Wins + +- Addresses **real pain point**: team standardization +- Shows **collaboration features** +- Templates are **portable** and **versionable** +- Community templates demonstrate **ecosystem benefits** + +--- + +## šŸ“Š Scenario 5: "The History Replay" (History Feature) + +**Story**: *"What was that script I generated last week? I need it again!"* + +**Why it's compelling**: Shows that PSW remembers everything and makes it reusable. + +### Demo Flow + +#### View History + +```bash +# List all previously generated scripts +psw history list +``` + +Shows a beautiful table with: +- Entry number +- Project name +- Packages used +- Timestamp +- Template used + +#### Show Script Details + +```bash +# View details of a specific entry +psw history show 5 +``` + +**Talking Point**: *"Every script is automatically saved - never lose your configuration."* + +#### Rerun a Previous Script + +```bash +# Exactly replicate a previous setup +psw history rerun 5 + +# Or rerun with modifications +psw history rerun 5 -n NewProjectName --auto-run +``` + +**Talking Point**: *"Client wants the same setup as Project X? Just replay it."* + +### Why This Scenario Wins + +- Shows **attention to developer workflow** +- Eliminates **"I forgot what I did"** problems +- Makes **experimentation safe** (you can always go back) +- Automatic **documentation** of all your setups + +--- + +## šŸŽ­ Bonus Scenarios (If Time Permits) + +### Scenario 6: "The Umbraco Versions Expert" + +Show the versions table feature: + +```bash +psw versions +``` + +**Talking Point**: *"Need to know which Umbraco versions are LTS vs STS? PSW has you covered."* + +Shows a beautiful table with: +- Version numbers +- Support type (LTS/STS) +- Release dates +- Support end dates + +### Scenario 7: "The Offline Developer" + +Demonstrate caching: + +```bash +# First run - fetches from API +psw + +# Second run - uses cache (much faster!) +psw + +# Clear cache if needed +psw --clear-cache +``` + +**Talking Point**: *"Works offline after first fetch - perfect for trains, planes, and coffee shops with bad Wi-Fi."* + +### Scenario 8: "The Security Conscious" (Trust & Transparency) + +**Story**: *"How do I know --auto-run won't do something malicious on my machine?"* + +**Why it's compelling**: Addresses the elephant in the room and turns security concerns into selling points. + +This is a **critical scenario** - proactively address security before anyone asks. It builds trust and shows you've thought about safety. + +#### Demo Flow + +**1. Acknowledge the Concern** + +*"I know what you're thinking - 'auto-run sounds scary.' Let me show you why it's actually safer than you might think."* + +**2. Show the Open Source Code** + +Open GitHub in browser: +``` +https://github.com/prjseal/Package-Script-Writer +``` + +**Talking Points**: +- *"Everything is open source - no black boxes"* +- *"You can audit every line of code"* +- *"Over [X] stars and [Y] contributors watching for issues"* +- *"Same code runs on the website at psw.codeshare.co.uk that thousands use"* + +**3. Demonstrate Command Validation** + +Show the validation code: +``` +Navigate to: src/PackageCliTool/Validation/CommandValidator.cs +``` + +**Talking Points**: +- *"Before ANY command runs, it goes through validation"* +- *"There's an allowlist of safe commands - everything else is blocked"* +- *"Only dotnet commands, file operations, and package management allowed"* +- *"Dangerous commands like rm -rf, format, delete are completely blocked"* + +**4. Show What's Allowed** + +Explain the allowlist: + +```bash +# These commands are ALLOWED: +dotnet new install +dotnet new sln +dotnet add package +dotnet run +dotnet build +dotnet restore + +# These are BLOCKED: +rm -rf +del /f +format +curl | bash (piped commands with external sources) +Any system modification commands +``` + +**Talking Points**: +- *"The validator uses regex patterns to verify each command"* +- *"Chained commands (&&) are validated individually"* +- *"Even a single dangerous command blocks the entire script"* + +**5. Generate and Show a Script** + +```bash +# Generate a script WITHOUT auto-run +psw -d -n SecurityDemo -s SecurityDemo -u \ + --database-type SQLite \ + --admin-email admin@demo.com \ + --admin-password DemoPass123! + +# Save to file +psw -d -n SecurityDemo -s SecurityDemo -u \ + --database-type SQLite \ + --admin-email admin@demo.com \ + --admin-password DemoPass123! \ + -o install-script.sh + +# Show the contents +cat install-script.sh +``` + +**Talking Points**: +- *"See? Just standard dotnet commands"* +- *"Nothing hidden, nothing malicious"* +- *"You can read every single line before running"* +- *"This is EXACTLY what --auto-run would execute"* + +**6. Compare with Web Version** + +Show the web version side-by-side: +``` +Open: https://psw.codeshare.co.uk +Generate the same configuration +Compare the output +``` + +**Talking Points**: +- *"Identical output - same code, same validation"* +- *"If you trust the website, you can trust the CLI"* +- *"Thousands of developers already use this"* + +**7. Demonstrate the Copy Option** + +```bash +# Generate and copy to clipboard +psw -d -n SecurityDemo -s SecurityDemo -u \ + --database-type SQLite \ + --admin-email admin@demo.com \ + --admin-password DemoPass123! \ + --copy + +# Or output to file for review +psw -d ... -o my-script.sh + +# Review it +cat my-script.sh + +# Run it yourself when ready +bash my-script.sh +``` + +**Talking Points**: +- *"Don't trust --auto-run? No problem!"* +- *"Use --copy to get the script on your clipboard"* +- *"Or -o to save to a file"* +- *"Review it, edit it, run it yourself - complete control"* + +**8. Show the Validation in Action** + +If possible, demonstrate a blocked command: + +```bash +# This would be blocked if it tried to run +# (Don't actually try to generate this - just explain) +``` + +**Example Talking Points**: +- *"If somehow a malicious command snuck in, the validator would catch it"* +- *"The script won't run at all - complete safety"* +- *"You'd see an error message listing the dangerous commands"* + +#### Key Security Messages + +**Trust Through Transparency**: +1. āœ… **Open Source**: Every line of code is visible on GitHub +2. āœ… **Community Verified**: Stars, forks, contributors watching +3. āœ… **Battle Tested**: Same code as the popular website +4. āœ… **Validated Commands**: Strict allowlist, nothing dangerous +5. āœ… **Full Control**: Copy, review, edit before running +6. āœ… **No Network Calls in Scripts**: Scripts only call official package managers +7. āœ… **No Sudo Required**: Everything runs in user space +8. āœ… **Reversible**: All operations are standard dotnet commands + +#### Addressing Common Security Concerns + +| Concern | Response | +|---------|----------| +| "How do I know it's safe?" | "Open source, validated commands, same as website version" | +| "What if it deletes my files?" | "Command validator blocks all file deletion commands" | +| "Could it install malware?" | "Only installs from official NuGet and Umbraco Marketplace" | +| "What about my data?" | "No data collected, no telemetry, runs completely local" | +| "Can it access my network?" | "Only to download official packages - same as manual install" | +| "What if I don't trust it?" | "Use --copy or -o, review the script yourself, run manually" | + +#### Live Demo Script + +**Setup** (What you say): +> *"Before we go further, let's talk about security - because I know some of you are thinking '--auto-run sounds risky.' Here's why it's not..."* + +**Show** (What you demo): +1. GitHub repository (30 seconds) +2. CommandValidator.cs file (30 seconds) +3. Generate a script and show contents (45 seconds) +4. Demonstrate copy option (15 seconds) + +**Conclude** (What you emphasize): +> *"So you have options: Trust the validator and use --auto-run for speed, or review everything yourself with --copy. Either way, you're in control."* + +#### Pro Tips for Security Demo + +1. **Be Proactive**: Bring up security BEFORE questions arise +2. **Show Code**: Actually navigate to the validator - don't just talk about it +3. **Offer Options**: Always mention the --copy and -o alternatives +4. **Build Trust**: Reference the website version that people know +5. **Be Honest**: If someone finds a security concern, acknowledge and discuss + +**Total Time**: 2-3 minutes (can be condensed to 1 minute if needed) + +### Scenario 9: "The AI-Assisted Developer" (Future of Development) + +**Story**: *"What if AI could set up your entire Umbraco environment?"* + +**Why it's compelling**: Shows PSW's integration with cutting-edge AI development workflows. + +Demonstrate how PSW is being integrated into Umbraco's official AI-assisted development tools: + +**Background**: +PSW is now an official skill in Umbraco's Backoffice Skills system for Claude Code, enabling AI-powered Umbraco setup. + +**Demo Talking Points**: + +1. **Show the Integration**: + ```bash + # This is the command structure used by AI assistants + export PATH="$PATH:$HOME/.dotnet/tools" && psw -d \ + -n AIGeneratedProject -s AIGeneratedSolution -u \ + --database-type SQLite \ + --admin-email admin@test.com \ + --admin-password SecurePass1234 \ + --auto-run + ``` + +2. **Explain the Workflow**: + - *"Umbraco's Backoffice Skills system can now use PSW automatically"* + - *"You can tell an AI 'set up an Umbraco site with uSync' and it happens"* + - *"The AI knows the exact flags and can run it in the background"* + +3. **Key Features for AI Integration**: + - `-d` flag ensures full script generation + - `--auto-run` enables complete automation + - Background execution support for long-running servers + - PATH management for tool availability + +4. **Show the Official Documentation**: + ``` + GitHub: umbraco/Umbraco-CMS-Backoffice-Skills + Path: plugins/umbraco-backoffice-skills/skills/package-script-writer/SKILL.md + ``` + +**Talking Points**: +- *"PSW isn't just a CLI tool - it's becoming part of the AI-powered development workflow"* +- *"Umbraco officially recognizes PSW as a backoffice skill for AI assistants"* +- *"This is the future - describe what you want, AI sets it up using PSW"* +- *"From conversation to running Umbraco site in minutes"* + +**Why This Matters**: +- Shows PSW is forward-thinking and officially recognized +- Demonstrates integration with modern AI development tools +- Highlights Umbraco's commitment to AI-assisted development +- Positions PSW at the cutting edge of developer tooling + +**Resource to Share**: +``` +https://github.com/umbraco/Umbraco-CMS-Backoffice-Skills/blob/main/plugins/umbraco-backoffice-skills/skills/package-script-writer/SKILL.md +``` + +--- + +## šŸŽ¬ Demo Tips & Tricks + +### Before the Demo + +1. **Pre-cache packages**: Run `psw` once before demo to cache the package list +2. **Prepare terminals**: Have 2-3 terminal windows ready +3. **Clear history**: `psw history clear` for a clean slate (or keep some entries to show the feature) +4. **Test auto-run**: Make sure `--auto-run` works in your environment + +### During the Demo + +1. **Use verbose mode**: `psw --verbose` or `PSW_VERBOSE=1 psw` to show what's happening +2. **Show the files**: Use `cat` or `code` to show generated scripts +3. **Compare outputs**: Show bash vs PowerShell output side by side +4. **Highlight colors**: The Spectre.Console colors look amazing - let them shine! + +### Common Demo Pitfalls to Avoid + +1. **Network issues**: Have a cached run ready as backup +2. **Typos in package names**: Use copy-paste for CLI demos +3. **Long waits**: While API calls happen, narrate what's happening +4. **Terminal size**: Make sure your terminal is big enough for tables + +### Backup Plan + +If live demo fails: +1. Show pre-recorded terminal recording (use `asciinema`) +2. Walk through generated scripts from file system +3. Show the code on GitHub +4. Show the web version at https://psw.codeshare.co.uk + +--- + +## šŸŽÆ Key Messages to Drive Home + +1. **Speed**: "From zero to Umbraco in under 60 seconds" +2. **Flexibility**: "Interactive when learning, automated when you know what you want" +3. **Team-Friendly**: "Share templates, standardize setups, onboard faster" +4. **Production-Ready**: "CI/CD pipelines, Docker support, unattended installs" +5. **Safety**: "Command validation prevents mistakes, history keeps you safe" +6. **Community**: "500+ packages, community templates, growing ecosystem" +7. **AI-Ready**: "Official Umbraco backoffice skill - AI-assisted development is here" + +--- + +## šŸ“‹ Demo Checklist + +- [ ] CLI tool installed and working (`dotnet tool install -g PackageScriptWriter.Cli`) +- [ ] Cache primed (run `psw` once) +- [ ] Terminal configured (size, colors, font) +- [ ] Backup slides/recordings ready +- [ ] Example scripts pre-generated (as backup) +- [ ] Network connection stable +- [ ] Demo project names chosen (Sydney-themed!) +- [ ] Passwords prepared (don't type them live!) +- [ ] Community templates reviewed +- [ ] History populated with some examples + +--- + +## šŸŽ¤ Suggested Narrative Arc + +### Opening (30 seconds) +"How many of you have set up a new Umbraco project in the last month? Show of hands? Okay, and how many of you forgot to install your favorite packages until after you'd already started coding? Yeah, me too. That's why I built this." + +### Act 1: The Quick Win (1 minute) +"Let's start with the absolute fastest way to get Umbraco running..." +[Demo Scenario 1] + +### Act 2: The Beauty (3-4 minutes) +"But what if you want more control? Let me show you the interactive mode..." +[Demo Scenario 2] + +### Act 3: The Power (2 minutes) +"Now, interactive is great, but what about automation? What about CI/CD pipelines?" +[Demo Scenario 3] + +### Act 4: The Team Play (2 minutes) +"Here's where it gets really useful for teams..." +[Demo Scenario 4] + +### Act 5: The Safety Net (1 minute) +"And finally, because we all forget things..." +[Demo Scenario 5] + +### Closing (30 seconds) +"So whether you're learning Umbraco, building production sites, or managing a team, PSW has you covered. It's free, open-source, and available now on NuGet. Give it a try and let me know what you think!" + +--- + +## 🌐 Resources to Share + +At the end of demo, share: + +- **NuGet Package**: `dotnet tool install -g PackageScriptWriter.Cli` +- **Website**: https://psw.codeshare.co.uk +- **GitHub**: https://github.com/prjseal/Package-Script-Writer +- **Documentation**: Full docs in the repo +- **Community**: GitHub Discussions for questions + +--- + +## ✨ Demo Script Quick Reference + +```bash +# Scenario 1: 30-Second Win +psw --default + +# Scenario 2: Interactive Experience +psw +# Then navigate through menus + +# Scenario 3: Power User Examples +psw -p "uSync|17.0.0,Diplo.GodMode" -n UmbracoSydney -s SydneyMeetup +psw --template "Bootstrap Starter Kit" -p "uSync" -n ClientSite --auto-run + +# Scenario 4: Team Templates +psw template save TeamStandard +psw template list +psw template load TeamStandard -n NewProject + +# Scenario 5: History +psw history list +psw history show 5 +psw history rerun 5 + +# Bonus: Versions Table +psw versions +``` + +--- + +## šŸŽŠ After the Demo + +Encourage attendees to: + +1. **Try it**: Give them 5 minutes to install and run it +2. **Contribute**: Show them how to add community templates +3. **Feedback**: Direct them to GitHub Issues +4. **Share**: Tweet/post about their experience + +--- + +## šŸ“ Notes Section + +Use this space to add notes specific to your audience: + +- Sydney Umbraco community size: +- Common packages used in Sydney: +- Local pain points to address: +- Attendee questions from chat: + +--- + +**Good luck with your demo! You've got this! šŸš€** + +*Remember: The tool is impressive, but your enthusiasm and storytelling will make it memorable.* diff --git a/DEMO_TROUBLESHOOTING.md b/DEMO_TROUBLESHOOTING.md new file mode 100644 index 0000000..913c1f9 --- /dev/null +++ b/DEMO_TROUBLESHOOTING.md @@ -0,0 +1,565 @@ +# PSW CLI Demo - Troubleshooting Guide + +Quick solutions for common issues during the live demo at Umbraco Sydney meetup. + +--- + +## 🚨 Quick Fixes for Common Issues + +### Issue: "psw: command not found" + +**Symptoms**: Terminal doesn't recognize `psw` command + +**Quick Fix**: +```bash +# Reinstall the tool +dotnet tool install -g PackageScriptWriter.Cli + +# Or update if already installed +dotnet tool update -g PackageScriptWriter.Cli +``` + +**Prevention**: Test the command before the demo starts + +--- + +### Issue: Slow API Response / Hanging + +**Symptoms**: Command hangs for 30+ seconds, or times out + +**Cause**: Network issues, IPv6 timeout, or API unavailable + +**Quick Fix Option 1** (Use cache): +```bash +# The cache should work even if API is slow +# Just wait it out, the cache will load +``` + +**Quick Fix Option 2** (Use backup): +```bash +# Show pre-generated script from backup +cd ~/psw-demo-sydney +cat backup-default-script.sh +# Or open in editor +code backup-default-script.sh +``` + +**Quick Fix Option 3** (Verbose mode): +```bash +# Show what's happening +PSW_VERBOSE=1 psw --default +# Or on Windows +$env:PSW_VERBOSE="1"; psw --default +``` + +**Talking Point While Waiting**: +- "The tool is fetching 500+ packages from the Umbraco Marketplace..." +- "Normally this is fast because of caching, but looks like we hit a network hiccup" +- "This is why the tool has caching built-in - second run is always instant" + +--- + +### Issue: Network Completely Unavailable + +**Symptoms**: Cannot reach any external APIs + +**Quick Fix**: +```bash +# Use the backup scripts you generated earlier +cd ~/psw-demo-sydney + +# Show default script +cat backup-default-script.sh + +# Show full-featured script +cat backup-full-script.sh +``` + +**Talking Points**: +- "I generated these beforehand, but this is exactly what PSW would create" +- "Let me walk through what this script does..." +- "The beauty of PSW is that these scripts are portable and shareable" + +**Alternative**: Switch to the web version at https://psw.codeshare.co.uk + +--- + +### Issue: Interactive Mode Crashes / Freezes + +**Symptoms**: Interactive menu becomes unresponsive + +**Quick Fix**: +```bash +# Press Ctrl+C to restart (PSW handles this gracefully) +# The tool will restart automatically + +# Or exit and use CLI mode instead +psw -p "uSync,Diplo.GodMode" -n DemoProject -s DemoSolution +``` + +**Talking Point**: +- "Notice how PSW handles Ctrl+C gracefully and restarts" +- "But for automation, we have CLI mode which is perfect for scripts" + +--- + +### Issue: Terminal Too Small for Tables + +**Symptoms**: Tables look broken, wrapped text, unreadable output + +**Quick Fix**: +```bash +# Resize terminal window +# Minimum recommended: 120 columns x 30 rows + +# Or use a simpler command that doesn't output tables +psw --default +``` + +**Prevention**: Set terminal size before demo (check with `tput cols`) + +--- + +### Issue: Colors Not Showing + +**Symptoms**: No colors, just plain text + +**Quick Fix**: +```bash +# Check if terminal supports colors +echo $TERM + +# Try forcing colors (if your terminal supports it) +export TERM=xterm-256color + +# On Windows PowerShell, ensure Windows Terminal is used +``` + +**Talking Point**: +- "The CLI has a beautiful colored interface, but it gracefully degrades" +- "Even without colors, all functionality works perfectly" + +--- + +### Issue: Package Not Found + +**Symptoms**: Error when trying to add a specific package + +**Quick Fix**: +```bash +# Use a different, well-known package +# Safe bets that always work: +- uSync +- Diplo.GodMode +- Umbraco.Community.BlockPreview +- Umbraco.Community.Contentment + +# Or just use default +psw --default +``` + +**Talking Point**: +- "Package names must match exactly as they appear in the Marketplace" +- "The interactive mode has fuzzy search to help with this" + +--- + +### Issue: Template Command Fails + +**Symptoms**: Cannot save or load templates + +**Quick Fix**: +```bash +# Check if template directory exists +ls ~/.psw/templates/ # macOS/Linux +dir %USERPROFILE%\.psw\templates\ # Windows + +# Create it manually if needed +mkdir -p ~/.psw/templates/ + +# Or skip template demo and show history instead +psw history list +``` + +--- + +### Issue: History Empty + +**Symptoms**: `psw history list` shows no entries + +**Quick Fix**: +```bash +# Generate a quick script to populate history +psw --default + +# Now show history +psw history list + +# Or use pre-populated history from prepare-demo script +``` + +--- + +### Issue: Auto-run Flag Doesn't Work + +**Symptoms**: `--auto-run` flag doesn't execute the script + +**Cause**: Security settings, execution policy, or permissions + +**Quick Fix**: +```bash +# Generate without auto-run +psw -p "uSync" -n Demo + +# Show the script was generated +cat Demo/install-script.sh # or .ps1 on Windows + +# Explain you would normally run it manually +``` + +**Talking Point**: +- "In production, you'd run this script manually or in your CI/CD pipeline" +- "The --auto-run flag is a convenience, but manual execution gives you control" + +--- + +### Issue: Demo Password Visible + +**Symptoms**: You accidentally showed a password on screen + +**Quick Fix**: +```bash +# Acknowledge it with humor +"And yes, that's a demo password - never use DemoPass123! in production!" + +# For next command, use a different demo password to show variety +--admin-password "AnotherDemoPass!" +``` + +**Prevention**: Use copy-paste for passwords, not typing + +--- + +### Issue: Typo in Package Name + +**Symptoms**: Package name misspelled in CLI mode + +**Quick Fix**: +```bash +# Use up arrow to recall command +# Edit the mistake +# Re-run + +# Or switch to interactive mode +psw +# Use the package selector with search +``` + +**Talking Point**: +- "This is why the interactive mode is great - it has fuzzy search" +- "For automation, you'd test these commands once and then they're reliable" + +--- + +## šŸ”’ Handling Security Questions During Demo + +### Issue: Audience Member Questions --auto-run Safety + +**Symptoms**: Someone asks "How do I know this won't delete my files?" or "Is it safe to run automated scripts?" + +**Quick Response Framework**: + +**1. Acknowledge the Concern** (5 seconds): +``` +"Great question! Security is critical, and I'm glad you asked." +``` + +**2. Three-Point Answer** (30 seconds): +``` +"Three things make this safe: +1. Open source - you can audit all the code on GitHub +2. Command validation - strict allowlist blocks dangerous commands +3. You control execution - use --copy to review first if you want" +``` + +**3. Show Proof** (if time permits, 1 minute): +```bash +# Show the script output without running +psw -d -n Demo -s Demo -u --database-type SQLite \ + --admin-email admin@demo.com --admin-password Demo123! + +# Show it's just standard dotnet commands +cat [output or pipe to less] +``` + +**4. Offer Alternative** (10 seconds): +``` +"If you prefer, use --copy or -o to save the script and review it yourself +before running. You have complete control." +``` + +### Deep Dive Security Answers + +**Q: "What commands can it run?"** +**A**: +- āœ… Allowed: `dotnet` CLI commands (new, add, build, run, restore) +- āœ… Allowed: File creation in project directory +- āŒ Blocked: File deletion (rm, del) +- āŒ Blocked: System modifications +- āŒ Blocked: Network commands except official package managers +- āŒ Blocked: Any command not on the allowlist + +**Q: "How does the validation work?"** +**A**: +``` +"Before execution, every command is checked against regex patterns. +The validator is in CommandValidator.cs - it's about 300 lines of +strict checking. One dangerous command = entire script blocked." +``` + +**Q: "Can I see the validation code?"** +**A**: +```bash +# Open in browser +https://github.com/prjseal/Package-Script-Writer/blob/main/src/PackageCliTool/Validation/CommandValidator.cs + +# Or show in local editor if you have the repo cloned +code src/PackageCliTool/Validation/CommandValidator.cs +``` + +**Q: "What if there's a bug in the validator?"** +**A**: +``` +"Fair point - defense in depth: +1. Validator code is peer-reviewed and open source +2. You can use -o or --copy to review scripts yourself +3. Same validation as the website version used by thousands +4. Community can report issues on GitHub +5. All commands are standard dotnet - no custom executables" +``` + +**Q: "Does it collect my data?"** +**A**: +``` +"No telemetry, no analytics, no data collection. +Everything runs locally. The only network calls are to: +1. NuGet.org for package versions (same as dotnet CLI) +2. Umbraco Marketplace for package list (same as website) +That's it. No tracking, no third parties." +``` + +**Q: "Why not just generate without running?"** +**A**: +``` +"You absolutely can! Three options: +1. --auto-run: Fastest, for when you trust it +2. --copy: Get script on clipboard, review, run manually +3. -o file.sh: Save to file, review, edit, run when ready + +Choose what fits your comfort level." +``` + +### Proactive Security Demo (Recommended) + +**Don't wait for questions - address it upfront:** + +**After Scenario 1 or 2, say this**: +> *"Before we go further - I know some of you are thinking 'auto-run sounds risky.' Let me show you why it's safe..."* + +**Then do a 60-second security proof**: +```bash +# 1. Generate without auto-run (15 sec) +psw -d -n SecurityDemo -s SecurityDemo -u --database-type SQLite \ + --admin-email admin@demo.com --admin-password Demo123! \ + -o script.sh + +# 2. Show the script (20 sec) +cat script.sh | head -30 +# Point out: "See? Just standard dotnet commands" + +# 3. Mention alternatives (10 sec) +"You can use --copy to review yourself, or -o to save and edit" + +# 4. Show the validator (15 sec) +"Plus there's strict validation - here's the code..." +[Open GitHub to CommandValidator.cs in browser] +``` + +**Impact**: Builds trust before questions arise, shows you're thinking about their concerns. + +### Turn Security Into a Selling Point + +**Reframe the narrative**: + +āŒ **Defensive**: "Don't worry, it's safe" +āœ… **Confident**: "Security is built in from day one" + +**Key phrases**: +- "We take security seriously - that's why everything is validated" +- "Open source means transparency - no black boxes" +- "You always have control - from full automation to manual review" +- "Same trusted code as the website thousands use daily" +- "Command validation means you can't accidentally run something dangerous" + +### If Someone Is Still Skeptical + +**Acknowledge and offer alternatives**: +``` +"I totally understand being cautious with automated scripts. +That's exactly why we built the --copy and -o options. +Generate the script, review every line, edit if needed, +then run it yourself when you're comfortable. + +Or use the website version at psw.codeshare.co.uk if you prefer. +It generates the exact same output, you just copy-paste manually." +``` + +**Never**: +- Get defensive +- Dismiss concerns +- Pressure anyone to use --auto-run +- Claim it's "100% safe" (nothing is) + +**Always**: +- Acknowledge the concern is valid +- Show the safeguards +- Offer alternatives +- Respect their choice + +--- + +## šŸŽ¬ General Demo Recovery Strategies + +### Strategy 1: Pivot to Backup Material + +If live demo fails: +1. Show pre-generated scripts from `~/psw-demo-sydney/` +2. Walk through the code on GitHub +3. Show screenshots/videos (if you prepared them) +4. Switch to the web version at https://psw.codeshare.co.uk + +### Strategy 2: Turn It Into a Teaching Moment + +If something breaks: +- "This is a great example of why caching is important" +- "This shows why we validate commands before execution" +- "Real-world demo, real-world issues - this is development!" + +### Strategy 3: Have a Backup Plan Ready + +Before the demo: +- [x] Run `prepare-demo.sh` to create backups +- [x] Test all commands once +- [x] Have the web version open in a browser tab +- [x] Have GitHub repo open in another tab +- [x] Know where your backup scripts are + +--- + +## šŸ” Pre-Demo Checklist to Avoid Issues + +Run through this 5 minutes before your demo: + +```bash +# 1. Test basic command +psw --version + +# 2. Test network +curl -I https://marketplace.umbraco.com +curl -I https://api.nuget.org + +# 3. Test cache +psw --default > /dev/null + +# 4. Check terminal size +tput cols # Should be >= 120 +tput lines # Should be >= 30 + +# 5. Verify demo workspace +ls ~/psw-demo-sydney/ + +# 6. Test one interactive command +echo "Just testing..." | psw history list +``` + +--- + +## šŸ’” Audience Engagement During Issues + +While you're fixing an issue, keep the audience engaged: + +### Ask Questions +- "Who here has used Umbraco before?" +- "What packages do you typically install?" +- "Has anyone tried the web version at psw.codeshare.co.uk?" + +### Share Context +- "Let me explain what PSW is doing behind the scenes..." +- "The tool actually caches everything locally for offline use" +- "This script uses Spectre.Console for the beautiful UI" + +### Show Related Content +- Open GitHub repository +- Show the CLAUDE.md file +- Show documentation +- Discuss architecture + +### Take Questions Early +- "While this loads, any questions?" +- "Want to see any specific features?" + +--- + +## šŸ†˜ Emergency Contacts & Resources + +If you need help during the demo: + +- **GitHub Issues**: https://github.com/prjseal/Package-Script-Writer/issues +- **Discussions**: https://github.com/prjseal/Package-Script-Writer/discussions +- **Web Version**: https://psw.codeshare.co.uk +- **NuGet Package**: https://www.nuget.org/packages/PackageScriptWriter.Cli/ + +--- + +## šŸŽÆ Remember + +**The demo doesn't have to be perfect!** + +What matters: +- āœ… Showing the value of the tool +- āœ… Demonstrating the key features +- āœ… Getting people excited to try it +- āœ… Handling issues gracefully + +A demo with a minor hiccup that you handle well is often more memorable than a perfect demo! + +--- + +## šŸ“ž Quick Reference Commands + +Keep these handy for quick recovery: + +```bash +# Reset everything +psw --clear-cache +rm -rf ~/psw-demo-sydney +./prepare-demo.sh + +# Quick test +psw --version +psw --default + +# Safe fallback commands (always work) +psw --help +psw versions +psw history list +psw template list + +# Backup demo location +cd ~/psw-demo-sydney +ls -la +``` + +--- + +**You've got this! Remember: Confidence + Humor + Preparation = Great Demo! šŸš€** diff --git a/SECURITY_FAQ.md b/SECURITY_FAQ.md new file mode 100644 index 0000000..8ba9b66 --- /dev/null +++ b/SECURITY_FAQ.md @@ -0,0 +1,522 @@ +# Package Script Writer - Security FAQ + +Addressing security concerns about the PSW CLI tool and the `--auto-run` feature. + +--- + +## šŸ”’ Quick Security Summary + +**Is PSW safe to use?** + +āœ… **Yes** - Open source, command validation, community verified, and you control execution. + +**Four Security Pillars:** +1. **Open Source Transparency** - All code visible on GitHub +2. **Command Validation** - Strict allowlist blocks dangerous operations +3. **User Control** - Choose auto-run or manual review +4. **Battle Tested** - Same code as website used by thousands + +--- + +## šŸŽÆ Frequently Asked Questions + +### Q1: Is `--auto-run` safe? + +**Short Answer**: Yes, because every command is validated before execution. + +**Detailed Answer**: +- PSW validates all commands against a strict allowlist +- Only safe `dotnet` CLI commands are allowed +- Dangerous commands (file deletion, system modifications) are blocked +- If any command fails validation, the entire script is blocked +- You can review the validation logic: `src/PackageCliTool/Validation/CommandValidator.cs` + +**Alternatives if you're concerned**: +```bash +# Review before running +psw -d -n MyProject -s MyProject -u --database-type SQLite \ + --admin-email admin@test.com --admin-password Pass123! \ + -o install-script.sh + +# Check the contents +cat install-script.sh + +# Run manually when satisfied +bash install-script.sh +``` + +--- + +### Q2: What commands are allowed? + +**Allowed Commands** (Safe): +- āœ… `dotnet new install` - Install templates +- āœ… `dotnet new sln` - Create solution +- āœ… `dotnet new [template]` - Create project +- āœ… `dotnet sln add` - Add project to solution +- āœ… `dotnet add package` - Add NuGet packages +- āœ… `dotnet run` - Run the project +- āœ… `dotnet build` - Build the project +- āœ… `dotnet restore` - Restore dependencies +- āœ… `cd` - Change directory (to project folders only) +- āœ… `mkdir` - Create directories (for project structure) + +**Blocked Commands** (Dangerous): +- āŒ `rm -rf` / `del /f` - File deletion +- āŒ `format` / `mkfs` - Disk formatting +- āŒ `sudo` / `runas` - Privilege escalation +- āŒ `curl | bash` - Piped remote execution +- āŒ `chmod 777` - Permission changes +- āŒ `mv /system` - System file moves +- āŒ Any command not explicitly allowed + +**How It Works**: +```csharp +// Each command is matched against regex patterns +// Example from CommandValidator.cs: +patterns.Add(new Regex(@"^dotnet\s+new\s+sln")); +patterns.Add(new Regex(@"^dotnet\s+add.*package\s+[\w\.\-]+")); + +// If no pattern matches → command is blocked +``` + +--- + +### Q3: How can I verify the scripts are safe? + +**Four Ways to Verify**: + +**1. Read the Generated Script**: +```bash +# Generate without auto-run +psw -d -n MyProject -s MyProject -u \ + --database-type SQLite \ + --admin-email admin@test.com \ + --admin-password Pass123! + +# Output shows the full script +# Review every line before running +``` + +**2. Save to File**: +```bash +# Save to file for detailed review +psw -d -n MyProject -s MyProject -u \ + --database-type SQLite \ + --admin-email admin@test.com \ + --admin-password Pass123! \ + -o install-script.sh + +# Open in your editor +code install-script.sh +# or +vim install-script.sh +``` + +**3. Compare with Web Version**: +```bash +# CLI version +psw -d -n MyProject -s MyProject -u --database-type SQLite + +# Web version: https://psw.codeshare.co.uk +# Use same settings, compare output +# Should be identical +``` + +**4. Review Source Code**: +```bash +# Clone the repository +git clone https://github.com/prjseal/Package-Script-Writer.git + +# Review the validation logic +cat src/PackageCliTool/Validation/CommandValidator.cs + +# Review script generation logic +cat src/PSW.Shared/Services/ScriptGeneratorService.cs +``` + +--- + +### Q4: Does PSW collect my data? + +**No. Zero data collection.** + +**What PSW Does**: +- āœ… Generates scripts locally on your machine +- āœ… Caches package lists locally (in `~/.psw/cache/`) +- āœ… Saves history locally (in `~/.psw/history/`) +- āœ… Saves templates locally (in `~/.psw/templates/`) + +**What PSW Does NOT Do**: +- āŒ No telemetry sent to any server +- āŒ No analytics tracking +- āŒ No user identification +- āŒ No phone home +- āŒ No third-party tracking services +- āŒ No cloud storage of your data + +**Network Calls** (Only These): +1. **NuGet.org API** - To fetch package versions (same as `dotnet` CLI) +2. **Umbraco Marketplace API** - To fetch package list (public API) + +Both are read-only operations, no data sent about you. + +**Proof**: +```bash +# Monitor network activity while using PSW +# macOS/Linux: +sudo tcpdump -i any -n host api.nuget.org +sudo tcpdump -i any -n host marketplace.umbraco.com + +# You'll see GET requests only, no POST data +``` + +--- + +### Q5: Can PSW install malware? + +**No. Here's why:** + +**1. Packages Come from Trusted Sources**: +- NuGet.org (Microsoft's official package repository) +- Umbraco Marketplace (Umbraco HQ's official repository) +- No custom repositories +- No direct downloads from URLs + +**2. Same Packages as Manual Install**: +```bash +# PSW generates this: +dotnet add package uSync --version 17.0.0 + +# Which is identical to what you'd type manually +# Same source, same verification, same security +``` + +**3. Package Verification**: +- NuGet packages are signed by publishers +- Umbraco Marketplace packages are vetted +- Both use the same security as `dotnet` CLI + +**4. No Custom Executables**: +- PSW doesn't download or run custom executables +- Only uses the `dotnet` CLI that's already on your system +- No bundled binaries, no external scripts + +**If you're still concerned**: +- Research the packages before adding them (check NuGet, GitHub, ratings) +- Use `-o` to save the script, review package names +- Run packages through your own security scanning +- Same due diligence as any package installation + +--- + +### Q6: What if there's a bug in the validator? + +**Defense in Depth Approach:** + +**Layer 1: Code Review** +- Open source on GitHub +- Community can review and report issues +- Pull requests are reviewed before merge + +**Layer 2: Testing** +- Unit tests for validator logic +- Integration tests for script generation +- Manual testing before releases + +**Layer 3: User Control** +```bash +# You can always review before running +psw -d ... -o script.sh +cat script.sh # Manual inspection +bash script.sh # Run only if satisfied +``` + +**Layer 4: Standard Commands Only** +- Even if validator had a bug, scripts only use `dotnet` CLI +- No custom executables that could be malicious +- Worst case: invalid dotnet command that would fail + +**Layer 5: No Sudo Required** +- Everything runs in user space +- Can't modify system files without your permission +- Limited blast radius + +**Report Security Issues**: +If you find a security concern, report it: +- **Email**: [maintainer's email] +- **GitHub Issues**: https://github.com/prjseal/Package-Script-Writer/issues +- Mark as security issue for priority handling + +--- + +### Q7: Why should I trust PSW? + +**Trust Factors**: + +**1. Open Source** +- All code visible: https://github.com/prjseal/Package-Script-Writer +- MIT License - permissive and transparent +- No hidden functionality + +**2. Community Verified** +- [X] GitHub stars +- [Y] Contributors +- Used by developers worldwide +- Active issue tracking and resolution + +**3. Same as Website** +- CLI uses identical code as https://psw.codeshare.co.uk +- Website has been used by thousands of developers +- Proven track record + +**4. Standard Tooling** +- Only uses official `dotnet` CLI +- Only accesses official package repositories +- No proprietary or custom tooling + +**5. Transparent Operation** +- Use `--verbose` to see exactly what's happening +- All cache files are readable YAML/JSON +- History is stored in plain text + +**6. Your Control** +- You decide: auto-run vs. manual review +- You can modify generated scripts +- You can audit the source code +- No lock-in, no dependencies + +--- + +### Q8: How does PSW compare to running commands manually? + +**Security Comparison**: + +| Aspect | Manual Commands | PSW | +|--------|----------------|-----| +| Command Source | You type them | Generated & validated | +| Typo Risk | High | Zero (validated) | +| Dangerous Commands | Possible | Blocked by validator | +| Review Ability | Must remember each | Single script to review | +| Reproducibility | Hard to recreate | Saved in history | +| Transparency | As good as your memory | Fully documented | + +**PSW is actually SAFER than manual because**: +- You can't accidentally type a dangerous command +- The complete workflow is reviewable +- It's reproducible and auditable +- Validation prevents mistakes + +**Example**: +```bash +# Manual risk - typo disaster: +rm -rf / home/user/myproject # Oops, space after / + +# PSW - impossible: +# The validator would block any rm command +# Even if somehow generated, it wouldn't run +``` + +--- + +### Q9: What about the `--admin-password` in commands? + +**Concern**: Passwords in command history + +**Answer**: Valid concern - here's how to handle it: + +**Option 1: Use Environment Variables** (Not yet implemented): +```bash +# Feature request - vote for it on GitHub! +export UMBRACO_ADMIN_PASSWORD="SecurePass123!" +psw -d ... --admin-password-env UMBRACO_ADMIN_PASSWORD +``` + +**Option 2: Generate Without Password**: +```bash +# Generate script without unattended install +psw -d -n MyProject -s MyProject --database-type SQLite + +# Script will prompt for password during Umbraco setup +# No password in history +``` + +**Option 3: Edit the Script**: +```bash +# Generate with placeholder +psw -d ... -o script.sh + +# Edit the script +vim script.sh +# Replace password with secure value +# Run manually +bash script.sh +``` + +**Option 4: Clear History After**: +```bash +# Use the password +psw -d ... --admin-password "SecurePass123!" + +# Clear shell history immediately +history -c # bash +history clear # PowerShell +``` + +**Best Practice**: +- Use strong, unique passwords for demos +- Don't reuse production passwords in demos +- Consider the script as documentation, not secure storage + +--- + +### Q10: Can I use PSW in production? + +**Yes, with best practices:** + +**āœ… Good Use Cases**: +- **CI/CD Pipelines**: Reproducible, automated setups +- **Development Environments**: Fast, consistent provisioning +- **Team Onboarding**: Standardized configurations +- **Testing**: Spin up clean environments +- **Documentation**: Script serves as setup guide + +**Best Practices for Production Use**: + +**1. Version Pin Everything**: +```bash +# Specify exact versions for reproducibility +psw -d -n MyProject -s MyProject \ + -p "uSync|17.0.0,Umbraco.Forms|17.0.1" \ + --umbraco-version 17.0.0 +``` + +**2. Review Scripts Before Running**: +```bash +# Always review first +psw -d ... -o production-setup.sh +# Review, test in staging, then run in production +``` + +**3. Store Scripts in Version Control**: +```bash +# Commit generated scripts to Git +git add production-setup.sh +git commit -m "Umbraco production setup script" +# Track changes, review diffs +``` + +**4. Use Templates for Consistency**: +```bash +# Create team template +psw -d ... template save ProductionStandard +# Share with team via Git +# Load and use: psw template load ProductionStandard +``` + +**5. Separate Sensitive Data**: +```bash +# Don't commit passwords +# Use environment variables or secret management +# Load from Azure Key Vault, AWS Secrets Manager, etc. +``` + +**6. Test in Staging First**: +```bash +# Generate script +psw -d ... -o staging-setup.sh +# Run in staging environment +# Verify everything works +# Then use same script for production +``` + +--- + +## šŸ›”ļø Security Features Summary + +### What Makes PSW Secure + +| Feature | Benefit | +|---------|---------| +| **Open Source** | Transparent, auditable, community-reviewed | +| **Command Validation** | Blocks dangerous operations automatically | +| **Allowlist System** | Only approved commands can execute | +| **No Data Collection** | Complete privacy, no telemetry | +| **Local Operation** | Everything runs on your machine | +| **Standard Tools Only** | Uses official dotnet CLI | +| **User Control** | Choose automation level (auto vs manual) | +| **Reproducible** | History and templates ensure consistency | +| **No Sudo Required** | Limited permissions, user-space only | +| **Community Verified** | Active GitHub community, issue tracking | + +--- + +## šŸ“š Additional Resources + +### Security Documentation +- **Validator Source**: `src/PackageCliTool/Validation/CommandValidator.cs` +- **Security Guide**: `.github/cli/security.md` +- **GitHub Repo**: https://github.com/prjseal/Package-Script-Writer + +### Report Security Issues +- **GitHub Issues**: https://github.com/prjseal/Package-Script-Writer/issues +- Label: `security` +- Priority handling for security concerns + +### Community Discussion +- **GitHub Discussions**: Ask questions, share concerns +- **Open Issues**: Review existing security discussions + +--- + +## šŸ’” Security Tips for Users + +### Before First Use +1. āœ… Review the source code on GitHub +2. āœ… Read the CommandValidator.cs file +3. āœ… Star the repo to track updates +4. āœ… Check for recent security issues + +### During Use +1. āœ… Use `--verbose` to see what's happening +2. āœ… Review generated scripts before running +3. āœ… Start with `-o` until you're comfortable +4. āœ… Test in non-production environments first + +### Best Practices +1. āœ… Pin package versions for reproducibility +2. āœ… Store scripts in version control +3. āœ… Use templates for standardization +4. āœ… Review history before rerunning +5. āœ… Keep PSW updated for latest security fixes + +--- + +## šŸŽÆ Bottom Line + +**PSW is designed with security as a priority:** + +- **Transparent**: Open source, auditable code +- **Validated**: Strict command checking +- **Controlled**: You choose automation level +- **Trusted**: Same code as popular website +- **Standard**: Only uses official tools + +**You have three options:** + +1. **Trust & Automate**: Use `--auto-run` for speed (recommended after review) +2. **Verify Then Run**: Use `-o` to review before running (recommended for new users) +3. **Manual Control**: Copy output and run commands yourself + +**Choose what fits your security requirements and comfort level.** + +--- + +**Questions not answered here?** +- Open an issue: https://github.com/prjseal/Package-Script-Writer/issues +- Start a discussion: https://github.com/prjseal/Package-Script-Writer/discussions + +--- + +*Last Updated: 2024* +*For the latest security information, check the GitHub repository* diff --git a/prepare-demo.ps1 b/prepare-demo.ps1 new file mode 100644 index 0000000..153f024 --- /dev/null +++ b/prepare-demo.ps1 @@ -0,0 +1,285 @@ +# Package Script Writer CLI - Demo Preparation Script (PowerShell) +# Run this before your Umbraco Sydney meetup demo to ensure everything is ready + +$ErrorActionPreference = "Stop" + +Write-Host "šŸŽÆ Package Script Writer CLI - Demo Preparation" -ForegroundColor Cyan +Write-Host "==============================================" -ForegroundColor Cyan +Write-Host "" + +function Print-Success { + param([string]$Message) + Write-Host "āœ“ $Message" -ForegroundColor Green +} + +function Print-Warning { + param([string]$Message) + Write-Host "⚠ $Message" -ForegroundColor Yellow +} + +function Print-Error { + param([string]$Message) + Write-Host "āœ— $Message" -ForegroundColor Red +} + +function Print-Info { + param([string]$Message) + Write-Host "ℹ $Message" -ForegroundColor Blue +} + +function Print-Step { + param([string]$Message) + Write-Host "`nā–¶ $Message" -ForegroundColor Blue +} + +# Step 1: Check if PSW CLI is installed +Print-Step "Step 1: Checking PSW CLI installation..." +try { + $version = & psw --version 2>&1 | Select-Object -First 1 + Print-Success "PSW CLI is installed: $version" +} catch { + Print-Error "PSW CLI is not installed" + Write-Host "Install with: dotnet tool install -g PackageScriptWriter.Cli" + exit 1 +} + +# Step 2: Check .NET SDK +Print-Step "Step 2: Checking .NET SDK..." +try { + $dotnetVersion = & dotnet --version + Print-Success ".NET SDK is installed: $dotnetVersion" +} catch { + Print-Error ".NET SDK is not installed" + exit 1 +} + +# Step 3: Prime the cache +Print-Step "Step 3: Priming the package cache (this may take a moment)..." +Print-Info "This ensures the demo runs smoothly without API delays" + +# Clear existing cache first +try { + & psw --clear-cache | Out-Null + Print-Success "Cleared existing cache" +} catch { + # Ignore errors +} + +# Run a quick command to populate cache +Print-Info "Fetching package list..." +try { + $job = Start-Job -ScriptBlock { psw --default } + Wait-Job $job -Timeout 60 | Out-Null + Stop-Job $job -ErrorAction SilentlyContinue | Out-Null + Remove-Job $job -ErrorAction SilentlyContinue | Out-Null + Print-Success "Package cache primed" +} catch { + Print-Warning "Cache priming timed out (this is okay)" +} + +# Step 4: Create demo directory +Print-Step "Step 4: Setting up demo workspace..." +$demoDir = Join-Path $env:USERPROFILE "psw-demo-sydney" + +if (Test-Path $demoDir) { + Print-Warning "Demo directory already exists: $demoDir" + $response = Read-Host "Remove it and start fresh? (y/N)" + if ($response -eq 'y' -or $response -eq 'Y') { + Remove-Item -Path $demoDir -Recurse -Force + Print-Success "Removed old demo directory" + } +} + +if (-not (Test-Path $demoDir)) { + New-Item -ItemType Directory -Path $demoDir | Out-Null + Print-Success "Created demo directory: $demoDir" +} + +Set-Location $demoDir + +# Step 5: Generate sample scripts for backup +Print-Step "Step 5: Generating backup scripts..." + +# Generate a default script +Print-Info "Generating default script..." +try { + & psw --default > "$demoDir\backup-default-script.ps1" 2>&1 + if (Test-Path "$demoDir\backup-default-script.ps1") { + Print-Success "Default script saved: backup-default-script.ps1" + } +} catch { + Print-Warning "Could not generate default script (this is okay)" +} + +# Generate a full-featured script +Print-Info "Generating full-featured script..." +try { + & psw -p "uSync,Diplo.GodMode,Umbraco.Community.BlockPreview" ` + -n DemoProject -s DemoSolution -u ` + --database-type SQLite ` + --admin-email "admin@demo.com" ` + --admin-password "DemoPass123!" ` + --add-docker > "$demoDir\backup-full-script.ps1" 2>&1 + + if (Test-Path "$demoDir\backup-full-script.ps1") { + Print-Success "Full-featured script saved: backup-full-script.ps1" + } +} catch { + Print-Warning "Could not generate full script (this is okay)" +} + +# Step 6: Create a sample template +Print-Step "Step 6: Creating sample team template..." +try { + & psw -p "uSync|17.0.0,Diplo.GodMode" ` + -n SampleProject -s SampleSolution ` + -u --database-type SQLite ` + --admin-email "admin@company.com" ` + template save DemoTeamStandard ` + --template-description "Demo template for Sydney meetup" ` + --template-tags "demo,sydney,umbraco" | Out-Null + + $templateList = & psw template list 2>&1 + if ($templateList -match "DemoTeamStandard") { + Print-Success "Sample template created: DemoTeamStandard" + } else { + Print-Warning "Could not create sample template (this is okay)" + } +} catch { + Print-Warning "Could not create sample template (this is okay)" +} + +# Step 7: Populate history with some entries +Print-Step "Step 7: Populating history with sample entries..." +Print-Info "This will give you something to show in the history demo" + +for ($i = 1; $i -le 3; $i++) { + try { + & psw --default | Out-Null + } catch { + # Ignore errors + } +} + +try { + $historyList = & psw history list 2>&1 + $historyCount = ($historyList | Select-String "│").Count + if ($historyCount -gt 0) { + Print-Success "History populated with sample entries" + } else { + Print-Warning "Could not populate history (this is okay)" + } +} catch { + Print-Warning "Could not populate history (this is okay)" +} + +# Step 8: Test network connectivity +Print-Step "Step 8: Testing network connectivity..." +try { + $response = Invoke-WebRequest -Uri "https://marketplace.umbraco.com" -Method Head -UseBasicParsing -TimeoutSec 5 -ErrorAction Stop + Print-Success "Umbraco Marketplace is reachable" +} catch { + Print-Warning "Cannot reach Umbraco Marketplace (check your network)" +} + +try { + $response = Invoke-WebRequest -Uri "https://api.nuget.org" -Method Head -UseBasicParsing -TimeoutSec 5 -ErrorAction Stop + Print-Success "NuGet API is reachable" +} catch { + Print-Warning "Cannot reach NuGet API (check your network)" +} + +# Step 9: Create quick reference files +Print-Step "Step 9: Creating quick reference files..." + +$commandsContent = @" +Package Script Writer CLI - Demo Commands +========================================== + +SCENARIO 1: 30-Second Win +------------------------- +psw --default + +SCENARIO 2: Interactive Experience +----------------------------------- +psw +(Then navigate through the menus) + +SCENARIO 3: Power User +---------------------- +# Quick setup +psw -p "uSync|17.0.0,Diplo.GodMode" -n UmbracoSydney -s SydneyMeetup --database-type SQLite + +# Full automation +psw -p "uSync,Diplo.GodMode,Umbraco.Community.BlockPreview" `` + -n ProductionSite -s MySolution -u `` + --database-type SQLite `` + --admin-email "admin@example.com" `` + --admin-password "SecurePass123!" `` + --add-docker --auto-run + +# Client project +psw --template "Bootstrap Starter Kit" -p "uSync,Diplo.GodMode" `` + -n ClientWebsite -u --database-type SQLite `` + --admin-email "dev@agency.com" --admin-password "TempPass123!" `` + --auto-run + +SCENARIO 4: Team Templates +--------------------------- +psw template list +psw template load DemoTeamStandard +psw template load DemoTeamStandard -n NewProject --auto-run + +SCENARIO 5: History +------------------- +psw history list +psw history show 1 +psw history rerun 1 + +BONUS: Versions Table +--------------------- +psw versions +"@ + +$commandsContent | Out-File -FilePath "$demoDir\DEMO_COMMANDS.txt" -Encoding UTF8 +Print-Success "Created command reference: DEMO_COMMANDS.txt" + +# Step 10: System check summary +Print-Step "Step 10: Final system check..." + +Write-Host "" +Write-Host "================================" -ForegroundColor Green +Write-Host "Demo Preparation Complete! ✨" -ForegroundColor Green +Write-Host "================================" -ForegroundColor Green +Write-Host "" +Write-Host "Demo workspace: $demoDir" +Write-Host "" +Write-Host "Ready to demo:" -ForegroundColor Green +Print-Success "PSW CLI installed and working" +Print-Success "Package cache primed" +Print-Success "Backup scripts generated" +Print-Success "Sample template created" +Print-Success "History populated" +Print-Success "Quick reference created" +Write-Host "" + +Print-Info "Demo checklist:" +Write-Host " [ ] Terminal size is large enough (at least 120x30)" +Write-Host " [ ] Terminal colors are working" +Write-Host " [ ] Network connection is stable" +Write-Host " [ ] Demo commands ready: cat $demoDir\DEMO_COMMANDS.txt" +Write-Host " [ ] Backup scripts ready in: $demoDir" +Write-Host "" + +Print-Info "Optional: Test the interactive mode now" +Write-Host " cd $demoDir; psw" +Write-Host "" + +Print-Info "During demo, if anything fails:" +Write-Host " - Use backup scripts from: $demoDir" +Write-Host " - Show web version: https://psw.codeshare.co.uk" +Write-Host " - Show pre-generated history entries" +Write-Host "" + +Print-Success "Good luck with your demo! šŸš€" +Write-Host "" diff --git a/prepare-demo.sh b/prepare-demo.sh new file mode 100755 index 0000000..9fc5829 --- /dev/null +++ b/prepare-demo.sh @@ -0,0 +1,256 @@ +#!/bin/bash + +# Package Script Writer CLI - Demo Preparation Script +# Run this before your Umbraco Sydney meetup demo to ensure everything is ready + +set -e # Exit on error + +echo "šŸŽÆ Package Script Writer CLI - Demo Preparation" +echo "==============================================" +echo "" + +# Colors for output +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +RED='\033[0;31m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Function to print colored output +print_success() { + echo -e "${GREEN}āœ“${NC} $1" +} + +print_warning() { + echo -e "${YELLOW}⚠${NC} $1" +} + +print_error() { + echo -e "${RED}āœ—${NC} $1" +} + +print_info() { + echo -e "${BLUE}ℹ${NC} $1" +} + +print_step() { + echo -e "\n${BLUE}ā–¶${NC} $1" +} + +# Step 1: Check if PSW CLI is installed +print_step "Step 1: Checking PSW CLI installation..." +if command -v psw &> /dev/null; then + VERSION=$(psw --version 2>&1 | head -n 1) + print_success "PSW CLI is installed: $VERSION" +else + print_error "PSW CLI is not installed" + echo "Install with: dotnet tool install -g PackageScriptWriter.Cli" + exit 1 +fi + +# Step 2: Check .NET SDK +print_step "Step 2: Checking .NET SDK..." +if command -v dotnet &> /dev/null; then + DOTNET_VERSION=$(dotnet --version) + print_success ".NET SDK is installed: $DOTNET_VERSION" +else + print_error ".NET SDK is not installed" + exit 1 +fi + +# Step 3: Prime the cache +print_step "Step 3: Priming the package cache (this may take a moment)..." +print_info "This ensures the demo runs smoothly without API delays" + +# Clear existing cache first +psw --clear-cache > /dev/null 2>&1 || true +print_success "Cleared existing cache" + +# Run a quick command to populate cache +echo "Fetching package list..." +timeout 60s psw --default > /dev/null 2>&1 || true +print_success "Package cache primed" + +# Step 4: Create demo directory +print_step "Step 4: Setting up demo workspace..." +DEMO_DIR="$HOME/psw-demo-sydney" +if [ -d "$DEMO_DIR" ]; then + print_warning "Demo directory already exists: $DEMO_DIR" + read -p "Remove it and start fresh? (y/N): " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + rm -rf "$DEMO_DIR" + print_success "Removed old demo directory" + fi +fi + +if [ ! -d "$DEMO_DIR" ]; then + mkdir -p "$DEMO_DIR" + print_success "Created demo directory: $DEMO_DIR" +fi + +cd "$DEMO_DIR" + +# Step 5: Generate sample scripts for backup +print_step "Step 5: Generating backup scripts..." + +# Generate a default script +print_info "Generating default script..." +psw --default > "$DEMO_DIR/backup-default-script.sh" 2>&1 || true +if [ -f "$DEMO_DIR/backup-default-script.sh" ]; then + print_success "Default script saved: backup-default-script.sh" +fi + +# Generate a full-featured script +print_info "Generating full-featured script..." +psw -p "uSync,Diplo.GodMode,Umbraco.Community.BlockPreview" \ + -n DemoProject -s DemoSolution -u \ + --database-type SQLite \ + --admin-email "admin@demo.com" \ + --admin-password "DemoPass123!" \ + --add-docker > "$DEMO_DIR/backup-full-script.sh" 2>&1 || true + +if [ -f "$DEMO_DIR/backup-full-script.sh" ]; then + print_success "Full-featured script saved: backup-full-script.sh" +fi + +# Step 6: Create a sample template +print_step "Step 6: Creating sample team template..." +psw -p "uSync|17.0.0,Diplo.GodMode" \ + -n SampleProject -s SampleSolution \ + -u --database-type SQLite \ + --admin-email "admin@company.com" \ + template save DemoTeamStandard \ + --template-description "Demo template for Sydney meetup" \ + --template-tags "demo,sydney,umbraco" > /dev/null 2>&1 || true + +if psw template list 2>&1 | grep -q "DemoTeamStandard"; then + print_success "Sample template created: DemoTeamStandard" +else + print_warning "Could not create sample template (this is okay)" +fi + +# Step 7: Populate history with some entries +print_step "Step 7: Populating history with sample entries..." +print_info "This will give you something to show in the history demo" + +# Generate a few scripts to populate history +for i in {1..3}; do + psw --default > /dev/null 2>&1 || true +done + +HISTORY_COUNT=$(psw history list 2>&1 | grep -c "│" || echo "0") +if [ "$HISTORY_COUNT" -gt "0" ]; then + print_success "History populated with sample entries" +else + print_warning "Could not populate history (this is okay)" +fi + +# Step 8: Test network connectivity +print_step "Step 8: Testing network connectivity..." +if curl -s --head --request GET https://marketplace.umbraco.com > /dev/null; then + print_success "Umbraco Marketplace is reachable" +else + print_warning "Cannot reach Umbraco Marketplace (check your network)" +fi + +if curl -s --head --request GET https://api.nuget.org > /dev/null; then + print_success "NuGet API is reachable" +else + print_warning "Cannot reach NuGet API (check your network)" +fi + +# Step 9: Create quick reference files +print_step "Step 9: Creating quick reference files..." + +cat > "$DEMO_DIR/DEMO_COMMANDS.txt" << 'EOF' +Package Script Writer CLI - Demo Commands +========================================== + +SCENARIO 1: 30-Second Win +------------------------- +psw --default + +SCENARIO 2: Interactive Experience +----------------------------------- +psw +(Then navigate through the menus) + +SCENARIO 3: Power User +---------------------- +# Quick setup +psw -p "uSync|17.0.0,Diplo.GodMode" -n UmbracoSydney -s SydneyMeetup --database-type SQLite + +# Full automation +psw -p "uSync,Diplo.GodMode,Umbraco.Community.BlockPreview" \ + -n ProductionSite -s MySolution -u \ + --database-type SQLite \ + --admin-email "admin@example.com" \ + --admin-password "SecurePass123!" \ + --add-docker --auto-run + +# Client project +psw --template "Bootstrap Starter Kit" -p "uSync,Diplo.GodMode" \ + -n ClientWebsite -u --database-type SQLite \ + --admin-email "dev@agency.com" --admin-password "TempPass123!" \ + --auto-run + +SCENARIO 4: Team Templates +--------------------------- +psw template list +psw template load DemoTeamStandard +psw template load DemoTeamStandard -n NewProject --auto-run + +SCENARIO 5: History +------------------- +psw history list +psw history show 1 +psw history rerun 1 + +BONUS: Versions Table +--------------------- +psw versions + +EOF + +print_success "Created command reference: DEMO_COMMANDS.txt" + +# Step 10: System check summary +print_step "Step 10: Final system check..." + +echo "" +echo "================================" +echo "Demo Preparation Complete! ✨" +echo "================================" +echo "" +echo "Demo workspace: $DEMO_DIR" +echo "" +echo "Ready to demo:" +print_success "PSW CLI installed and working" +print_success "Package cache primed" +print_success "Backup scripts generated" +print_success "Sample template created" +print_success "History populated" +print_success "Quick reference created" +echo "" + +print_info "Demo checklist:" +echo " [ ] Terminal size is large enough (at least 120x30)" +echo " [ ] Terminal colors are working" +echo " [ ] Network connection is stable" +echo " [ ] Demo commands ready: cat $DEMO_DIR/DEMO_COMMANDS.txt" +echo " [ ] Backup scripts ready in: $DEMO_DIR" +echo "" + +print_info "Optional: Test the interactive mode now" +echo " cd $DEMO_DIR && psw" +echo "" + +print_info "During demo, if anything fails:" +echo " - Use backup scripts from: $DEMO_DIR" +echo " - Show web version: https://psw.codeshare.co.uk" +echo " - Show pre-generated history entries" +echo "" + +print_success "Good luck with your demo! šŸš€" +echo ""