CLI

Platforms

Add web, mobile and desktop apps to a workspace, as many as you need, and set up their native projects.

A platform is a kind of app: a template to copy, the root scripts every app of that kind gets, and the targetsplatform init can set up in it. The built-in platforms are:

PlatformTemplateTargetsWhat it is
webwebA Nuxt web app: users, auth, account and admin
web-standaloneweb-standaloneThe web app with an OAuth server and API for the mobile and desktop apps (app name web)
mobilemobileios, android, apple-watchA Capacitor app on @frigear-nu/mobile
desktopdesktoptauriA Tauri app on @frigear-nu/desktop

A project adds its own, such as a wall display or a kiosk: see Custom platforms.

platform add

pnpx @frigear-nu/cli platform add <platform> [name] [-t <template>] [--apps-dir <dir>] [--ref <ref>] [--no-scripts] [--no-install]
ArgumentDefaultPurpose
platformrequiredweb, web-standalone, mobile, desktop, a platform from frigear.platforms in the root package.json, or any other name together with --template.
namethe platform's nameFolder of the app, kebab-cased. Add the same platform again under another name for a second app.
-t, --templatethe platform'sA template name (web, web-standalone, mobile, desktop, or from frigear.templates) or a giget source such as gh:org/repo/path#ref.
--apps-dirautoWhere the app goes; see Where it works.
--refmainBranch or tag of the Frigear repository for the built-in templates.
--no-scriptsDo not add the platform's scripts to the root package.json.
--no-installSkip the install and prepare:env.

It works from anywhere in a workspace, the root and the apps folder included:

pnpx @frigear-nu/cli platform add mobile             # apps/mobile
cd apps && pnpx @frigear-nu/cli platform add desktop # apps/desktop
pnpx @frigear-nu/cli platform add mobile tablet      # a second Capacitor app in apps/tablet
pnpx @frigear-nu/cli platform add display lobby --template web

What it does:

  1. Copies the template into <apps folder>/<name>. It fails when that folder already has a package.json; in a terminal it asks for another name.
  2. Names the package <scope>/<name>, with the scope of the existing apps (@workspace in the starters), else of the root package, and records "frigear": { "platform": "<platform>" } in it, so platform init knows what it is. When a workspace package or a dependency of the app already has that name (@frigear-nu/mobile in a workspace scoped @frigear-nu), the package is <scope>/<name>-app instead, with a warning. The folder and scripts keep <name>.
  3. Adds the platform's root scripts under the app's name. Scripts the root already has are kept as they are, and the root dev script is not changed.
  4. Runs the install and the root prepare:env script, which writes the app's .env from its .env.example.
  5. Prints the next steps.

Root scripts

With the default names these are the multi-platform starter's scripts, so a project that grows one platform at a time ends up with the same commands:

PlatformScripts (for an app named mobile, desktop, web)
mobiledev:mobile, mobile:native, mobile:doctor, mobile:watch, mobile:sync, mobile:ios, mobile:ios:device, mobile:android
desktopdev:desktop, desktop:setup, desktop:doctor, desktop:init, desktop:sync, desktop:dev, desktop:build, desktop:sidecar
web, web-standalonedev:web, and db:generate and db:migrate when the root has none yet

A second app gets its own set: platform add mobile tablet adds dev:tablet, tablet:ios, tablet:android, ... To start it with the rest, add --filter ./apps/tablet to the root dev script.

Signing in from the new app

A mobile or desktop app signs in at an OAuth server. The command does not register it for you; its next steps say what to do:

  • When an app of the workspace runs @frigear-nu/oauth-server: import the new app's identity in that app's nuxt.config.ts and add it to oauthServer.clients, as the multi-platform starter does.
  • Otherwise: set NUXT_PUBLIC_AUTHENTICATION_CLIENT_ISSUER (and _API_BASE) in the new app's .env.
A second app copied from the same template starts with the first one's app id, name and OAuth client id. Give it its own in its identity.ts before you register it or create its native projects.

platform init

pnpx @frigear-nu/cli platform init <target> [--app <name>] [--apps-dir <dir>] [-- <flags>]
TargetPlatformRuns in the app
ios, androidmobileits native script (frigear-mobile native --platform <target>)
apple-watch (watchos, watch)mobileits watch script, else frigear-mobile watch: a watchOS companion app
tauri (desktop)desktopits native script, else frigear-desktop init

Which app:

  1. --app: a folder in the apps folder, or a path;
  2. else the app you run it from;
  3. else the only app whose platform has the target. With several it asks, or fails outside a terminal and lists them.

The platform is the app's frigear.platform, else worked out from its dependencies (@frigear-nu/mobile, @frigear-nu/desktop, nuxt). It runs the target's script of the app when the app has it, else the target's binary from the app's dependencies. Flags after -- go to the script or binary:

pnpx @frigear-nu/cli platform init ios -- --if-missing
pnpx @frigear-nu/cli platform init apple-watch --app tablet

platform list

pnpx @frigear-nu/cli platform list [--apps-dir <dir>]

Prints the platforms (built-in and the project's own) with their templates and targets, the template names, and each app of the apps folder with its platform.

app:create

pnpx @frigear-nu/cli app:create <name> [--template <template>] [--apps-dir <dir>] [--ref <ref>] [--no-install]

The older form of platform add <template> <name>, with --template defaulting to web. It adds the root scripts too.

Next steps

Copyright © 2026