Installation¶
Graphcal is a single command-line program, graphcal. Prebuilt binaries are available for Linux (x86_64, ARM64), macOS (Intel, Apple Silicon), and Windows (x86_64).
Install with the installer script¶
On macOS and Linux:
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/graphcal-lang/graphcal/releases/latest/download/graphcal-installer.sh | sh
On Windows (PowerShell):
powershell -ExecutionPolicy Bypass -c "irm https://github.com/graphcal-lang/graphcal/releases/latest/download/graphcal-installer.ps1 | iex"
Open a new terminal afterwards so that graphcal is on your PATH. To update Graphcal, run the same command again.
Install with a package manager¶
While Graphcal is a pre-release, these commands need an explicit version. Replace <version> with a version from the releases page, such as 0.0.1-alpha.35.
cargo-binstall¶
cargo-binstall downloads the prebuilt binary:
cargo install¶
cargo install builds Graphcal from crates.io. It requires Rust 1.99 or later, which you can get from rustup.rs:
Build from source¶
Building from a source checkout requires these tools:
- The Rust toolchain pinned in
rust-toolchain.toml, managed by rustup. - Its
wasm32-unknown-unknowntarget (rustup target add wasm32-unknown-unknownfrom the repository root). wasm-bindgen-climatching the resolvedwasm-bindgenversion inCargo.lock:cargo install wasm-bindgen-cli --version <locked-version> --locked.- Binaryen's
wasm-optonPATH. CI uses Binaryen 117; prebuilt distributions are available from Binaryen releases.
Then build as usual:
The first build takes longer than usual. cargo check and Clippy also need these tools.
Verify Installation¶
Use in GitHub Actions¶
The setup-graphcal action installs graphcal on a GitHub Actions runner. This workflow checks the .gcl files and evaluates a model on each push and pull request:
name: Graphcal
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: graphcal-lang/setup-graphcal@v1
with:
version: 0.0.1-alpha.35
- run: graphcal check
- run: graphcal eval model.gcl
The job fails when an assertion fails. Graphcal still changes between alpha releases, so pin version to keep the results reproducible. See the action's README for other options.
Editor Setup¶
For the best experience, set up editor integration to get syntax highlighting, diagnostics, and inlay hints showing computed values. See Editor Setup for VS Code, Zed, Helix, and Neovim instructions.
Next Steps¶
Proceed to the Tutorial to write your first Graphcal file.