Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Commands

Perry provides 8 commands for compiling, checking, publishing, and managing your projects.

compile

Compile TypeScript to a native executable.

perry compile main.ts -o app
# Or shorthand (auto-detects compile):
perry main.ts -o app
FlagDescription
-o, --output <PATH>Output file path
--target <TARGET>Platform target (see Compiler Flags)
--output-type <TYPE>executable (default) or dylib (plugin)
--print-hirPrint HIR intermediate representation
--no-linkProduce object file only, skip linking
--keep-intermediatesKeep .o and .asm files
--enable-js-runtimeEnable V8 JavaScript runtime fallback
--type-checkEnable type checking via tsgo
--app-bundle-id <ID>Bundle ID (required for widget targets)
--bundle-extensions <DIR>Bundle TypeScript extensions from directory
# Basic compilation
perry compile app.ts -o app

# Cross-compile for iOS Simulator
perry compile app.ts -o app --target ios-simulator

# Build a plugin
perry compile plugin.ts --output-type dylib -o plugin.dylib

# Debug: view intermediate representation
perry compile app.ts --print-hir

# Build an iOS widget
perry compile widget.ts --target ios-widget --app-bundle-id com.myapp.widget

check

Validate TypeScript for Perry compatibility without compiling.

perry check src/
FlagDescription
--check-depsCheck node_modules for compatibility
--deep-depsScan all transitive dependencies
--allShow all issues including hints
--strictTreat warnings as errors
--fixAutomatically apply fixes
--fix-dry-runPreview fixes without modifying files
--fix-unsafeInclude medium-confidence fixes
# Check a single file
perry check src/index.ts

# Check with dependency analysis
perry check . --check-deps

# Auto-fix issues
perry check . --fix

# Preview fixes without applying
perry check . --fix-dry-run

init

Create a new Perry project.

perry init my-project
cd my-project
FlagDescription
--name <NAME>Project name (defaults to directory name)

Creates perry.toml, src/main.ts, and .gitignore.

doctor

Check your Perry installation and environment.

perry doctor
FlagDescription
--quietOnly report failures

Checks:

  • Perry version
  • System linker availability (cc/MSVC)
  • Runtime library
  • Project configuration
  • Available updates

explain

Get detailed explanations for error codes.

perry explain U001

Error code families:

  • P — Parse errors
  • T — Type errors
  • U — Unsupported features
  • D — Dependency issues

Each explanation includes the error description, example code, and suggested fix.

publish

Build, sign, and distribute your app.

perry publish --macos
perry publish --ios
perry publish --android
FlagDescription
--macosBuild for macOS (App Store/notarization)
--iosBuild for iOS (App Store/TestFlight)
--androidBuild for Android (Google Play)
--linuxBuild for Linux (AppImage/deb/rpm)
--server <URL>Build server (default: https://hub.perryts.com)
--license-key <KEY>Perry Hub license key
--project <PATH>Project directory
-o, --output <PATH>Artifact output directory (default: dist)
--no-downloadSkip artifact download

Apple-specific flags:

FlagDescription
--apple-team-id <ID>Developer Team ID
--apple-identity <NAME>Signing identity
--apple-p8-key <PATH>App Store Connect .p8 key
--apple-key-id <ID>App Store Connect API Key ID
--apple-issuer-id <ID>App Store Connect Issuer ID
--certificate <PATH>.p12 certificate bundle
--provisioning-profile <PATH>.mobileprovision file (iOS)

Android-specific flags:

FlagDescription
--android-keystore <PATH>.jks/.keystore file
--android-keystore-password <PASS>Keystore password
--android-key-alias <ALIAS>Key alias
--android-key-password <PASS>Key password
--google-play-key <PATH>Google Play service account JSON

On first use, publish auto-registers a free license key.

setup

Interactive credential wizard for app distribution.

perry setup          # Show platform menu
perry setup macos    # macOS setup
perry setup ios      # iOS setup
perry setup android  # Android setup

Stores credentials in ~/.perry/config.toml.

update

Check for and install Perry updates.

perry update             # Update to latest
perry update --check-only  # Check without installing
perry update --force       # Ignore 24h cache

Update sources (checked in order):

  1. Custom server (env/config)
  2. Perry Hub
  3. GitHub API

Opt out of automatic update checks with PERRY_NO_UPDATE_CHECK=1 or CI=true.

Next Steps