CRYSTAL-SPEC(1)

πŸ“¦
version 1.22.2 Β· 3 versions
, in arch rolling

πŸ¦‹ crystal-spec β€” like, the whole manual bestie πŸ¦‹

okay so this is the crystal-spec page from the Crystal Compiler Command Line Reference Guide, and I'm gonna walk you through it like we're texting at 1am πŸ’… no cap, every flag is here, nothing skipped.


✨ NAME ✨

crystal-spec β€” compile and run Crystal spec files πŸŽ€

that's it. that's the whole vibe. it compiles your specs and runs them. iconic behaviour honestly.


✨ SYNOPSIS ✨

crystal spec [options] [files]

so you say crystal spec, you throw some options at it, you optionally point it at specific files, and it goes πŸƒβ€β™€οΈπŸ’¨


✨ OPTIONS ✨

  • -d, --debug β€” generates the output with symbolic debug symbols πŸ›βœ¨ these get read when you're debugging the built program with tools like lldb, gdb, valgrind etc., and they give those tools mappings back to your original source code. so when something goes feral you actually know where πŸ’€
  • --no-debug β€” generates the output with zero symbolic debug symbols. none. not a crumb πŸ™ˆ
  • -D FLAG, --define FLAG β€” defines a compile-time flag 🚩 this is the move when you wanna conditionally define types, methods, or commands based on flags that are available at compile time. the default flags come from the target triple you gave with --target-triple, or the host's default if you didn't give one 🫢
  • --error-trace β€” shows the full error trace 😭 the whole thing. every layer.
  • -O LEVEL β€” optimization mode, bestie: 0 (default), 1, 2, 3 πŸ”₯ see OPTIMIZATIONS for the details.
  • --release β€” compiles in release mode πŸ‘‘ literally equivalent to -O3 --single-module. say less.
  • -s, --stats β€” prints statistics about the different compiler stages for the current build πŸ“Š outputs time and used memory for each compiler process. the way it just tells you everything.
  • -p, --progress β€” prints statistics about the progress for the current build ⏳ so you're not just staring at the terminal wondering if it's alive.
  • -t, --time β€” prints statistics about the execution time ⏱️ yes queen, tell me how long you took.
  • --no-color β€” disables colored output 🌈➑️🚫 for when your terminal is being extra or you're piping stuff somewhere that doesn't deserve the rainbow.
heads up: -O sends you to the OPTIMIZATIONS section for the details, so that's where the deets live ✨

🌸 aaaand that's the page!! this one's from crystal 1.22.2, dated 2026-10-30 β€” so like, go forth and run your specs, bestie, you're gonna slay πŸ’œπŸ«Ά

πŸ“¦ where this page comes from