Skip to main content

Parcel command line reference

Use the Parcel command-line tool to package Avalonia applications for Windows, macOS, and Linux. Parcel can also sign applications and packages.

Prerequisites​

Before you use Parcel, make sure that you have these items:

  1. Parcel .NET tool - Follow the setup guide to install it.
  2. Valid license key - Set the AVALONIA_TOOLS_LICENSE_KEY environment variable or use the --license-key option. Get a license key from the Avalonia Portal.
note

Parcel CLI is only available with an Avalonia Plus license.

Overview​

parcel [command] [options]

Global Options​

OptionDescription
-?, -h, --helpShow help and usage information
--versionShow version information
--license-keySet the Parcel license key. If you omit this option, Parcel uses AVALONIA_TOOLS_LICENSE_KEY and then an existing application session
--verbositySet the verbosity level (quiet, minimal, normal, detailed, diagnostic)

Commands​

pack​

Builds and packages a project with the specified settings and parameters.

parcel pack <project> [options]

Arguments:

  • <project> - Parcel project file that contains the configuration

Options:

OptionDescriptionDefault
-o, --outputOutput directory<project-dir>\bin\packages
-r, --runtimesRuntime identifiers to package. You can specify this option more than once.Current platform runtime
-p, --packagesOutput formats: deb, dmg, msix, nsis, pkg, rpm, or zip. You can specify this option more than once.Current platform package
--no-buildDo not rebuild the input project.false

Example:

# Pack for current platform
parcel pack MyApp.parcel

# Pack for multiple platforms and formats
parcel pack MyApp.parcel -r osx-x64 -r linux-x64 -p dmg -p deb

step​

Runs one packaging step. Use this command to debug or customize a packaging workflow.

parcel step [command] <input> <output> [options]

Available Step Commands:

CommandDescriptionInputOutput
publishPublishes the .NET project for a target platform and runtimeNo explicit input. Parcel reads the project from the .parcel file.Published application directory
merge-macMerges architecture builds into a universal macOS application bundleDirectory with architecture-specific subdirectories (osx-x64, osx-arm64)Universal application directory
bundle-macPackages a macOS application and its dependencies into one bundleApplication directoryApplication bundle (.app)
sign-macSigns a macOS application bundle and its components with the credentials in the project settingsApplication bundle or flat directorySigned application bundle or directory
notary-macSubmits an application for Apple notarization and staples the ticket if Apple accepts itZipped application bundle or DMG fileNotarized file
sign-winSigns a Windows application executable with the provider in the project settingsApplication directory with an executable that matches AssemblyNameSigned executable
create-zipCreates a ZIP archive and preserves file permissions and symbolic linksDirectory or file that contains application filesZIP archive (.zip)
create-dmgCreates DMG disk image for macOSApp bundle (.app)Unsigned DMG image file
create-pkgCreates a macOS installer package with the settings in the Parcel projectApplication bundle (.app)PKG installer (.pkg)
create-debCreates Debian package for LinuxApplication directoryDebian package (.deb)
create-rpmCreates an RPM package for LinuxApplication directoryRPM package (.rpm)
create-nsisCreates Windows NSIS installerApplication directoryUnsigned NSIS installer (.exe)
create-msixCreates a Windows MSIX package. Parcel generates the manifest or patches a project template.Application directoryMSIX package (.msix)

Example:

The step commands are independent and do not have a required order. The following examples show a typical order for each platform.

You can replace a step with your own script to customize the workflow.

# `parcel step publish ./publish -r win-x64 -p project.parcel` can be used instead
dotnet publish -r win-x64 -o ./publish

# signing, with parameters populated from .parcel config file
parcel step sign-win ./publish ./signed -p project.parcel

# installer
parcel step create-nsis ./signed ./installer.exe -p project.parcel

# or ZIP archive
parcel step create-zip ./signed ./archive.zip -p project.parcel

Common Options:

  • -p, --project - Parcel project file that contains the configuration
  • -w, --overwrite - Overwrite existing output files
  • -r, --runtime - Runtime identifier (for publish command)

install-tools​

Downloads or updates tool dependencies required for the packaging configuration.

parcel install-tools [options]

Options:

OptionDescription
-r, --runtimesRuntime identifiers (can specify multiple)
-p, --packagesPackage formats: deb, dmg, msix, nsis, pkg, rpm, zip (can specify multiple)

Example:

# Install dependencies for specific platforms and package formats
parcel install-tools -r win-x64 -r osx-x64 -p nsis -p dmg

This command downloads the NSIS and DMG tools before Parcel needs them.

mcp​

Runs a Model Context Protocol (MCP) server. The server lets an AI assistant run Parcel commands.

parcel mcp

For setup and usage information, see Parcel MCP.

Environment Variables​

Parcel and console behavior​

VariableDescription
AVALONIA_TOOLS_LICENSE_KEYLicense key used when --license-key is not provided.
AVALONIA_TOOLS_LOG_LEVELSets the Parcel application and MCP log level, such as Debug or Information.

Tool discovery​

VariableDescription
PARCEL_JAVA_EXESets the path to the Java executable for cross-platform Windows signing. Parcel also reads JAVA_HOME.
PARCEL_SIGNTOOL_EXESets the path to SignTool on Windows.
PARCEL_WSL_DISTRIBUTIONWSL2 distribution used by packaging steps that require WSL on Windows.
PARCEL_WSL_USERSets the user account for the selected WSL2 distribution.

Cloud signing​

VariableDescription
AZURE_TENANT_IDMicrosoft Entra tenant used by Azure Artifact Signing or Key Vault.
AZURE_CLIENT_IDAzure service principal client ID.
AZURE_CLIENT_SECRETAzure service principal secret.
AWS_ACCESS_KEY_IDAWS access key used by AWS KMS signing.
AWS_SECRET_ACCESS_KEYAWS secret key used by AWS KMS signing.
AWS_SESSION_TOKENOptional AWS temporary-session token.

You can override supported scalar settings with automatic PARCEL_<SECTION>_<SETTING> environment variables. See the Parcel configuration reference for the exact name of each setting.

Notes​

  • Define all packaging options, signing credentials, and visual settings in the Parcel project file (.parcel).
  • When you use --no-build, make sure that the publish settings match your Parcel configuration. These settings include trimming, AOT, and single-file publishing.

See also​