Skip to main content
The create command initializes a new Native Desktop project with all necessary configuration files, dependencies, and project structure. This command provides an interactive setup process to customize your project.

Prerequisites

Before creating a Native Desktop project, ensure you have:
  • Node.js (version 16 or higher)
  • npm or yarn package manager
  • An empty directory for your project
The CLI will only create projects in empty directories. If your directory contains any files or folders, the command will fail with an error.

Basic Usage

To create a new project, navigate to an empty directory and run:
It is not possible to set a custom path; the recommended workflow is to create a new folder and run the CLI from there.

Interactive Setup

The create command launches an interactive setup wizard that guides you through the project configuration process.

Step 1: Select Project Type

The CLI first prompts you to select a project type:

Available Project Types

Creates a new project with minimal default settings, perfect for starting from scratch. This option provides:
  • Basic project structure
  • Essential configuration files
  • Minimal boilerplate code
  • Quick setup process
Best For: Beginners or simple applications
Creates a fully customizable project with comprehensive default settings. This option includes:
  • Complete project structure
  • Advanced configuration options
  • Development tools setup
  • Extended boilerplate code
Best For: Advanced users who want complete control and manual configuration

Step 2: Project Configuration

After selecting the project type, you’ll be prompted to provide project details:

Project Name

  • Required: Yes
  • Min Length: 2 characters
  • Max Length: 100 characters
  • Example: My Awesome App
This is the human-readable name displayed to users.

Project Version

  • Required: Yes
  • Default: 1.0.0
  • Format: Semantic versioning (MAJOR.MINOR.PATCH)
  • Example: 1.0.0, 0.1.0, 2.3.4
The version must follow Semantic Versioning format: MAJOR.MINOR.PATCH

Package Identifier

  • Required: Yes
  • Auto-generated: Based on project name (if not provided)
  • Min Length: 2 characters
  • Max Length: 214 characters
  • Format: Lowercase letters, numbers, and hyphens only
  • Restrictions: Cannot start or end with a hyphen
  • Example: my-awesome-app
This identifier is used internally and in package manifests.

Project Description

  • Required: No
  • Default: A NativeDesktop Application
  • Max Length: 500 characters
  • Example: A powerful task management application for remote teams

Author Information

  • Required: Yes
  • Default: NativeDesktop
  • Max Length: 200 characters
  • Format: Name or Name with email in angle brackets
  • Example: John Smith <john@example.com>
You can include an email address in angle brackets: Jane Doe <jane@example.com>

Project URL

  • Required: Yes
  • Format: Valid HTTP or HTTPS URL
  • Example: https://example.com
This URL is used in project metadata and application information.

Complete Example

Here’s a complete example of the project creation flow:

Generated Project Structure

After creation, your project will have the following structure:

Configuration Files

The create command generates several configuration files:
The main configuration file for your Native Desktop application. Contains build settings, application metadata, and platform-specific options.

Post-Creation Steps

After creating your project, you can:

1. Install Dependencies

If dependencies weren’t automatically installed:

2. Start Development

Run your application in development mode:

3. Explore Configuration

Review and customize the generated native-desktop.config.json5 file to suit your needs.

4. Add Your Code

Start building your application in the src/ directory.

Validation Rules

The create command validates all inputs to ensure a valid project configuration:

Common Issues

Error: NativeDesktop can only create new projects in an empty folder.Solution: Ensure your directory is completely empty. Remove all files and folders, including hidden files.
Error: Package identifier must contain only lowercase letters, numbers, and hyphensSolution: Use only lowercase letters, numbers, and hyphens. Avoid spaces, uppercase letters, and special characters.Valid: my-app-123 Invalid: My App, my_app, MyApp!
Error: Version must follow semantic versioning format (e.g., 1.0.0)Solution: Use the semantic versioning format with three numbers separated by dots.Valid: 1.0.0, 0.1.0, 2.3.4 Invalid: 1.0, v1.0.0, 1.0.0-beta
Error: URL must start with http:// or https://Solution: Provide a complete URL including the protocol.Valid: https://example.com, http://localhost:3000 Invalid: example.com, www.example.com

Best Practices

Naming Convention

Use descriptive, lowercase package identifiers with hyphens (kebab-case)

Version Strategy

Start with 1.0.0 for production-ready apps, or 0.1.0 for early development

Project Type

Choose “Empty Project” for learning, “Manual Project” for production apps

Documentation

Include a meaningful description to help other developers understand your project