Skip to main content

CLI Reference

The Krema CLI provides commands for creating, developing, building, and bundling applications.

Global Options

krema [command] [options]

Options:
-h, --help Show help
-V, --version Show version

Commands

krema init

Create a new Krema project.

krema init <name> [options]

Arguments:

ArgumentDescription
nameProject name

Options:

OptionDescriptionDefault
-t, --template <template>Project templatevanilla
-f, --forceOverwrite existing directoryfalse
--wizardInteractive wizard with full configuration-
--ciNon-interactive mode for CI pipelines-

Templates:

  • vanilla - Plain HTML/CSS/JS with Vite
  • react - React 18 with Vite
  • vue - Vue 3 with Vite
  • svelte - Svelte 5 with Vite
  • angular - Angular 18

Examples:

# Create a React project
krema init my-app --template react

# Full interactive wizard (configure plugins, window settings, etc.)
krema init --wizard

# CI mode (no prompts)
krema init my-app --ci -t react

krema dev

Start development mode with hot reload.

krema dev [options]

Options:

OptionDescriptionDefault
--env <name>Environment profiledevelopment
--no-openDon't open the window automatically-
--port <port>Override frontend dev server port-

What it does:

  1. Starts the frontend dev server (npm/pnpm/yarn)
  2. Waits for the dev server to be ready
  3. Launches the native window pointing to the dev server
  4. Watches for Java source changes and reloads

Example:

krema dev
krema dev --env staging
krema dev --port 3000

krema build

Build the application for production.

krema build [options]

Options:

OptionDescriptionDefault
--env <name>Environment profileproduction
--nativeBuild native image with GraalVM-
--skip-frontendSkip frontend build-

What it does:

  1. Runs the frontend build command (npm run build)
  2. Compiles Java sources
  3. Copies web assets to resources
  4. Creates an executable JAR (or native binary with --native)

With --native, the CLI additionally generates a GraalVM resource config, invokes native-image, and copies the native webview library alongside the binary. See the Native Image guide for details.

Example:

krema build
krema build --env production
krema build --native
krema build --native --skip-frontend

krema bundle

Create platform-specific application bundles.

krema bundle [options]

Options:

OptionDescriptionDefault
--type <type>Bundle typePlatform default
--signSign the bundle-
--notarizeNotarize (macOS only, implies --sign)-
--env <name>Environment profileproduction

Bundle types:

PlatformTypesDefault
macOSapp, dmgdmg
Windowsexe, msiexe
Linuxappimage, deb, rpmappimage

Example:

# macOS
krema bundle --type dmg
krema bundle --type dmg --sign
krema bundle --type dmg --notarize

# Windows
krema bundle --type exe
krema bundle --type exe --sign

# Linux
krema bundle --type appimage
krema bundle --type deb

krema signer

Manage Ed25519 signing keys for auto-updates.

krema signer generate

Generate a new keypair.

krema signer generate [options]

Options:

OptionDescriptionDefault
-o, --output <path>Private key output pathkrema-private.key

Example:

krema signer generate
krema signer generate --output /secure/path/key.pem

Output:

[Krema Signer] Ed25519 keypair generated successfully!

Private key written to: ./krema-private.key

Add this to your krema.toml:

[updater]
pubkey = "MCowBQYDK2VwAyEA..."

krema signer sign

Sign a file.

krema signer sign <file> [options]

Options:

OptionDescriptionDefault
-k, --key <path>Private key fileUses KREMA_SIGNING_PRIVATE_KEY env

Example:

krema signer sign target/bundle/MyApp.dmg --key krema-private.key

# Using environment variable
export KREMA_SIGNING_PRIVATE_KEY="$(cat krema-private.key)"
krema signer sign target/bundle/MyApp.dmg

Creates a .sig file alongside the original (e.g., MyApp.dmg.sig).


Environment Variables

VariableDescription
KREMA_SIGNING_PRIVATE_KEYEd25519 private key for update signing
KREMA_APPLE_PASSWORDApple app-specific password for notarization
KREMA_CERTIFICATE_PASSWORDWindows certificate password
GRAALVM_HOMEGraalVM installation path for native builds
JAVA_HOMEJava installation path (also checked for native-image)

Configuration File

The CLI reads configuration from krema.toml in the project root.

[package]
name = "my-app"
version = "1.0.0"
identifier = "com.example.myapp"

[window]
title = "My App"
width = 1200
height = 800

[build]
frontend_command = "npm run build"
frontend_dev_command = "npm run dev"
frontend_dev_url = "http://localhost:5173"
out_dir = "dist"

[bundle]
icon = "icons/icon.icns"

[bundle.macos]
signing_identity = "Developer ID Application: ..."
notarization_apple_id = "[email protected]"
notarization_team_id = "TEAMID"

[bundle.windows]
certificate_path = "path/to/certificate.pfx"

[permissions]
allow = ["fs:read", "clipboard:read", "notification"]

[updater]
pubkey = "MCowBQYDK2VwAyEA..."
endpoints = ["https://releases.example.com/{{target}}/{{current_version}}"]

[env.development]
[env.development.window]
title = "My App (Dev)"

[env.production]
[env.production.build]
frontend_command = "npm run build:prod"

Exit Codes

CodeDescription
0Success
1General error
2Configuration error
3Build error
4Bundle error
5Signing error