Create a project
Scaffold
Section titled “Scaffold”npx @dotcarbon/create-app my-carbon-appcd my-carbon-appThe interactive flow asks for a frontend, language, and package manager. For scripts or CI, provide the choices explicitly:
npx @dotcarbon/create-app my-carbon-app \ --template vue \ --lang ts \ --pm pnpm \ --yesSupported templates are react, vue, svelte, solid, preact, and vanilla. TypeScript is the
default; pass --lang js for JavaScript. Use --no-install when another process owns dependency installation.
The scaffolder pins current compatible DotCarbon packages when it creates the project. Update the CLI and rerun dependency updates normally when moving an existing app to a later release.
Run the desktop app
Section titled “Run the desktop app”carbon devCarbon starts the configured Vite command, waits for build.devUrl, starts the .NET host with
dotnet watch, generates carbon.d.ts, and syncs local app commands into the main capability file.
Add a command
Section titled “Add a command”public record SumArgs(int A, int B);
public partial class AppCommands : IPlugin{ public string Namespace => "app";
[CarbonCommand("sum")] public int Sum(SumArgs args) => args.A + args.B;}Call it from the frontend:
import { invoke } from '@dotcarbon/api'
const total = await invoke('app:sum', { a: 20, b: 22 })carbon dev notices the new command and refreshes the generated TypeScript declarations.
carbon buildThe production build compiles the frontend, embeds it with carbon.json, and publishes a
self-contained desktop application into out/<target>/. Add --bundle for a native installer.
Next, learn how Carbon maps a project to each native host or review the development workflow.
