Quick Start
Create and run your first Krema desktop application in minutes.
Create a New Project
Use the Krema CLI to scaffold a new project:
krema init my-app --template react
Available templates: vanilla, react, vue, svelte, angular
Interactive Wizard
Want more control? Use the wizard mode for full configuration including plugins:
krema init --wizard
Navigate to Your Project
cd my-app
Start Development Mode
krema dev
This will:
- Start your frontend dev server (Vite)
- Launch a native window pointing to the dev server
- Enable hot reload for both frontend and backend changes
Your First Backend Command
Open src-java/com/example/myapp/Commands.java:
import build.krema.command.KremaCommand;
public class Commands {
@KremaCommand
public String greet(String name) {
return "Hello, " + name + "!";
}
}
Call It from the Frontend
In your frontend code (e.g., src/App.jsx for React):
import { useEffect, useState } from 'react';
function App() {
const [greeting, setGreeting] = useState('');
useEffect(() => {
window.krema.invoke('greet', { name: 'World' })
.then(setGreeting);
}, []);
return <h1>{greeting}</h1>;
}
export default App;
Type-Safe Commands
Krema automatically generates TypeScript definitions for your @KremaCommand methods at compile time. The greet call above gets full autocompletion — command name, argument types, and return type are all inferred from your Java code. See TypeScript Support for details.
Build for Production
When ready to distribute your app:
# Build the app
krema build
# Create a distributable bundle (.app, .exe, .AppImage)
krema bundle
See the Building & Bundling guide for the full details.
What's Next?
- Learn about project structure
- Explore native APIs like file dialogs and notifications
- Build and bundle your app for distribution
- Set up auto-updates for your app
- Migrate from Electron or Tauri