package-script-writer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePackage Script Writer (psw)
Package Script Writer(psw)
Generate and run Umbraco CMS installation scripts using the CLI tool.
psw使用 CLI工具生成并运行Umbraco CMS安装脚本。
pswWorkflow
操作流程
-
Check if PSW CLI is installed:bash
psw --versionIf command not found, the .NET tools path may not be in PATH. Try:- Linux/Mac:
export PATH="$PATH:$HOME/.dotnet/tools" && psw --version - Windows:
%USERPROFILE%\.dotnet\tools\psw --version
- Linux/Mac:
-
If not installed, install it:bash
dotnet tool install --global PackageScriptWriter.Cli -
Then run the psw command (see below)
-
检查PSW CLI是否已安装:bash
psw --version如果未找到该命令,可能是.NET工具路径未添加到PATH中。尝试:- Linux/Mac:
export PATH="$PATH:$HOME/.dotnet/tools" && psw --version - Windows:
%USERPROFILE%\.dotnet\tools\psw --version
- Linux/Mac:
-
如果未安装,请进行安装:bash
dotnet tool install --global PackageScriptWriter.Cli -
然后运行psw命令(见下文)
Non-Interactive Usage (Claude Code)
非交互式使用(Claude Code)
This is the command to use:
bash
export PATH="$PATH:$HOME/.dotnet/tools"
psw -d -n ProjectName -s ProjectName -u --database-type SQLite --admin-email admin@test.com --admin-password SecurePass1234 --auto-runRun this with since Umbraco is a long-running web server.
run_in_background: trueCritical flags:
- - REQUIRED - generates the full installation script (without this, only
-dis generated which fails)dotnet run - - use unattended install defaults
-u - - execute the script immediately
--auto-run - Never combine with
-o(truncates the script)--auto-run
Default credentials: /
admin@test.comSecurePass1234要使用的命令:
bash
export PATH="$PATH:$HOME/.dotnet/tools"
psw -d -n ProjectName -s ProjectName -u --database-type SQLite --admin-email admin@test.com --admin-password SecurePass1234 --auto-run请在的情况下运行此命令,因为Umbraco是长期运行的Web服务器。
run_in_background: true关键参数:
- - 必填 - 生成完整的安装脚本(如果没有此参数,仅会生成
-d,这会导致执行失败)dotnet run - - 使用无人值守安装默认值
-u - - 立即执行生成的脚本
--auto-run - 切勿将与
-o组合使用(会截断脚本)--auto-run
默认凭据: /
admin@test.comSecurePass1234With Packages
安装扩展包
bash
psw -d -n ProjectName -s ProjectName -u --database-type SQLite --admin-email admin@test.com --admin-password "SecurePass1234" -p "uSync,Umbraco.Forms" --auto-runWith specific versions:
bash
psw -d -n ProjectName -s ProjectName -u --database-type SQLite --admin-email admin@test.com --admin-password "SecurePass1234" -p "uSync|17.0.0,Umbraco.Forms|17.0.1" --auto-runbash
psw -d -n ProjectName -s ProjectName -u --database-type SQLite --admin-email admin@test.com --admin-password "SecurePass1234" -p "uSync,Umbraco.Forms" --auto-run指定版本的情况:
bash
psw -d -n ProjectName -s ProjectName -u --database-type SQLite --admin-email admin@test.com --admin-password "SecurePass1234" -p "uSync|17.0.0,Umbraco.Forms|17.0.1" --auto-runIMPORTANT
重要提示
Do not use characters that are escapable in passwords or usernames
请勿在密码或用户名中使用可转义的字符
Key Options
主要选项
| Flag | Description |
|---|---|
| REQUIRED - generates full installation script |
| Project name |
| Solution name |
| Use unattended install defaults |
| SQLite, LocalDb, SQLServer, SQLAzure, SQLCE |
| Admin email for unattended install |
| Admin password for unattended install |
| Execute the generated script |
| Comma-separated packages (e.g., "uSync,Umbraco.Forms") |
| Umbraco template with optional version |
| Enable Content Delivery API |
| 参数 | 描述 |
|---|---|
| 必填 - 生成完整的安装脚本 |
| 项目名称 |
| 解决方案名称 |
| 使用无人值守安装默认值 |
| SQLite, LocalDb, SQLServer, SQLAzure, SQLCE |
| 无人值守安装的管理员邮箱 |
| 无人值守安装的管理员密码 |
| 执行生成的脚本 |
| 逗号分隔的扩展包(例如:"uSync,Umbraco.Forms") |
| Umbraco模板(可指定版本) |
| 启用内容交付API |
Waiting for Umbraco to Start
等待Umbraco启动
After running the command in background, poll for readiness:
bash
undefined在后台运行命令后,轮询检查服务是否就绪:
bash
undefinedCheck the output for the port number (e.g., "Now listening on: https://localhost:44356")
检查输出中的端口号(例如:"Now listening on: https://localhost:44356")
Then poll until ready:
然后轮询直到就绪:
for i in {1..30}; do
if nc -z localhost 44356 2>/dev/null; then
echo "Umbraco is ready!"
break
fi
sleep 2
done
undefinedfor i in {1..30}; do
if nc -z localhost 44356 2>/dev/null; then
echo "Umbraco is ready!"
break
fi
sleep 2
done
undefinedOther Commands
其他命令
bash
psw versions # Show Umbraco versions with support status
psw history list # Show recent scripts
psw history rerun 1 # Re-run script #1
psw --clear-cache # Clear cached API responsesbash
psw versions # 显示Umbraco版本及支持状态
psw history list # 显示最近生成的脚本
psw history rerun 1 # 重新运行编号为1的脚本
psw --clear-cache # 清除缓存的API响应