msstore-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMicrosoft Store Developer CLI (msstore)
Microsoft Store Developer CLI (msstore)
The Microsoft Store Developer CLI () is a cross-platform command-line interface for publishing and managing applications in the Microsoft Store. It integrates with Partner Center APIs and supports automated publishing workflows for various application types.
msstoreMicrosoft Store Developer CLI()是一款跨平台命令行工具,用于在Microsoft Store中发布和管理应用。它对接了Partner Center API,支持多种应用类型的自动化发布工作流。
msstoreWhen to Use This Skill
何时使用该工具
Use this skill when you need to:
- Configure Store credentials for API access
- List applications in your Store account
- Check the status of a submission
- Publish submissions to the Store
- Package applications for Store submission
- Initialize projects for Store publishing
- Manage package flights (beta testing)
- Set up CI/CD pipelines for automated Store publishing
- Manage gradual rollouts of submissions
- Update submission metadata programmatically
当你需要完成以下操作时可以使用本工具:
- 配置用于API访问的商店凭证
- 列出你的商店账户中的应用
- 检查提交状态
- 向商店发布提交内容
- 打包应用用于商店提交
- 初始化项目以便发布到商店
- 管理包航班(beta测试)
- 配置CI/CD流水线实现自动发布到商店
- 管理提交内容的灰度发布
- 通过编程方式更新提交元数据
Prerequisites
前置要求
- Windows 10+, macOS, or Linux
- .NET 9 Desktop Runtime (Windows) or .NET 9 Runtime (macOS/Linux)
- Partner Center account with appropriate permissions
- Azure AD app registration with Partner Center API access
- msstore CLI installed via one of these methods:
- Microsoft Store: Download
- WinGet:
winget install "Microsoft Store Developer CLI" - Manual: Download from GitHub Releases
- Windows 10+、macOS或Linux系统
- .NET 9 桌面运行时(Windows)或 .NET 9 运行时(macOS/Linux)
- 拥有对应权限的Partner Center账户
- 具备Partner Center API访问权限的Azure AD应用注册
- 通过以下任意一种方式安装msstore CLI:
- Microsoft Store: 下载
- WinGet:
winget install "Microsoft Store Developer CLI" - 手动安装: 从GitHub Releases下载
Partner Center Setup
Partner Center配置
Before using msstore, you need to create an Azure AD application with Partner Center access:
- Go to Partner Center
- Navigate to Account settings > User management > Azure AD applications
- Create a new application and note the Tenant ID, Client ID, and Client Secret
- Grant the application appropriate permissions (Manager or Developer role)
使用msstore之前,你需要创建一个有权限访问Partner Center的Azure AD应用:
- 访问Partner Center
- 进入 账户设置 > 用户管理 > Azure AD应用
- 创建新应用,记录好 租户ID(Tenant ID)、客户端ID(Client ID)和客户端密钥(Client Secret)
- 为应用授予对应权限(管理员或开发者角色)
Core Commands Reference
核心命令参考
info - Print Configuration
info - 打印配置信息
Display the current credential configuration.
bash
msstore infoOptions:
| Option | Description |
|---|---|
| Print verbose output |
展示当前的凭证配置。
bash
msstore info选项:
| 选项 | 描述 |
|---|---|
| 打印详细输出 |
reconfigure - Configure Credentials
reconfigure - 配置凭证
Configure or update Microsoft Store API credentials.
bash
msstore reconfigure [options]Options:
| Option | Description |
|---|---|
| Azure AD Tenant ID |
| Partner Center Seller ID |
| Azure AD Application Client ID |
| Client Secret for authentication |
| Certificate thumbprint (alternative to client secret) |
| Certificate file path (alternative to client secret) |
| Certificate password |
| Reset credentials without full reconfiguration |
Examples:
bash
undefined配置或更新Microsoft Store API凭证。
bash
msstore reconfigure [options]选项:
| 选项 | 描述 |
|---|---|
| Azure AD租户ID |
| Partner Center卖家ID |
| Azure AD应用客户端ID |
| 用于身份验证的客户端密钥 |
| 证书指纹(可替代客户端密钥) |
| 证书文件路径(可替代客户端密钥) |
| 证书密码 |
| 无需完整重新配置即可重置凭证 |
示例:
bash
undefinedConfigure with client secret
使用客户端密钥配置
msstore reconfigure --tenantId $TENANT_ID --sellerId $SELLER_ID --clientId $CLIENT_ID --clientSecret $CLIENT_SECRET
msstore reconfigure --tenantId $TENANT_ID --sellerId $SELLER_ID --clientId $CLIENT_ID --clientSecret $CLIENT_SECRET
Configure with certificate
使用证书配置
msstore reconfigure --tenantId $TENANT_ID --sellerId $SELLER_ID --clientId $CLIENT_ID --certificateFilePath ./cert.pfx --certificatePassword MyPassword
undefinedmsstore reconfigure --tenantId $TENANT_ID --sellerId $SELLER_ID --clientId $CLIENT_ID --certificateFilePath ./cert.pfx --certificatePassword MyPassword
undefinedsettings - CLI Settings
settings - CLI设置
Change settings of the Microsoft Store Developer CLI.
bash
msstore settings [options]Options:
| Option | Description |
|---|---|
| Enable (true) or disable (false) telemetry |
修改Microsoft Store Developer CLI的设置。
bash
msstore settings [options]选项:
| 选项 | 描述 |
|---|---|
| 开启(true)或关闭(false)遥测 |
Set Publisher Display Name
设置发布者显示名称
bash
msstore settings setpdn <publisherDisplayName>Sets the default Publisher Display Name for the command.
initbash
msstore settings setpdn <publisherDisplayName>为命令设置默认发布者显示名称。
initapps - Application Management
apps - 应用管理
List and retrieve application information.
列出和查询应用信息。
List Applications
列出应用
bash
msstore apps listLists all applications in your Partner Center account.
bash
msstore apps list列出你Partner Center账户中的所有应用。
Get Application Details
获取应用详情
bash
msstore apps get <productId>Arguments:
| Argument | Description |
|---|---|
| The Store product ID (e.g., 9NBLGGH4R315) |
Example:
bash
undefinedbash
msstore apps get <productId>参数:
| 参数 | 描述 |
|---|---|
| 商店产品ID(例如9NBLGGH4R315) |
示例:
bash
undefinedGet details of a specific app
获取指定应用的详情
msstore apps get 9NBLGGH4R315
undefinedmsstore apps get 9NBLGGH4R315
undefinedsubmission - Submission Management
submission - 提交管理
Manage Store submissions.
| Sub-Command | Description |
|---|---|
| Get submission status |
| Get submission metadata and package info |
| Get listing assets of a submission |
| Update submission metadata |
| Poll submission status until complete |
| Publish a submission |
| Delete a submission |
管理商店提交内容。
| 子命令 | 描述 |
|---|---|
| 获取提交状态 |
| 获取提交元数据和包信息 |
| 获取提交的上架资源 |
| 更新提交元数据 |
| 轮询提交状态直到完成 |
| 发布提交内容 |
| 删除提交内容 |
Get Submission Status
获取提交状态
bash
msstore submission status <productId>bash
msstore submission status <productId>Get Submission Details
获取提交详情
bash
msstore submission get <productId>bash
msstore submission get <productId>Update Metadata
更新元数据
bash
msstore submission updateMetadata <productId> <metadata>Where is a JSON string with the updated metadata. Because JSON contains characters that shells interpret (quotes, braces, etc.), you must quote and/or escape the value appropriately:
<metadata>- Bash/Zsh: Wrap the JSON in single quotes so the shell passes it through literally.
bash
msstore submission updateMetadata 9NBLGGH4R315 '{"description":"My updated app"}' - PowerShell: Use single quotes (or escape double quotes inside a double-quoted string).
powershell
msstore submission updateMetadata 9NBLGGH4R315 '{"description":"My updated app"}' - cmd.exe: Escape each inner double quote with a backslash.
cmd
msstore submission updateMetadata 9NBLGGH4R315 "{\"description\":\"My updated app\"}"
Tip: For complex or multi-line metadata, save the JSON to a file and pass its contents instead to avoid quoting issues:bashmsstore submission updateMetadata 9NBLGGH4R315 "$(cat metadata.json)"
Options:
| Option | Description |
|---|---|
| Skip initial status polling |
bash
msstore submission updateMetadata <productId> <metadata>其中是包含更新后元数据的JSON字符串。由于JSON包含会被shell解析的字符(引号、大括号等),你需要对值进行适当的引号包裹和/或转义:
<metadata>- Bash/Zsh: 用单引号包裹JSON,这样shell会直接传递原内容。
bash
msstore submission updateMetadata 9NBLGGH4R315 '{"description":"My updated app"}' - PowerShell: 使用单引号(或者在双引号字符串中转义双引号)。
powershell
msstore submission updateMetadata 9NBLGGH4R315 '{"description":"My updated app"}' - cmd.exe: 为每个内部双引号添加反斜杠转义。
cmd
msstore submission updateMetadata 9NBLGGH4R315 "{\"description\":\"My updated app\"}"
提示: 对于复杂或多行的元数据,可以将JSON保存到文件中,直接传递文件内容来避免引号问题:bashmsstore submission updateMetadata 9NBLGGH4R315 "$(cat metadata.json)"
选项:
| 选项 | 描述 |
|---|---|
| 跳过初始状态轮询 |
Publish Submission
发布提交内容
bash
msstore submission publish <productId>bash
msstore submission publish <productId>Poll Submission
轮询提交状态
bash
msstore submission poll <productId>Polls until the submission status is PUBLISHED or FAILED.
bash
msstore submission poll <productId>一直轮询直到提交状态变为已发布(PUBLISHED)或失败(FAILED)。
Delete Submission
删除提交内容
bash
msstore submission delete <productId>Options:
| Option | Description |
|---|---|
| Skip confirmation prompt |
bash
msstore submission delete <productId>选项:
| 选项 | 描述 |
|---|---|
| 跳过确认提示 |
init - Initialize Project for Store
init - 初始化项目用于商店发布
Initialize a project for Microsoft Store publishing. Automatically detects project type and configures Store identity.
bash
msstore init <pathOrUrl> [options]Arguments:
| Argument | Description |
|---|---|
| Project directory path or PWA URL |
Options:
| Option | Description |
|---|---|
| Publisher Display Name |
| Also package the project |
| Package and publish (implies --package) |
| Publish to a specific flight |
| Gradual rollout percentage (0-100) |
| Architecture(s): x86, x64, arm64 |
| Output directory for packages |
| Version to use when building |
Supported Project Types:
- Windows App SDK / WinUI 3
- UWP
- .NET MAUI
- Flutter
- Electron
- React Native for Desktop
- PWA (Progressive Web Apps)
Examples:
bash
undefined初始化项目以便发布到Microsoft Store,会自动检测项目类型并配置商店标识。
bash
msstore init <pathOrUrl> [options]参数:
| 参数 | 描述 |
|---|---|
| 项目目录路径或PWA URL |
选项:
| 选项 | 描述 |
|---|---|
| 发布者显示名称 |
| 同时打包项目 |
| 打包并发布(自动包含--package逻辑) |
| 发布到指定航班 |
| 灰度发布百分比(0-100) |
| 架构:x86、x64、arm64 |
| 包的输出目录 |
| 构建时使用的版本号 |
支持的项目类型:
- Windows App SDK / WinUI 3
- UWP
- .NET MAUI
- Flutter
- Electron
- React Native for Desktop
- PWA(渐进式Web应用)
示例:
bash
undefinedInitialize WinUI project
初始化WinUI项目
msstore init ./my-winui-app
msstore init ./my-winui-app
Initialize PWA
初始化PWA
msstore init https://contoso.com --output ./pwa-package
msstore init https://contoso.com --output ./pwa-package
Initialize and publish
初始化并发布
msstore init ./my-app --publish
undefinedmsstore init ./my-app --publish
undefinedpackage - Package for Store
package - 打包用于商店提交
Package an application for Microsoft Store submission.
bash
msstore package <pathOrUrl> [options]Arguments:
| Argument | Description |
|---|---|
| Project directory path or PWA URL |
Options:
| Option | Description |
|---|---|
| Output directory for the package |
| Architecture(s): x86, x64, arm64 |
| Version for the package |
Examples:
bash
undefined打包应用用于Microsoft Store提交。
bash
msstore package <pathOrUrl> [options]参数:
| 参数 | 描述 |
|---|---|
| 项目目录路径或PWA URL |
选项:
| 选项 | 描述 |
|---|---|
| 包的输出目录 |
| 架构:x86、x64、arm64 |
| 包的版本号 |
示例:
bash
undefinedPackage for default architecture
用默认架构打包
msstore package ./my-app
msstore package ./my-app
Package for multiple architectures
针对多个架构打包
msstore package ./my-app --arch x64,arm64 --output ./packages
msstore package ./my-app --arch x64,arm64 --output ./packages
Package with specific version
使用指定版本号打包
msstore package ./my-app --version 1.2.3.0
undefinedmsstore package ./my-app --version 1.2.3.0
undefinedpublish - Publish to Store
publish - 发布到商店
Publish an application to the Microsoft Store.
bash
msstore publish <pathOrUrl> [options]Arguments:
| Argument | Description |
|---|---|
| Project directory path or PWA URL |
Options:
| Option | Description |
|---|---|
| Path to existing .msix or .msixupload file |
| Application ID (if not initialized) |
| Keep submission in draft state |
| Publish to a specific flight |
| Gradual rollout percentage (0-100) |
Examples:
bash
undefined将应用发布到Microsoft Store。
bash
msstore publish <pathOrUrl> [options]参数:
| 参数 | 描述 |
|---|---|
| 项目目录路径或PWA URL |
选项:
| 选项 | 描述 |
|---|---|
| 现有.msix或.msixupload文件的路径 |
| 应用ID(如果未初始化) |
| 保持提交为草稿状态 |
| 发布到指定航班 |
| 灰度发布百分比(0-100) |
示例:
bash
undefinedPublish project
发布项目
msstore publish ./my-app
msstore publish ./my-app
Publish existing package
发布现有包
msstore publish ./my-app --inputFile ./packages/MyApp.msixupload
msstore publish ./my-app --inputFile ./packages/MyApp.msixupload
Publish as draft
发布为草稿
msstore publish ./my-app --noCommit
msstore publish ./my-app --noCommit
Publish with gradual rollout
灰度发布
msstore publish ./my-app --packageRolloutPercentage 10
undefinedmsstore publish ./my-app --packageRolloutPercentage 10
undefinedflights - Package Flight Management
flights - 包航班管理
Manage package flights (beta testing groups).
| Sub-Command | Description |
|---|---|
| List all flights for an app |
| Get flight details |
| Delete a flight |
| Create a new flight |
| Manage flight submissions |
管理包航班(beta测试组)。
| 子命令 | 描述 |
|---|---|
| 列出应用的所有航班 |
| 获取航班详情 |
| 删除航班 |
| 创建新航班 |
| 管理航班提交 |
List Flights
列出航班
bash
msstore flights list <productId>bash
msstore flights list <productId>Get Flight Details
获取航班详情
bash
msstore flights get <productId> <flightId>bash
msstore flights get <productId> <flightId>Create Flight
创建航班
bash
msstore flights create <productId> <friendlyName> --group-ids <group-ids>Options:
| Option | Description |
|---|---|
| Flight group IDs (comma-separated) |
| Flight ID to rank higher than |
bash
msstore flights create <productId> <friendlyName> --group-ids <group-ids>选项:
| 选项 | 描述 |
|---|---|
| 航班组ID(英文逗号分隔) |
| 排序优先级高于指定航班ID |
Delete Flight
删除航班
bash
msstore flights delete <productId> <flightId>bash
msstore flights delete <productId> <flightId>Flight Submissions
航班提交管理
bash
undefinedbash
undefinedGet flight submission
获取航班提交
msstore flights submission get <productId> <flightId>
msstore flights submission get <productId> <flightId>
Publish flight submission
发布航班提交
msstore flights submission publish <productId> <flightId>
msstore flights submission publish <productId> <flightId>
Check flight submission status
检查航班提交状态
msstore flights submission status <productId> <flightId>
msstore flights submission status <productId> <flightId>
Poll flight submission
轮询航班提交状态
msstore flights submission poll <productId> <flightId>
msstore flights submission poll <productId> <flightId>
Delete flight submission
删除航班提交
msstore flights submission delete <productId> <flightId>
undefinedmsstore flights submission delete <productId> <flightId>
undefinedFlight Rollout Management
航班发布管理
bash
undefinedbash
undefinedGet rollout status
获取发布状态
msstore flights submission rollout get <productId> <flightId>
msstore flights submission rollout get <productId> <flightId>
Update rollout percentage
更新发布百分比
msstore flights submission rollout update <productId> <flightId> <percentage>
msstore flights submission rollout update <productId> <flightId> <percentage>
Halt rollout
暂停发布
msstore flights submission rollout halt <productId> <flightId>
msstore flights submission rollout halt <productId> <flightId>
Finalize rollout (100%)
完成发布(全量100%)
msstore flights submission rollout finalize <productId> <flightId>
undefinedmsstore flights submission rollout finalize <productId> <flightId>
undefinedCommon Workflows
常用工作流
Workflow 1: First-Time Store Setup
工作流1:首次商店配置
bash
undefinedbash
undefined1. Install the CLI
1. 安装CLI
winget install "Microsoft Store Developer CLI"
winget install "Microsoft Store Developer CLI"
2. Configure credentials (get these from Partner Center)
2. 配置凭证(从Partner Center获取这些值)
msstore reconfigure --tenantId $TENANT_ID --sellerId $SELLER_ID --clientId $CLIENT_ID --clientSecret $CLIENT_SECRET
msstore reconfigure --tenantId $TENANT_ID --sellerId $SELLER_ID --clientId $CLIENT_ID --clientSecret $CLIENT_SECRET
3. Verify configuration
3. 验证配置
msstore info
msstore info
4. List your apps to confirm access
4. 列出你的应用确认访问权限
msstore apps list
undefinedmsstore apps list
undefinedWorkflow 2: Initialize and Publish New App
工作流2:初始化并发布新应用
bash
undefinedbash
undefined1. Navigate to project
1. 进入项目目录
cd my-winui-app
cd my-winui-app
2. Initialize for Store (creates/updates app identity)
2. 初始化用于商店发布(创建/更新应用标识)
msstore init .
msstore init .
3. Package the application
3. 打包应用
msstore package . --arch x64,arm64
msstore package . --arch x64,arm64
4. Publish to Store
4. 发布到商店
msstore publish .
msstore publish .
5. Check submission status
5. 检查提交状态
msstore submission status <productId>
undefinedmsstore submission status <productId>
undefinedWorkflow 3: Update Existing App
工作流3:更新现有应用
bash
undefinedbash
undefined1. Build your updated application
1. 构建更新后的应用
dotnet publish -c Release
dotnet publish -c Release
2. Package and publish
2. 打包并发布
msstore publish ./my-app
msstore publish ./my-app
Or publish from existing package
或者从现有包发布
msstore publish ./my-app --inputFile ./artifacts/MyApp.msixupload
undefinedmsstore publish ./my-app --inputFile ./artifacts/MyApp.msixupload
undefinedWorkflow 4: Gradual Rollout
工作流4:灰度发布
bash
undefinedbash
undefined1. Publish with initial rollout percentage
1. 按初始百分比发布
msstore publish ./my-app --packageRolloutPercentage 10
msstore publish ./my-app --packageRolloutPercentage 10
2. Monitor and increase rollout
2. 监控并提高发布比例
msstore submission poll <productId>
msstore submission poll <productId>
3. (After validation) Finalize to 100%
3. (验证通过后)全量发布
This completes via Partner Center or submission update
可以通过Partner Center或提交更新完成该操作
undefinedundefinedWorkflow 5: Beta Testing with Flights
工作流5:使用航班进行beta测试
bash
undefinedbash
undefined1. Create a flight group in Partner Center first
1. 先在Partner Center创建航班组
Then create a flight
然后创建航班
msstore flights create <productId> "Beta Testers" --group-ids "group-id-1,group-id-2"
msstore flights create <productId> "Beta Testers" --group-ids "group-id-1,group-id-2"
2. Publish to the flight
2. 发布到该航班
msstore publish ./my-app --flightId <flightId>
msstore publish ./my-app --flightId <flightId>
3. Check flight submission status
3. 检查航班提交状态
msstore flights submission status <productId> <flightId>
msstore flights submission status <productId> <flightId>
4. After testing, publish to production
4. 测试完成后,发布到生产环境
msstore publish ./my-app
undefinedmsstore publish ./my-app
undefinedWorkflow 6: CI/CD Pipeline Integration
工作流6:CI/CD流水线集成
yaml
undefinedyaml
undefinedGitHub Actions example
GitHub Actions示例
name: Publish to Store
on:
release:
types: [published]
jobs:
publish:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Install msstore CLI
run: winget install "Microsoft Store Developer CLI" --accept-package-agreements --accept-source-agreements
- name: Configure Store credentials
run: |
msstore reconfigure --tenantId ${{ secrets.TENANT_ID }} --sellerId ${{ secrets.SELLER_ID }} --clientId ${{ secrets.CLIENT_ID }} --clientSecret ${{ secrets.CLIENT_SECRET }}
- name: Build application
run: dotnet publish -c Release
- name: Publish to Store
run: msstore publish ./src/MyAppundefinedname: Publish to Store
on:
release:
types: [published]
jobs:
publish:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: 配置.NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: 安装msstore CLI
run: winget install "Microsoft Store Developer CLI" --accept-package-agreements --accept-source-agreements
- name: 配置商店凭证
run: |
msstore reconfigure --tenantId ${{ secrets.TENANT_ID }} --sellerId ${{ secrets.SELLER_ID }} --clientId ${{ secrets.CLIENT_ID }} --clientSecret ${{ secrets.CLIENT_SECRET }}
- name: 构建应用
run: dotnet publish -c Release
- name: 发布到商店
run: msstore publish ./src/MyAppundefinedIntegration with winapp CLI
与winapp CLI集成
The winapp CLI (v0.2.0+) integrates with msstore via the subcommand:
winapp storebash
undefinedwinapp CLI(v0.2.0+)通过子命令与msstore集成:
winapp storebash
undefinedThese commands are equivalent:
以下命令等效:
msstore reconfigure --tenantId xxx --clientId xxx --clientSecret xxx
winapp store reconfigure --tenantId xxx --clientId xxx --clientSecret xxx
msstore reconfigure --tenantId xxx --clientId xxx --clientSecret xxx
winapp store reconfigure --tenantId xxx --clientId xxx --clientSecret xxx
List apps
列出应用
msstore apps list
winapp store apps list
msstore apps list
winapp store apps list
Publish
发布
msstore publish ./my-app
winapp store publish ./my-app
Use `winapp store` when you want a unified CLI experience for both packaging and publishing.msstore publish ./my-app
winapp store publish ./my-app
如果你想要统一的打包和发布CLI体验,可以使用`winapp store`。Troubleshooting
问题排查
| Issue | Solution |
|---|---|
| Authentication failed | Verify credentials with |
| App not found | Ensure the product ID is correct; run |
| Insufficient permissions | Check Azure AD app role in Partner Center (needs Manager or Developer) |
| Package validation failed | Ensure package meets Store requirements; check Partner Center for details |
| Submission stuck | Run |
| Flight not found | Verify flight ID with |
| Rollout percentage invalid | Value must be between 0 and 100 |
| Init fails for PWA | Ensure URL is publicly accessible and has valid web app manifest |
| 问题 | 解决方案 |
|---|---|
| 身份验证失败 | 用 |
| 未找到应用 | 确认产品ID正确;运行 |
| 权限不足 | 检查Partner Center中的Azure AD应用角色(需要管理员或开发者权限) |
| 包验证失败 | 确认包符合商店要求;查看Partner Center获取详情 |
| 提交卡住 | 运行 |
| 未找到航班 | 运行 |
| 发布百分比无效 | 值必须在0到100之间 |
| PWA初始化失败 | 确认URL可公开访问且有有效的Web应用清单 |
Environment Variables
环境变量
The CLI supports environment variables for credentials:
| Variable | Description |
|---|---|
| Azure AD Tenant ID |
| Partner Center Seller ID |
| Azure AD Application Client ID |
| Client Secret |
CLI支持使用环境变量存储凭证:
| 变量 | 描述 |
|---|---|
| Azure AD租户ID |
| Partner Center卖家ID |
| Azure AD应用客户端ID |
| 客户端密钥 |