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
Option | Alias | Description | Default |
---|---|---|---|
--name | Project name | ||
--template | -t | Template name or GitHub repository | starter |
--force | -f | Override existing directory | false |
--install | Install dependencies | true | |
--gitInit | Initialize git repository | ||
--packageManager | Package manager choice (npm, pnpm, yarn) | ||
--yes | -y | Skip confirmation prompt | false |
--defaults | -d | Use default configuration | false |
--silent | -s | Mute output | false |
--help | -h | Display help for command | |
--cwd | -c | The working directory | Current 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 optionnext
(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:
- Ask for a project name (if not provided)
- Check if the directory exists and prompt for action if it does
- Prompt for template selection (if not specified and not using --yes or --defaults)
- Download the specified template
- Prompt for project details (description, author)
- Process template files
- Update package.json with project details
- Install dependencies (unless
--install=false
) - Initialize git repository (if confirmed)
- 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.