NativeDesktop

The nd command

Every nd subcommand with its flags and one example each.

nd is one binary (crates/nd-cli). Run it from an app's directory (the one holding Cargo.toml and nativedesktop.toml). nd <command> --help prints the same flags as below.

CommandDoes
newCreates an app.
checkfmt, clippy, framework lints, appearance audit.
testRuns the test tiers through nextest.
buildNative release build, or the web bundle.
serveBuilds and serves the web bundle.
diagnoseSummarises incident bundles.
packageBuilds installers.
releasePacks, signs and publishes an update feed.
diagMeasures framework budgets.
docsChecks, builds and captures this documentation.

new

Creates a directory with a buildable app: Cargo.toml, nativedesktop.toml, a justfile, a nextest config, tests, and the agent docs (for agents). Refuses a non-empty directory and names that are not a lowercase package name.

nd new notes --id es.canarycoders.notes && cd notes && nd check && nd test

check

Runs, in order: cargo fmt --check, the framework lints, cargo clippy --all-targets with the framework lint table denied (warnings, unwrap_used, expect_used, dbg_macro, todo, print_stdout), and the appearance audit of every package that has tests/appearance.rs (see testing). Exits non-zero if any step failed. A framework lint is silenced with // nd-allow(rule): reason on its line or the line above.

nd check --target web -p notes

test

Maps a tier to a nextest profile and runs cargo nextest run (testing). Needs cargo-nextest.

nd test --tier real -p hello real_add

build

Without a target flag this is the native release build. With --target web it compiles the app for wasm32-unknown-unknown, runs the matching wasm-bindgen, and writes a static bundle with an index.html (web).

nd build --target web --out dist

serve

Builds the web bundle (unless told not to) and serves it on localhost.

nd serve --target web --port 3000

diagnose

Summarises the incident bundles an app left behind: panics, crashes, hangs and issue reports (diagnostics). With no argument it summarises the newest.

nd diagnose --list && nd diagnose --last --json

package

Builds the installer for one OS: a macOS .app, .pkg and .dmg, a Linux AppImage, a Windows Setup.exe, all through Velopack (packaging). The result lands in target/nd/releases.

nd package mac --channel beta --notes CHANGES.md

release

Packs like package, then writes a delta against the newest full package, signs the feed with an ed25519 key, and uploads it to [updates.publish] (packaging). Without [updates] feed and public_key in nativedesktop.toml it stops with a message.

nd release --channel stable --notes CHANGES.md

Two subcommands:

nd release keygen && nd release serve --port 8790

diag

Measures a framework budget. The one subcommand is scroll (performance).

It prints the frame percentiles and exits non-zero when more than 2 frames are missed past warm-up or p95 is over 1.25 refresh periods.

nd diag scroll --rows 100000 --seconds 10

docs

Works on the documentation in docs/content (see docs/WRITING.md) from anywhere inside the repository.

nd docs check --require macos && nd docs capture --stale