cli

Project, dependency-graph, native-build and bundling tool for Garnet games

garnet-cli

The garnet command-line tool. It handles project files, the shard dependency graph, CRYSTAL_PATH, cached native builds, macOS bundles and toolchain checks for Garnet games.

Run it with scripts/garnet, which compiles this shard into .garnet/bin on first use. See docs/getting-started.md for the workflow and docs/project.md for the garnet.project.json schema.

File Responsibility
src/garnet-cli/manifest.cr shard.yml parsing
src/garnet-cli/workspace.cr shard discovery and requirement resolution
src/garnet-cli/graph.cr transitive dependency graph
src/garnet-cli/crystal_path.cr CRYSTAL_PATH from a graph
src/garnet-cli/natives.cr postinstall native builds with fingerprint stamps
src/garnet-cli/project.cr garnet.project.json parsing and validation
src/garnet-cli/requires.cr require scanning for deps check
src/garnet-cli/unwind.cr DWARF-unwind linking for macOS builds that mix more than three exception runtimes (see docs/project.md)
src/garnet-cli/build.cr, bundle.cr, doctor.cr, scaffold.cr commands, including the generated game and editor runners and garnet scene (headless scene commands run in the editor build)
src/garnet-cli/timings.cr compile timings from crystal build --stats
templates/new/ files written by garnet new

garnet build --timings records how long each compiler phase took, the compiler's memory after it, and how many object files were reused, in .garnet/build/<target>-<debug|release>/timings.json. With --json the result includes the same timings. The editor passes --timings on every build and shows the last build's phases in its Diagnostics panel.

crystal spec in this directory runs the specs. They need no other shards.

Repository

cli

Owner
Statistic
  • 0
  • 0
  • 0
  • 1
  • 0
  • about 8 hours ago
  • November 30, 2026
License

MIT License

Links
Synced at

Wed, 02 Dec 2026 03:09:24 GMT

Languages