ghul.cli
0.2.0
Prefix Reserved
See the version list below for details.
dotnet tool install --global ghul.cli --version 0.2.0
dotnet new tool-manifest
dotnet tool install --local ghul.cli --version 0.2.0
#tool dotnet:?package=ghul.cli&version=0.2.0
nuke :add-package ghul.cli --version 0.2.0
ghūl CLI
Run a ghūl script directly, without a project file — on
Linux, including via a #! shebang line.
#!/usr/bin/env ghul
entry(args: string[]) is
IO.Std.write_line("hello, {if args.count > 0 then args[0] else "world" fi}");
si
chmod +x greet.ghul
./greet.ghul world
# hello, world
Or run it directly without the shebang:
ghul greet.ghul world
Commands
ghul <script> [args...] # run, if it looks runnable (see below)
ghul run <script> [args...] # run unconditionally
ghul compile <script.ghul> # compile and print the path to the result
ghul install-compiler [version] # install (or update) ghul.compiler
With no verb, ghul only runs a file that looks like a script: one whose
name ends in .ghul, or one that is executable and starts with #! — the
same file a shell would already agree to run directly. Anything else is
refused, naming ghul run as the way to force it. ghul run runs the given
file regardless, which is also what a #!/usr/bin/env ghul shebang line
invokes.
ghul compile compiles the script (installing the compiler first if
needed) and prints the path to the compiled binary on stdout, with nothing
else — install and compiler diagnostics stay on stderr, so the path is safe
to capture with $(...). It never runs the result.
ghul install-compiler installs ghul.compiler into ghul's own private
tool directory ahead of time, optionally pinned to a given version, so the
first real script run doesn't pay for it. Given no version it installs (or
updates to) the latest; given one already installed, it's a no-op.
Installing
dotnet tool install -g ghul.cli
On first use, ghul installs its own private copy of ghul.compiler (into
~/.local/share/ghul-cli/tools) if one isn't already there — nothing else
to set up first.
How it works
Each script is compiled once per script-content-and-compiler-version pair
and the result cached under ~/.cache/ghul-cli/scripts; a later run of an
unchanged script skips straight to running the cached build. Everything
after the script path is passed through unchanged as the running program's
own command-line arguments, and its exit code becomes ghul's own.
Installing the compiler and compiling a given script are each protected by a file lock, so running several scripts (or the same new one) at once doesn't race two installs or two compiles of the same content against each other — one does the work and the rest wait for it, rather than one of them losing a half-written result to the other.
There are no reference-assembly options: ghul relies entirely on what
ghul.compiler resolves on its own, and doesn't try to add anything it
wouldn't already find.
Building from source
dotnet tool restore
dotnet build
dotnet test unit-tests
./tests/smoke.sh
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.27.2 | 0 | 9/19/2026 |
| 0.27.1 | 0 | 9/19/2026 |
| 0.27.0 | 0 | 9/19/2026 |
| 0.26.1 | 0 | 9/19/2026 |
| 0.26.0 | 0 | 9/19/2026 |
| 0.25.0 | 0 | 9/19/2026 |
| 0.24.1 | 0 | 9/19/2026 |
| 0.24.0 | 0 | 9/19/2026 |
| 0.23.0 | 0 | 9/19/2026 |
| 0.22.0 | 0 | 9/19/2026 |
| 0.21.0 | 0 | 9/19/2026 |
| 0.20.0 | 0 | 9/19/2026 |
| 0.19.3 | 0 | 9/19/2026 |
| 0.19.2 | 0 | 9/19/2026 |
| 0.19.1 | 0 | 9/19/2026 |
| 0.19.0 | 0 | 9/19/2026 |
| 0.18.1 | 0 | 9/19/2026 |
| 0.18.0 | 0 | 9/19/2026 |
| 0.17.1 | 0 | 9/19/2026 |
| 0.2.0 | 81 | 9/10/2026 |