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

Defined in:

libgodot/docs/b_lapis_cli_and_toolchain/c_init_and_scaffold.cr

Class Method Summary

Class Method Detail

def self.topic_00_scaffolding_targets : Nil #

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

def self.topic_01_init_command : Nil #

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:

  1. Generates shard.yml with dependencies on libgodot.
  2. Creates src/main.cr with a sample node definition.
  3. Stages addons/crystal_integration and configures project.godot to load it.
  4. Staged runtime dependencies into bin/.
  5. Configures .gdignore inside lib/ and build directories to prevent Godot from scanning Crystal dependencies.

def self.topic_02_new_game : Nil #

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 for shard.yml.
  • --desc="Description": Game description.
  • --skip-shards: Skip initial shards install.

def self.topic_03_new_addon : Nil #

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.cfg and plugin.gd.
  • Contains a custom EditorPlugin node.
  • Sets up isolated packaging rules so your addon can be distributed as a standalone .zip.