Interactive command-line tool for generating Umbraco CMS installation scripts
Quick Start · Features · Installation · Usage · Contributing
- Overview
- Quick Start
- Features
- Installation
- Usage
- Documentation
- Contributing
- Reporting Issues
- Support & Community
- License
The Package Script Writer CLI (psw) is a powerful command-line tool that brings the full functionality of the Package Script Writer to your terminal. Built with .NET 10.0 and Spectre.Console, it provides a beautiful, interactive experience for generating Umbraco CMS installation scripts.
- 🚀 Speed - Generate scripts faster than using the web interface
- 🤖 Automation - Perfect for CI/CD pipelines and automated workflows
- 💾 Templates - Save and reuse configurations across projects
- 📊 History - Track all generated scripts automatically
- 🔒 Security - Built-in command validation and secure input handling
- 🎨 Beautiful UI - Rich terminal interface with colors, tables, and progress indicators
- Developers who prefer the command line
- CI/CD automation and scripting
- Team standardization with reusable templates
- Quick project setup workflows
- Batch script generation
Get up and running in seconds:
# Install the tool globally from NuGet
dotnet tool install --global PackageScriptWriter.Cli
# Launch interactive mode
psw
# Or generate a default script immediately
psw --default
# Or automate with specific packages
psw -p "uSync,Diplo.GodMode" -n MyProjectThat's it! You're ready to generate Umbraco installation scripts.
Interactive Mode - Beautiful terminal UI with step-by-step prompts:
- Browse and search 500+ Umbraco Marketplace packages
- Multi-select package picker with search functionality
- Version selection for templates and packages
- Complete configuration workflow with validation
- Live progress indicators during API calls
- Configuration summary before generation
CLI Mode - Full automation with command-line flags:
- All configuration options available as flags
- Perfect for scripts and CI/CD pipelines
- One-liner script generation
- Auto-execution capabilities
- Batch processing support
Generate complete, production-ready installation scripts:
- Template Installation - Umbraco official and community templates
- Project Creation - With solution file support
- Package Management - Install with specific version pinning
- Starter Kits - Choose from 9 different starter kits
- Docker Support - Generate Dockerfile and Docker Compose files
- Unattended Install - Pre-configure database and admin credentials
- Database Setup - Support for SQLite, LocalDb, SQL Server, SQL Azure
- Output Formats - Multi-line or one-liner with comment removal
Save time with reusable configuration templates:
- Save - Create templates from any configuration
- Load - Quickly apply saved templates with optional overrides
- Export/Import - Share templates with your team via YAML files
- Validation - Built-in template validation before import
- Organization - Tag and describe templates for easy discovery
Automatic tracking of all generated scripts:
- View History - See all previously generated scripts
- Re-run - Regenerate and execute previous scripts
- Execution Tracking - Track which scripts were executed and their status
- Audit Trail - Complete record of all script generations
- Search & Filter - Find scripts by project name, template, or date
Built-in security to protect your systems:
- Command Allowlist - Only approved dotnet commands can be executed
- Validation - All scripts validated before execution
- Secure Input - Password fields are hidden during input
- No Script Storage - Scripts regenerated from config (prevents tampering)
- Safe Defaults - Secure configurations by default
📖 Read the Security Documentation
Enterprise-grade reliability:
- Automatic Retries - Exponential backoff with Polly for transient failures
- Comprehensive Logging - File and console logging with Serilog
- Verbose Mode - Detailed diagnostics with
--verboseflag - Error Handling - User-friendly error messages with guidance
- API Resilience - Graceful handling of API timeouts and failures
The easiest way to install the CLI tool is from NuGet as a global .NET tool:
# Install globally
dotnet tool install --global PackageScriptWriter.Cli
# Verify installation
psw --versionUpdate to the latest version:
dotnet tool update --global PackageScriptWriter.CliUpdate to the latest prerelease version:
dotnet tool update --global PackageScriptWriter.Cli --prereleaseUpdate to a specific version:
dotnet tool update --global PackageScriptWriter.Cli --version 1.2.0Uninstall:
dotnet tool uninstall --global PackageScriptWriter.Cli- .NET 10.0 SDK or later (Download)
- Internet connection (to fetch package information from Umbraco Marketplace)
For development or contributing:
-
Clone the repository:
git clone https://github.com/prjseal/Package-Script-Writer.git cd Package-Script-Writer -
Build and pack:
cd src dotnet pack PackageCliTool -c Release -
Install from local package:
dotnet tool install --global --add-source ./PackageCliTool/bin/Release PackageScriptWriter.Cli
-
Run:
psw
The CLI tool supports two modes of operation: Interactive Mode and CLI Mode.
Launch the interactive terminal UI with a menu-driven interface:
pswMain Menu Options:
- Use default script - Quick setup with sensible defaults
- Use local template - Load a saved template
- Use community template - Browse community-shared templates
- Load script from history - Re-run previous scripts
- Create new script - Full custom configuration
- Load Umbraco versions table - View version information
- Help - Display help information
📖 Complete Interactive Mode Guide
Use command-line flags for automation and scripting:
# Generate default script
psw --default
# Custom script with packages (latest versions)
psw -p "uSync,Diplo.GodMode" -n MyProject
# Specific package versions
psw -p "uSync|17.0.0,clean|7.0.1" -n MyProject
# Full automation with unattended install
psw -p "uSync|17.0.0" -n MyProject -s MySolution \
-u --database-type SQLite \
--admin-email admin@test.com \
--admin-password "SecurePass123!" \
--auto-run
# Auto-run with build only (no server start)
psw -d -n MyProject -s MyProject \
-u --database-type SQLite \
--admin-email admin@test.com \
--admin-password "SecurePass123!" \
--auto-run --build-only
# Save script to file without interactive prompts (for programmatic use)
psw -d -n MyProject -s MyProject \
-u --database-type SQLite \
--admin-email admin@test.com \
--admin-password "SecurePass123!" \
-p "Umbraco.Forms" \
--output-file install.sh --save-onlypsw --help # Show help information
psw --version # Show version number
psw versions # Display Umbraco versions table
psw --default # Generate default script-p, --packages # Packages: "pkg1|ver1,pkg2|ver2"
-t, --template-package # Template package name and version
-n, --project-name # Project name (default: MyProject)
-s, --solution # Solution name
-k, --starter-kit # Starter kit package name--dockerfile # Include Dockerfile
--docker-compose # Include Docker Compose file-u, --unattended-defaults # Use unattended install
--database-type # SQLite, LocalDb, SQLServer, etc.
--connection-string # Database connection string
--admin-name # Admin user name
--admin-email # Admin email address
--admin-password # Admin password (min 10 chars)-o, --oneliner # Output as one-liner
-r, --remove-comments # Remove comments from script
--include-prerelease # Include prerelease package versions
--verbose # Enable verbose logging--auto-run # Automatically execute the generated script
--build-only # Install and build without starting the web server
--run-dir # Directory to run script in
--output-file <file> # Output file path for saving the generated script
--save-only # Save script to file (via --output-file) and exit without prompts--output <format> # Output format: json, plain (for machine consumption)
--script-only # Output only the raw script text, no decoration
--no-interaction # Suppress all interactive prompts
--dry-run # Validate inputs and show config without generating script
--help-json # Show all commands and options as structured JSON# Generate script as JSON (for programmatic use)
psw --default --output json
# Generate script with no decoration (pipe-friendly)
psw --default --script-only
# Validate config without generating (dry run)
psw --dry-run -p "uSync|17.0.0" --database-type SQLite
# Get help as JSON (for AI tool discovery)
psw --help-json
# List valid option values as JSON
psw list-options --output json
# List valid database types
psw list-options database-types
# Non-interactive mode (no prompts)
psw --default --no-interaction --script-only
# Save script to file (no prompts, for MCP/CI/CD)
psw --default -p "uSync" --output-file install.sh --save-only
# Get version as plain text
psw --version --output plainExit Codes (for scripting and automation):
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General or unknown error |
| 2 | Validation error |
| 3 | Network or API error |
| 4 | Script execution error |
| 5 | File system or permission error |
# Update to the latest stable release
dotnet tool update --global PackageScriptWriter.Cli
# Update to the latest prerelease version
dotnet tool update --global PackageScriptWriter.Cli --prerelease
# Update to a specific version
dotnet tool update --global PackageScriptWriter.Cli --version 1.2.0
# Check current version
psw --versionpsw template save <name> [options] # Save configuration as template
psw template load <name> [options] # Load and execute template
psw template list # List all templates
psw template delete <name> # Delete template
psw template export <name> # Export template to YAML
psw template import <file> # Import template from YAML
psw template validate <file> # Validate template filepsw history list # List recent script generations
psw history show <#> # Show details of specific entry
psw history rerun <#> # Re-run a previous script
psw history delete <#> # Delete history entry
psw history clear # Clear all historyComprehensive documentation is available for all aspects of the CLI tool:
| Document | Description |
|---|---|
| README | Complete CLI tool documentation with all features and options |
| Interactive Mode Guide | Complete interactive mode walkthrough with all menu options |
| Release Notes | Version history and changelog |
| Templates Guide | Template system documentation with examples |
| History System | History feature documentation (psw history commands) |
| Security Guide | Security features and command allowlist documentation |
| Community Templates | Using and creating community-shared templates |
| Default Script Guide | Quick default script generation |
| Custom Script Guide | Building fully customized scripts |
| Umbraco Versions | Umbraco version reference and support timelines |
| Document | Description |
|---|---|
| API Reference | REST API endpoints used by the CLI |
| Architecture | System architecture and design patterns |
| Development Guide | Setup, testing, and contributing guidelines |
- Package on NuGet: nuget.org/packages/PackageScriptWriter.Cli
- Web Application: psw.codeshare.co.uk
- Main Repository: github.com/prjseal/Package-Script-Writer
- Umbraco Marketplace: marketplace.umbraco.com
We welcome contributions to the Package Script Writer CLI! Whether it's bug fixes, new features, documentation improvements, or testing, all contributions are appreciated.
- Check Existing Issues - Browse GitHub Issues to see if your idea already exists
- Open a Discussion - For new features, open an issue first to discuss the approach
- Fork the Repository - Create your own fork to work in
- Create a Branch - Use descriptive branch names (e.g.,
feature/template-validation) - Make Your Changes - Follow the existing code style and patterns
- Test Thoroughly - Ensure your changes work as expected
- Submit a Pull Request - Provide a clear description of your changes
# Clone the repository
git clone https://github.com/prjseal/Package-Script-Writer.git
cd Package-Script-Writer
# Navigate to CLI project
cd src/PackageCliTool
# Run the CLI in development
dotnet run
# Run with arguments
dotnet run -- --help
dotnet run -- -p "uSync" -n TestProject
# Build and pack
dotnet pack -c Release
# Run tests (if available)
dotnet test- Follow C# conventions - Use standard C# naming and formatting
- Keep it modular - Separate concerns into appropriate services and classes
- Add comments - Document complex logic and public APIs
- Handle errors gracefully - Provide user-friendly error messages
- Test your changes - Ensure nothing breaks and new features work correctly
- 🐛 Bug Fixes - Report or fix issues you encounter
- ✨ New Features - Add new capabilities to the CLI
- 📖 Documentation - Improve or expand documentation
- 🧪 Testing - Add unit tests and integration tests
- 🎨 UI/UX - Enhance the terminal interface
- 🌍 Localization - Add support for other languages
Found a bug or have a feature request? We want to hear from you!
- Check Existing Issues - Search GitHub Issues to avoid duplicates
- Try Latest Version - Update to the latest version:
dotnet tool update --global PackageScriptWriter.Cli - Enable Verbose Logging - Run with
--verboseflag to get detailed diagnostic output - Check Log Files - Review logs in
logs/psw-cli-{Date}.log
Create a new issue on GitHub with the following information:
For Bugs:
- Description - Clear description of the problem
- Steps to Reproduce - Exact steps to reproduce the issue
- Expected Behavior - What should happen
- Actual Behavior - What actually happens
- Environment - OS, .NET version, CLI tool version
- Logs - Relevant log entries (use verbose mode)
- Screenshots - If UI-related, include screenshots
For Feature Requests:
- Description - Clear description of the feature
- Use Case - Why is this feature needed?
- Proposed Solution - How should it work?
- Alternatives - Any alternative approaches considered?
For Security Issues:
- DO NOT open a public issue for security vulnerabilities
- Report privately via GitHub Security Advisories
- See Security Policy
When creating an issue on GitHub, select the appropriate template:
- 🐛 Bug Report - For reporting bugs and errors
- ✨ Feature Request - For suggesting new features
- 📖 Documentation - For documentation improvements
- 🔒 Security Issue - For reporting security vulnerabilities (use private advisory)
- Documentation - Check this documentation and the README
- GitHub Issues - Search existing issues or create a new one
- GitHub Discussions - Ask questions and share ideas
- Umbraco Community - Connect with other Umbraco developers
Common Issues:
Tool not found after installation:
# Ensure .NET tools path is in your PATH
# Linux/macOS: Add to ~/.bashrc or ~/.zshrc
export PATH="$PATH:$HOME/.dotnet/tools"
# Windows: Usually added automatically, or add manually:
# %USERPROFILE%\.dotnet\toolsPackage not found:
- Verify package name is correct
- Check internet connectivity
- Try with
--verboseflag for detailed API logs - Ensure package exists on NuGet or Umbraco Marketplace
API connection issues:
- The API is only used for fetching package data
- Script generation is performed locally
- Check logs in
logs/directory - The tool automatically retries failed requests 3 times
Enable verbose logging:
# Option 1: Flag
psw --verbose
# Option 2: Environment variable
export PSW_VERBOSE=1 # Linux/macOS
set PSW_VERBOSE=1 # Windows CMD
$env:PSW_VERBOSE=1 # Windows PowerShell- Umbraco Documentation: docs.umbraco.com
- Umbraco Community: community.umbraco.com
- Umbraco Marketplace: marketplace.umbraco.com
This project is licensed under the MIT License - see the LICENSE file for details.
The CLI tool uses several open-source libraries:
- Spectre.Console - MIT License
- Serilog - Apache License 2.0
- Polly - BSD 3-Clause License
- YamlDotNet - MIT License
Paul Seal
- Website: codeshare.co.uk
- Twitter: @codeshare
- GitHub: @prjseal
- Umbraco Community - For the amazing CMS and package ecosystem
- Microsoft - For .NET and excellent tooling
- Spectre.Console - For the beautiful terminal UI library
- Contributors - Everyone who has contributed to this project
- Beta Testers - Thank you for testing and providing feedback!
⭐ If this tool helps you, consider giving it a star! ⭐
Made with ❤️ for the Umbraco Community