module
CrShader::Docs::C_EDITOR_TOOLING::C_CLI_AND_STUBS
Overview
CRShader CLI Tool & IDE Stubs
The standalone crshader CLI tool provides command-line building, continuous directory watching,
and rich Crystal IDE autocompletion stubs for VSCode, Neovim, and Sublime Text.
Executive Summary & Key Topics
| Topic | Method / Anchor | Description |
|---|---|---|
| Command-Line Interface Commands | .topic_01_cli_commands |
Complete reference for crshader build, watch, stubs, and install-addon. |
| IDE Autocomplete Stubs (stub_generator) | .topic_02_ide_stubs |
Generating typed Crystal definitions for Godot built-in shader functions and types. |
Related Guides & Source References
- bin/crshader/src/cli.cr
- bin/crshader/src/crshader/stubs/stub_generator.cr
Defined in:
docs/c_editor_tooling/c_cli_and_stubs.crClass Method Summary
-
.topic_01_cli_commands : Nil
Command-Line Interface Commands: Complete reference for crshader build, watch, stubs, and install-addon.
-
.topic_02_ide_stubs : Nil
IDE Autocomplete Stubs (stub_generator): Generating typed Crystal definitions for Godot built-in shader functions and types.
Class Method Detail
Command-Line Interface Commands: Complete reference for crshader build, watch, stubs, and install-addon.
The crshader CLI binary supports several core subcommands:
Command Options & Flags
| Flag / Option | Description |
|---|---|
crshader build |
Compile a .crshader file to .gdshader or .glsl |
crshader watch |
Watch directory for changes and continuously transpile |
crshader stubs -o |
Generate Crystal completion stubs (default: src/libgodot/crshader.cr) |
crshader install-addon |
Copy GDExtension plugin files into a Godot project |
-v, --version |
Print version string |
-h, --help |
Display CLI help information |
Working Examples
# Compile a single shader
bin/crshader build shaders/water.crshader -t gdshader -o shaders/water.gdshader
# Watch shaders folder continuously
bin/crshader watch shaders/
# Generate IDE autocompletion stubs
bin/crshader stubs -o src/libgodot/crshader.cr
IDE Autocomplete Stubs (stub_generator): Generating typed Crystal definitions for Godot built-in shader functions and types.
Because .crshader is valid Crystal syntax, you can use standard Crystal Language Server (LSP)
tooling (such as crystalline or scry) to get full autocompletion, type signatures, and
hover documentation.
Running crshader stubs generates a typed stub file containing every Godot built-in function
(smoothstep, mix, texture, sin, cos, cross, dot, inverse, etc.) with mirrored
Godot 4 documentation comments.
Working Examples
crshader stubs -o src/libgodot/crshader.cr