CLI
Use PKGSmith from the command line
Install PKGSmith from Homebrew to get the pkgsmith command on your PATH. The installed CLI is build-only and is designed for repeatable local builds and CI jobs from existing .pkgsmith project files.
Install
Install PKGSmith with Homebrew to putpkgsmith on your PATH. That installed command is the supported CLI entry point for local automation and CI.
brew install --cask fogh/cask/pkgsmithUsage
Build from an existing project file
PKGSmith currently exposes one CLI subcommand:build. It reads a.pkgsmith file and prints the built artifact path to stdout on success.
pkgsmith build \ --reference <path> \ --output <dir> \ [--version <version>] [--json] \ [-q|--quiet] [-v|--verbose]
Inspect help
pkgsmith --helpVersion
pkgsmith --versionBuild flags
- -r, --reference <path>
- Required. Path to the .pkgsmith project file to build.
- -o, --output <dir>
- Required. Output directory where PKGSmith writes the built artifact.
- --version <version>
- Optional. Overrides the project version for the current build only.
- --json
- Prints a machine-readable JSON result to stdout instead of a plain artifact path.
- -q, --quiet
- Suppresses progress logs on stderr and leaves stdout for the final result only.
- -v, --verbose
- Prints additional progress messages to stderr during the build.
- -h, --help
- Shows CLI help. Supported globally and after the build subcommand.
I/O contract
stdout
Prints the final artifact path by default. With--json, stdout becomes a single JSON object instead.
stderr
Progress logs and build tool output are written to stderr unless--quiet is set.
Exit codes
PKGSmith exits with 0 on success, 1 when the build fails, and 2 for invalid CLI usage.
Examples
Common CLI flows
Build a project into a release folder
pkgsmith build --reference "./Marketing-PKG.pkgsmith" --output "./build/releases"Override the version for a one-off build
pkgsmith build --reference "./Marketing-PKG.pkgsmith" --output "./build/releases" --version 2.3.4Emit machine-readable JSON for automation
pkgsmith build --reference "./Marketing-PKG.pkgsmith" --output "./build/releases" --jsonSuppress progress logs and print only the artifact path
pkgsmith build --reference "./Marketing-PKG.pkgsmith" --output "./build/releases" --quietShow verbose progress on stderr while keeping stdout clean
pkgsmith build --reference "./Marketing-PKG.pkgsmith" --output "./build/releases" --verboseJSON mode
Use --json when a script needs to capture the result without parsing human log lines. Progress still goes to stderr unless quiet mode is also enabled.
{"artifactPath":"/Users/me/build/releases/MyInstaller.pkg","artifactType":"pkg"}CI / scripting
For scripts, combine --json with--quiet so stdout contains only the machine-readable result.
Notes
- The CLI builds from an existing project file. It does not create or edit .pkgsmith files.
- Both space-separated flags and equals syntax such as
--reference=Project.pkgsmithare supported. - After installing with Homebrew, inspect the full surface with
pkgsmith --help.