unirepo

Use the Unirepo CLI to create projects, configure apps, and manage shared features from one repository.

Proposed API. This page defines the CLI before implementation. The commands and options below are not available yet.

init

Use the init command to configure an existing project, or create a new project with --name.

npx unirepo@latest init

The setup will guide you through your project identity, apps, frameworks, Appearance preset, and optional features. Your choices will be saved in unirepo.config.ts.

Options

cli
Usage: unirepo init [directory] [options]Initialize a project and install its dependencies.Arguments:  directory                     Target directory. Defaults to the current directory.Options:  -n, --name <name>              Create a new project with this name.  -t, --template <template>      Start from a project template.  -p, --preset <preset>          Apply a preset by name or ID.      --apps <apps>             Select apps: web,mobile,desktop.      --features <features>     Select optional features, separated by commas.      --package-manager <name>  Use npm, pnpm, yarn, or bun.      --config <path>           Set the configuration file location.      --no-install              Write files without installing dependencies.      --dry-run                 Preview changes without writing files.      --json                    Return structured output.  -y, --yes                     Accept defaults for unanswered questions.  -h, --help                    Display help.

Create a project

npx unirepo@latest init --name my-app

Without a directory argument, --name my-app will create ./my-app. When you provide both, the directory will choose the destination and --name will set the project name.

npx unirepo@latest init ./projects/my-app --name my-app

Existing files will be preserved. Conflicting changes will be reported before anything is overwritten; --yes will not authorize overwriting them.

Choose your apps

Select the platforms your software needs. Setup will ask which framework to use for each app.

npx unirepo@latest init --name my-app --apps web,mobile

See Apps for the proposed app configuration.

Templates and presets

A template defines the starting project structure. A preset supplies reusable configuration choices, including Appearance and optional features.

Templates may recommend a preset. Explicit options will override preset choices, and interactive setup will ask about anything still undecided. Preset names and IDs will be documented when the registry is implemented.

Interactive setup

The setup will ask:

  1. What are you building? Name and description.
  2. Where should it run? Web, mobile, or desktop.
  3. Which frameworks? Compatible choices for each app.
  4. How should it look? An Appearance preset.
  5. What should it include? Optional features such as localization and documentation.

Business name, owners, licensing, and copyright will be optional project details. Before writing files, setup will show the selected apps, shared packages, and dependencies.

Preview changes

npx unirepo@latest init --name my-app --apps web --dry-run

Preview the proposed files and dependencies without changing the project or installing packages.

Use with agents

Interactive setup and unattended execution will produce the same configuration.

npx unirepo@latest init \  --name my-app \  --apps web \  --package-manager bun \  --yes \  --json

--yes will use documented defaults without prompting. If a required choice has no default, the command will exit with an error identifying what is missing. --json will provide machine-readable results and errors, without interactive prompts.

Configuration

unirepo.config.ts will hold the project definition. Framework configuration will be derived from it where supported. Generated artifacts will live in .unirepo; app source files will remain yours to edit.

Last updated