Recursive AI

The dotnet new template

All oneapp docs
dotnet new install RecursiveAI.OneApp.Templates
dotnet new oneapp -n MyApp
cd MyApp
dotnet tool restore        # the oneapp tool, from .config/dotnet-tools.json
dotnet run                 # the window

What you get

File
MyApp.csprojNativeAOT on, warnings as errors, the app's identity (OneAppId, OneAppName, OneAppVersion, OneAppIcon, see packaging). References RecursiveAI.OneApp and RecursiveAI.OneApp.Kit and nothing else.
Program.csCreates the app host with the root component and runs it. --headless runs without a window or GPU, for driving through the harness.
MainPage.html, .css, .csOne component built from the kit: a card with a text field and a counter button. Every binding is checked when the project builds.
icon.pngThe launcher icon; replace it.
.config/dotnet-tools.jsonThe oneapp tool, so a clone builds and drives the app with dotnet oneapp ....

The markup compiler and the build step that makes each .html file and its .css neighbour a component template come with RecursiveAI.OneUI, which the two packages bring in.

Options

OptionDefault
-n, --nameMyAppProject, namespace and window title.
--appIddev.example.myappApplication id: the desktop entry name on Linux, the bundle identifier on macOS. Use your own reverse-DNS name.
--oneappVersionthe version of the template package (set when it is packed)The version of the three OneApp packages to reference.

Driving it

dotnet oneapp run . --headless --detach     # a Debug build with the development listener on
dotnet oneapp call status
dotnet oneapp click '#count'
dotnet oneapp query '#count'                # "Clicked 1 times"
dotnet oneapp capture --out page.png
dotnet oneapp install .                     # NativeAOT publish and a launcher entry

See harness for the verbs and packaging for install and package formats.

Building the template from source

dotnet pack src/OneApp.Templates writes the package; dotnet new install <file.nupkg> installs it from a folder. To try a generated app against unreleased packages, pack the OneApp packages into a folder, add that folder as a source in a nuget.config above the app, and pass --oneappVersion with the packed version.