module
Lapis::Docs::B_LAPIS_CLI_AND_TOOLCHAIN::C_INIT_AND_SCAFFOLD
Overview
Project Initialization & Scaffolding
Complete guide to scaffolding brand new Crystal Godot games, redistributable GDExtension addons, or integrating Crystal into an existing GDScript project.
Executive Summary & Key Topics
| Topic | Method / Anchor | Description |
|---|---|---|
| Available Scaffolding Modes | .topic_00_scaffolding_targets |
Listing of project archetypes that can be generated. |
| lapis init: Existing Project Integration | .topic_01_init_command |
Adding Crystal support to an existing Godot 4.x project without disrupting GDScript. |
| lapis new game: Scaffolding a Game | .topic_02_new_game |
Generating a fresh, production-ready standalone game project. |
| lapis new addon: Scaffolding an Addon | .topic_03_new_addon |
Creating a redistributable GDExtension plugin for the Godot Asset Library. |
Related Guides & Source References
- Init Implementation:
tools/lapis/src/commands/init.cr - Scaffold Implementation:
tools/lapis/src/commands/scaffold.cr - Templates:
template/,template-addon/
Defined in:
libgodot/docs/b_lapis_cli_and_toolchain/c_init_and_scaffold.crClass Method Summary
-
.topic_00_scaffolding_targets : Nil
Available Scaffolding Modes: Listing of project archetypes that can be generated.
-
.topic_01_init_command : Nil
lapis init: Existing Project Integration: Adding Crystal support to an existing Godot 4.x project without disrupting GDScript.
-
.topic_02_new_game : Nil
lapis new game: Scaffolding a Game: Generating a fresh, production-ready standalone game project.
-
.topic_03_new_addon : Nil
lapis new addon: Scaffolding an Addon: Creating a redistributable GDExtension plugin for the Godot Asset Library.
Class Method Detail
Available Scaffolding Modes: Listing of project archetypes that can be generated.
Key Topics & Information
- Standalone Game: lapis new game
- GDExtension Addon: lapis new addon
- Showcase Example: lapis new example
- Existing Project Integration: lapis init
lapis init: Existing Project Integration: Adding Crystal support to an existing Godot 4.x project without disrupting GDScript.
If you already have a Godot project and want to write high-performance nodes in Crystal:
cd my_godot_project
lapis init
What lapis init Does:
- Generates
shard.ymlwith dependencies onlibgodot. - Creates
src/main.crwith a sample node definition. - Stages
addons/crystal_integrationand configuresproject.godotto load it. - Staged runtime dependencies into
bin/. - Configures
.gdignoreinsidelib/and build directories to prevent Godot from scanning Crystal dependencies.
lapis new game: Scaffolding a Game: Generating a fresh, production-ready standalone game project.
To scaffold a new game project:
lapis new game space_invaders [options]
Options:
-d, --dir=PATH: Custom destination directory (default:./<name>).--author="Name <email>": Author metadata forshard.yml.--desc="Description": Game description.--skip-shards: Skip initialshards install.
lapis new addon: Scaffolding an Addon: Creating a redistributable GDExtension plugin for the Godot Asset Library.
To create a plugin or library intended for other Godot developers:
lapis new addon dialogue_graph
Addon Architecture:
- Generates
addons/<name>/plugin.cfgandplugin.gd. - Contains a custom
EditorPluginnode. - Sets up isolated packaging rules so your addon can be distributed as a standalone
.zip.