Getting Started

CLI

Viber3D CLI Reference

Viber3D CLI

The Viber3D CLI provides tools to help you create and manage your Viber3D projects.

Installation

You can use the Viber3D CLI without installing it by using npx:

npx viber3d@latest [command]

Commands

init

Initialize a fresh Viber3D project.

npx viber3d@latest init [dir] [options]

Arguments

  • dir - Project directory (optional)

Options

OptionAliasDescriptionDefault
--nameProject name
--template-tTemplate name or GitHub repositorystarter
--force-fOverride existing directoryfalse
--installInstall dependenciestrue
--gitInitInitialize git repository
--packageManagerPackage manager choice (npm, pnpm, yarn)
--yes-ySkip confirmation promptfalse
--defaults-dUse default configurationfalse
--silent-sMute outputfalse
--help-hDisplay help for command
--cwd-cThe working directoryCurrent directory

Template Options

The --template (or -t) option allows you to specify which template to use:

  • Default template: If not specified, the CLI will prompt you to choose between:
    • starter (recommended, stable) - The default option
    • next (experimental) - Contains upcoming features and changes
  • Named templates: Use -t <template-name> to use a template from the Viber3D templates directory
  • Next template: Use -t next to use the experimental template from the starter-next repository
  • GitHub repositories: Use -t username/repo to use any GitHub repository as a template

Examples

Create a new project with the default template:

npx viber3d@latest init my-game

Create a new project with the "next" template (for upcoming features):

npx viber3d@latest init my-game -t next

Create a new project with a custom GitHub template:

npx viber3d@latest init my-game -t username/repo

Create a new project with default settings (no prompts):

npx viber3d@latest init my-game -y

Project Creation Process

When you run the init command, the CLI will:

  1. Ask for a project name (if not provided)
  2. Check if the directory exists and prompt for action if it does
  3. Prompt for template selection (if not specified and not using --yes or --defaults)
  4. Download the specified template
  5. Prompt for project details (description, author)
  6. Process template files
  7. Update package.json with project details
  8. Install dependencies (unless --install=false)
  9. Initialize git repository (if confirmed)
  10. Display next steps

Configuration

The CLI uses the following configuration files:

  • .gitignore - Git ignore file
  • .cursorignore - Cursor ignore file
  • .prettierrc - Prettier configuration
  • .prettierignore - Prettier ignore file
  • .eslintrc.js - ESLint configuration

These files are automatically created when you initialize a new project.