Overview
The Frigear CLI creates projects from the starters, adds apps of any platform (web,
mobile, desktop or your own) to a workspace, sets up their native projects, installs Frigear modules and upgrades a
workspace to new releases. It works in any pnpm workspace, not only in the
Frigear repository. Its package is @frigear-nu/cli, a
citty CLI published to npm.
Run it
Run it without installing it:
pnpx @frigear-nu/cli --help
pnpx @frigear-nu/cli <command> --help
pnpm create frigear-app (or npm create frigear-app@latest) does the same as init: see
Create a project.
Inside the Frigear repository, use the root cli script. It runs packages/cli/bin/cli.mjs, which loads the
TypeScript source with jiti, so there is no build step:
pnpm cli --help
Frigear-nu/frigear-nu GitHub repository with
giget. If GitHub refuses the download (anonymous requests are rate limited), set
GIGET_AUTH to a GitHub token, for example GIGET_AUTH=$(gh auth token).Commands
| Command | Purpose | Page |
|---|---|---|
init | Creates a new project from a starter. | Create a project |
platform add | Adds an app of a platform (web, mobile, desktop or your own) to a workspace, with its root scripts. | Platforms |
platform init | Sets up a target in an app: ios, android, apple-watch, tauri or your platform's own. | Platforms |
platform list | Lists the platforms, templates and targets, and the workspace's apps per platform. | Platforms |
app:create | Adds an app from a template; the same as platform add <template> <name>. | Platforms |
module list | Lists the published Frigear modules, marking the ones the app has. | Modules |
module info | Shows a module: version, docs, the modules it pulls in and how to install it. | Modules |
module add | Installs Frigear modules in a Nuxt app and adds them to its nuxt.config; without names, pick from a list. add is the same command. | Modules |
module create | Scaffolds a new Nuxt module under packages/. | Modules |
package:rename | Renames a workspace package and every reference to it. | Refactoring |
module folder | Turns a single-file local module into a folder module. | Refactoring |
module move | Moves a local module or a package folder, fixing relative paths. | Refactoring |
upgrade | Moves every @frigear-nu/* package to a new release and runs the migrations in between. | Upgrade |
prepare env | Creates each app's .env from its .env.example and fills in empty secrets. | Environment files |
Where it works
Every command takes --cwd <dir>: the directory it starts from. The default is INIT_CWD (the directory you ran
pnpm in), else the current directory, so pnpm cli … from a subfolder works on that subfolder.
From there, commands that work on a workspace look for the nearest pnpm-workspace.yaml above it. That is the
workspace root: root scripts, the lockfile and pnpm install live there. Run them from the root, the apps folder or
inside an app; the result is the same.
The apps folder is where platform add puts a new app and where platform init and platform list look for apps.
--apps-dir auto (the default) picks it from the packages: globs of pnpm-workspace.yaml:
- the one-level glob folder (
apps/*,projects/*, ...) you run the command from, or are inside of; - else
apps/; - else the first one-level glob folder that is not
packages/.
--apps-dir <dir> names it instead, relative to --cwd; it must be inside the workspace. A folder that no glob
covers is allowed, with a warning, because pnpm will not install an app there until you add it to
pnpm-workspace.yaml.
Package managers
The workspace is a pnpm workspace: the commands find it by its pnpm-workspace.yaml. Installs and scripts go through
nypm, which runs the package manager named by the root's packageManager field or
lockfile, and pnpm when it finds none.
Next steps
- Create a project – start a new workspace from a starter.
- Platforms – add a mobile, desktop or second web app to a workspace.
- Upgrade – move a workspace to new
@frigear-nureleases.