Skip to content
Creates a new Cray (Crystal RayLib) project
Crystal Makefile HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Creates a new Cray (Crystal RayLib) project with all dependencies and initial source code:

  • Creates crystal app via crystal init app
  • Copies the Cray RayLib external library to the new app directory (/lib_ext)
  • Creates the projects Makefile to build with the RayLib external library
  • Adds the cray dependency to the project's shard.yml
  • Creates initial Cray source code with a Game class that creates a window and runs game logic (update/draw)


First, checkout the repo, then build the executable by running make or make install. This will build a release of crayster and place in /usr/local/bin similar to Homebrew installs.

To checkout, compile, and install:

$ git clone
$ cd crayster
$ make

Create a new cray project:

$ cd ~/some_projects_code_directory
$ crayster new_cray_game
$ cd new_cray_game

Here is an output of running crayster --help

$ crayster --help

  Creates a new Cray (Crystal RayLib) project, copying required RayLib library


    crayster [--name NAME] [--parent-dir PARENT_DIRECTORY] [NAME]


    -n NAME, --name=NAME             Project name [type:String]
                                     Parent directory to create project directory in [type:String] [default:"./"]
    -t, --test-run                   Test run, only prints, does not execute [type:Bool] [default:false]
    --force                          Passes --force to crystal init app [type:Bool] [default:false]
    --skip-existing                  Passes --skip-existing to crystal init app [type:Bool] [default:false]
    --help                           Show this help.
    -v, --version                    Show version.

  Sub Commands:

    cleanup   cleans up (removes recursively) a project directory


$ crayster FooTest              # creates ./foo_test
$ crayster abc_123              # creates ./abc_123
$ crayster abc_123 ../parent    # creates ../parent/abc_123
$ crayster NewGame ~/code       # creates ~/code/new_game

Development TODOs:

  • crystal init app NAME
  • copy lib_ext/libraylib.dylib (macOS only)
  • copy lib file based on current OS (macOS/Linux/Win) .dylib/.so/.dll
  • make RayLib dynamically from source (using repo) (for macOS only)
  • make RayLib dynamically from source (using repo) for current OS (macOS/Linux/Win)
  • create project Makefile
  • add cray dependency to shards.yml
  • shell of Game class and LibRay game loop logic
  • submit PR to Homebrew


  1. Fork it (
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
You can’t perform that action at this time.