1
1
Fork
You've already forked crystalscript
0
A CLI that allows to use Crystal as a scripting language by caching build artefacts.
  • Crystal 100%
2026年02月17日 01:46:25 +01:00
LICENSES Proof of Concept 2026年02月02日 00:31:37 +01:00
spec 0.3.1 Refactoring + minor improvements 2026年02月17日 01:46:25 +01:00
src 0.3.1 Refactoring + minor improvements 2026年02月17日 01:46:25 +01:00
.gitignore Add SQLite-based cache manifest with cache management commands 2026年02月02日 22:14:41 +01:00
README.md Update README.md 2026年02月08日 11:18:50 +01:00
shard.lock Add SQLite-based cache manifest with cache management commands 2026年02月02日 22:14:41 +01:00
shard.yml 0.3.1 Refactoring + minor improvements 2026年02月17日 01:46:25 +01:00

CrystalScript

A CLI that allows using Crystal as a scripting language by caching compiled binaries.

Install

shards build --production && mv bin/crystalscript ~/.local/bin/crystalscript

Usage

Run any Crystal script directly:

crystalscript my_script.cr

Make scripts executable with a shebang:

#!/usr/bin/env crystalscript
puts "Hello!"

Then:

chmod +x my_script.cr
./my_script.cr

Compilation Modes

You can specify different compilation modes with the -m/--mode argument.

normal is the default, it will produce an optimized binary with debug symbols.

#!/usr/bin/env crystalscript
## or
#!/usr/bin/env -S crystalscript --mode normal

release will compile an optimized binary without debug symbols, resulting in a much lighter binary.

Use it if you don't need the debug symbols and you want the cached binary to take as less space as possible.

#!/usr/bin/env -S crystalscript --mode release

dev will optimize for compilation speed, with debug symbols, resulting in a heavy binary.

Use it when you want to iterate faster when developing your script.

#!/usr/bin/env -S crystalscript --mode dev

More info about the usage of -S in the shebang line

Release Checklist

  • Increment version in shard.yml
  • If schema changed, increment SCHEMA_VERSION in db.cr
  • Git tag with new version