CLI Reference

The Maravilla CLI is a command-line tool that provides development, build, preview, and platform management commands for your projects.

Installation

npm install -g @maravilla-labs/cli

Binaries are published for:

  • Linux: x86_64-unknown-linux-gnu
  • macOS: x86_64-apple-darwin, aarch64-apple-darwin (Intel and Apple Silicon)
  • Windows: x86_64-pc-windows-msvc

Global Flags

These flags can be used with any command:

FlagShortDescription
--quiet-qSuppress output
--debugEnable debug logging (sets MARAVILLA_DEBUG_FETCH=1 and verbose tracing)
--version-VShow version
--help-hShow help

maravilla init [path]

Initialize Maravilla in an existing project. Creates the .maravilla/ configuration directory and installs the required adapter for your framework.

# Initialize in the current directory
maravilla init

# Initialize in a specific directory
maravilla init ./my-project
FlagDescription
--skip-installSkip installing dependencies after initialization
--forceForce initialization even if already initialized

Example:

maravilla init --force ./my-astro-app

maravilla dev

Start a development server with hot reload. The platform services (KV store, database) are available locally during development.

maravilla dev
FlagShortDefaultDescription
--port-p3001Port for the platform dev server
--tenant-tTenant ID for development
--openOpen browser after starting

Example:

maravilla dev --port 8080 --open

maravilla build

Build your application for production. Detects your framework adapter automatically and produces an optimized output bundle.

maravilla build
FlagShortDefaultDescription
--adapter-aauto-detectFramework adapter to use
--checkValidate build output
--snapshotGenerate snapshot for faster cold starts
--snapshot-outputCustom output name for the snapshot file (e.g., server.bin)

Examples:

# Standard production build
maravilla build

# Build with snapshot for faster cold starts
maravilla build --snapshot

# Build and validate output
maravilla build --check

# Specify a custom snapshot output path
maravilla build --snapshot --snapshot-output my-server.bin

maravilla preview

Preview a production build locally. Runs the built application using the same runtime environment as production.

maravilla preview
FlagShortDefaultDescription
--port-p3000Port for the preview server
--snapshotUse snapshot instead of JavaScript bundle
--snapshot-path.maravilla/server.binPath to snapshot file
--auto-snapshotAutomatically create and promote snapshots locally
--build-dir.maravillaBuild directory
--production-modeUse production policies instead of development
--memory-limitSet memory limit in MB
--timeoutSet request timeout in seconds
--max-rpsSet max requests per second

Examples:

# Preview on a custom port
maravilla preview --port 4000

# Preview with snapshot
maravilla preview --snapshot

# Preview with production-like resource limits
maravilla preview --production-mode --memory-limit 128 --timeout 30 --max-rps 100

maravilla platform status

Show the status of platform services (KV store, database) for the current project.

maravilla platform status

maravilla platform kv

Browse the KV store interactively using a terminal UI. Requires the dev server to be running.

maravilla platform kv
FlagShortDefaultDescription
--namespace-nKV namespace to browse
--urlhttp://localhost:3001Dev server URL

Example:

maravilla platform kv --namespace sessions --url http://localhost:3001

maravilla platform db

Browse database collections interactively using a terminal UI. Requires the dev server to be running.

maravilla platform db
FlagShortDefaultDescription
--collection-cCollection to browse
--urlhttp://localhost:3001Dev server URL

Example:

maravilla platform db --collection users

maravilla login

Log in to Maravilla Cloud. Opens an interactive authentication flow.

maravilla login

maravilla register

Create a new Maravilla Cloud account.

maravilla register

maravilla logout

Log out from Maravilla Cloud and clear stored credentials.

maravilla logout

maravilla whoami

Show the current authentication status and logged-in user.

maravilla whoami

maravilla update

Update the Maravilla CLI binary to the latest version.

maravilla update

maravilla deploy

Deploy your application to a target environment. This command is under active development.

maravilla deploy
FlagShortDescription
--environment-eTarget environment (defaults to production)
--dry-runPerform a dry run without deploying

Typical Workflow

# 1. Initialize your project
maravilla init

# 2. Develop with hot reload
maravilla dev --open

# 3. Build for production
maravilla build --snapshot

# 4. Preview the production build locally
maravilla preview --snapshot

# 5. Authenticate and deploy
maravilla login
maravilla deploy