locus

CLI Reference

The locus command-line interface (CLI) is your primary tool for creating, managing, and building Locus projects.

locus new

Scaffolds a new Locus project in a directory with the specified name.

Usage:

locus new <project-name>

Arguments:

What it does: This command creates a new folder and populates it with a standard set of starter files to get you up and running quickly:


locus build

Compiles your .locus files into a production-ready application. This command performs a full, deterministic build of all artifacts.

Usage:

locus build [options]

Options:

Flag Description
--src <dir> Specifies the source directory for .locus files (default: .).
--out <dir> Specifies the output directory for generated code (default: generated).
--errors <format> Sets the error output style. Can be pretty (default) or json.
--prisma-generate Automatically runs npx prisma generate after the build.
--dry-run Lists the files that would be generated without writing anything to disk.
--emit-js Compiles the generated TypeScript into JavaScript in a dist folder.
--suppress-warnings Prevents build warnings from being printed to the console.
--debug Prints detailed timing and performance logs for the build process.

locus dev

Starts the development server. This command runs an initial build, starts the backend and frontend servers, and watches your .locus files for changes, enabling a fast, live-reloading workflow.

Usage:

locus dev [options]

Options:

Flag Description
--src <dir> Specifies the source directory to watch (default: .).
--errors <format> Sets the error output style. Can be pretty (default) or json.
--emit-js Compiles generated TS to JS on the fly (for ts-node alternatives).
--suppress-warnings Prevents warnings from being printed to the console.
--quiet Hides the startup banner and other informational logs.
--log-file <path> Mirrors all development server output to the specified log file.
--debug Prints detailed timing logs for incremental rebuilds.

Environment Variables:


locus db

A wrapper for common database operations, powered by Prisma.

Usage:

locus db <subcommand>

Subcommands:


locus deploy

Prepares your project for deployment and displays the configured deployment targets.

Usage:

locus deploy <environment>

Arguments:

What it does: This command does not perform a deployment itself. Instead, it:

  1. Runs a full production build of your project (locus build).
  2. Reads your Locus.toml file and looks for a [deploy.environment] section that matches the environment you specified.
  3. Prints the configured deployment platforms (e.g., Vercel, Railway) based on that section.

This serves as a pre-flight check before you manually run the deployment commands for your hosting provider.


locus plugins

Tools for inspecting the Locus plugin ecosystem in your project.

Usage:

locus plugins <subcommand>

Subcommands: