Skip to content
pre-alpha

motio init

Create a new project from a starter.

Terminal window
motio init [dir]

Flags

Flag Description
--json Print one JSON object on stdout (schema in schemas/).
--log=<value> Log level: trace, verbose, info, warn, error.
--help, -h Show help for the command.
--template=<value>, -t Starter: basic, blank, captions (default basic).
--pm=<value> Package manager: pnpm, npm, yarn, bun (default: the one running motio, else pnpm).
--name=<value> Package name (default: from the directory name).
--install Install the dependencies (default; –no-install skips).
--yes, -y Ask nothing: defaults for what flags omit.
--force Write into a non-empty directory, replacing files with the same names.

JSON output

With --json, motio init prints exactly one JSON object on stdout. On success it has these fields; on failure it is the error object. The schema ships with the CLI as @motiojs/cli/schemas/init.schema.json.

Field Type Description
ok true
command "init"
dir string Absolute path of the project.
name string Package name written to package.json.
template "basic", "blank", "captions"
packageManager "pnpm", "npm", "yarn", "bun"
installed boolean True when the dependencies were installed.
files array of string Files written, relative to dir, sorted.
nextSteps array of string Shell commands to run next, in order.
warnings array of string

Exit codes

See exit codes. Run motio init --help for the same list of flags in the terminal.