arc init
Initialize a project.
Usage
arc init [project] [options]
Positionals:
project Project directory [string] [default: "."]
Options:
-t, --template Project template
Public GitHub repository, or a folder in one
(user/repo[/folder]) [string]
-y, --yes Accept prompt defaults [boolean] [default: false]
-j, --json Format output as JSON [boolean] [default: false]
-q, --quiet Output only errors [boolean] [default: false]
-C, --cwd Set the working directory [string] [default: "."]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Description
Creates a new project, or prepares an existing one for Arcadible.
New project
When project doesn't exist yet, arc init asks for a template and scaffolds it:
arc init star-drift
arc init star-drift -t arcadible/starters/phaser
arc init star-drift -t my-org/my-template # any public GitHub repository, or a folder in one
arc init star-drift -y # the blank starter, no prompts
| Template | Stack |
|---|---|
arcadible/starters/blank | Blank canvas (default) |
arcadible/starters/threejs | Three.js |
arcadible/starters/phaser | Phaser |
arcadible/starters/pixijs | PixiJS |
arcadible/starters/babylonjs | Babylon.js |
The template question needs a terminal. In CI, scripts, and coding agents, pass -t or -y: without them, arc init fails with No template chosen. and exits with 1.
The template is copied without its Git history, and its LICENSE is removed so you can choose your own. arc init then writes a new id to arcadible.toml, plus a version of 0.1.0-beta.1 unless one can be derived, so the first deploy goes to staging.
Existing project
When project already exists, including the default ., nothing is scaffolded. arc init only adds an id, and a version if one can't be derived, to arcadible.toml. It creates the file if needed and keeps your settings. When it adds either, it rewrites the file, so you lose its comments and formatting:
cd my-existing-game
arc init
Running it again is harmless: an existing id and version are kept.
Output
It prints where the project is, and the template when it created one from a template. With --json:
{
"project": { "path": "/home/you/star-drift", "template": "arcadible/starters/blank" }
}
| Code | When |
|---|---|
0 | The project was created, or its manifest updated |
1 | It failed, such as a template that couldn't be downloaded |
130 | You cancelled the template question |