Skip to main content
The Native Desktop CLI provides a comprehensive set of commands to manage your desktop application development workflow. This page provides an overview of all available commands and their primary use cases.

Command List

Project Management

create

Initialize a new Native Desktop project in an empty directory.
native-desktop create
Use Case: Starting a new desktop application project with proper scaffolding and configuration. Learn More: Create Command Documentation

run

Run your Native Desktop application in development mode.
native-desktop run [project-config-file]
Use Case: Testing and developing your application with live updates during development. Learn More: Run Command Documentation

Build & Distribution

build

Build your Native Desktop project for production distribution.
native-desktop build --config <config-file> --target <target-type> [--sign]
Use Case: Creating distributable packages for end users on your target platform. Learn More: Build Command Documentation

sign

Sign a built application for Windows or macOS.
native-desktop sign [app-path] [options]
Use Case: Code signing your application to meet platform distribution requirements and ensure user trust. Learn More: Sign Command Documentation

Code Quality

lint

Run ESLint on your project to check for code quality issues.
native-desktop lint
Use Case: Identifying and fixing code style issues and potential bugs. Learn More: Lint Command Documentation

fmt

Format your source code using Prettier.
native-desktop fmt
Use Case: Automatically formatting code to maintain consistent style across your project. Learn More: Format Command Documentation

types

Check TypeScript types in your project.
native-desktop types
Use Case: Validating TypeScript types to catch type errors before runtime. Learn More: Types Command Documentation

Command Workflow

A typical Native Desktop development workflow follows this pattern:

1. Project Creation

# Create a new project
native-desktop create

2. Development Cycle

# Run in development mode
native-desktop run

# Check code quality
native-desktop lint

# Format code
native-desktop fmt

# Verify types
native-desktop types

3. Production Build

# Build for your platform
native-desktop build --config native-desktop.config.json5 --target dmg

# Sign the application
native-desktop sign --platform mac --identity "Developer ID Application"

Global Options

All commands support the following global options:

--help / -h

Display help information for the command.
native-desktop <command> --help

--version / -v

Display the CLI version number.
native-desktop --version

Platform-Specific Commands

Some commands have platform-specific behavior:
  • Build Targets: dmg, app, pkg
  • Signing: Requires Apple Developer ID and certificates
  • Notarization: Supported via sign command with Apple ID credentials
  • Build Targets: exe, msi, msi-wrapped
  • Signing: Requires code signing certificate (.pfx or .p12)
  • Certificate Options: Support for file-based and SHA1-based signing
  • Build Targets: deb, rpm, app-image, flatpak, snap
  • Signing: Platform-specific signing mechanisms
  • Distribution: Multiple package formats for different distributions

Configuration Files

Most commands interact with the project configuration file: Default Configuration File: native-desktop.config.json5 You can specify a custom configuration file using the --config option:
native-desktop build --config custom-config.json5 --target dmg

Exit Codes

The Native Desktop CLI uses standard exit codes:
  • 0: Command completed successfully
  • 1: Command failed with an error
This allows for easy integration with CI/CD pipelines and scripts.

Error Handling

When errors occur, the CLI provides detailed error messages to help diagnose issues:
 Error: Invalid target "invalid" for platform "mac". 
  Supported targets: dmg, app, pkg
Always read error messages carefully, they often include suggestions for fixing the issue.