CLI & templates

Scaffold a new Conexus X view in one command — asks where and which framework, fetches the template, makes it yours, installs, and tells you what to run next.

bash
npm create @conexus-x/app

Which prints something like:

text
 Conexus X  create-app v0.1.0

✔ Where should the view live? … my-view
✔ Which framework? › Next.js
✔ Template ready (@conexus-x/next-view@latest)
✔ Created my-view (my-view)
✔ Dependencies installed with npm
✔ Initialised a git repository

Done. Next:

  cd my-view
  npm run dev

Also works as npx @conexus-x/create-app my-view, and with pnpm create, yarn create or bun create — whichever package manager you invoke it with is the one it installs with.

Templates

--templatePackageWhat you get
next@conexus-x/next-viewNext.js 16 + React 19 — pick this if your view needs a server of its own.
react@conexus-x/react-viewReact 19 + Vite, static output — pick this if the view only talks to Conexus X.

Templates are fetched from npm at scaffold time, not bundled into the CLI — each starter is its own repository with its own release cycle, so a template fix reaches new projects the moment it’s published, without a release of this CLI. Use --template-version to pin one when you need to reproduce an older scaffold.

Non-interactive usage

Every prompt has a flag, so the whole command can run unattended — in a script, in CI, in a template repository:

bash
npx @conexus-x/create-app my-view --template react --pm pnpm -y
FlagDoes
-t, --template <name>template to use (next | react)
--template-version <range>version of the template package to fetch (default: latest)
--from <path>use a local template directory or .tgz instead of the registry
--name <name>package name for the new project (default: the directory name)
--pm <manager>package manager (npm | pnpm | yarn | bun)
--no-installskip installing dependencies
--no-gitskip initialising a git repository
-y, --yesaccept the defaults and do not prompt
--overwritereplace the contents of a non-empty directory

A non-interactive environment (no TTY, or CI set) is detected automatically and takes the defaults rather than hanging on a prompt no one can answer.

What scaffolding changes in the template

The template is a package we publish, so its identity has to be replaced or a new project inherits ours:

FieldBecomes
package.json nameyour project name
package.json version0.1.0
package.json privatetrue
package.json files / publishConfig / keywords / licenseremoved
conexus.manifest.json id, namederived from your project name
conexus.manifest.json entry, description, publisherblanked
private: true and the removed publishConfig are the ones that matter: without them, your first npm publish would go to our scope. entry is blanked rather than guessed — it’s the origin the view bridge pins for postMessage, so a wrong value there is a security setting that silently fails to match at review time. Fill it in yourself once you know where the view will be served from.

Local template development

To work on a template before publishing it:

bash
npx @conexus-x/create-app my-view --from ../conexus-x-np      # a checkout
npx @conexus-x/create-app my-view --from ./template.tgz       # a packed tarball

--from a directory skips node_modules, dist, .next, .git and lockfiles.

Behaviour worth knowing

  • A failed fetch cleans up — a directory the command created is removed; one that already existed never is.
  • A failed install does not clean up — the project is already on disk and re-running the install is a one-line fix.
  • --overwrite empties the target but keeps .git — never the repository history of a directory you had already initialised.
  • It refuses to empty a drive root or your home directory, whatever the arguments say.
  • No shell: true anywhere — arguments are passed as arrays, so a path containing a space or an ampersand can never become two arguments or two commands.

Requirements

Node 20.9 or newer, checked at startup with a message that names your version.