My justfile to quick bootstrap and start journey with Odin

modinfo1 pts0 comments

my justfile to quick bootstrap and start journey with odin · GitHub

/" data-turbo-transient="true" />

Skip to content

-->

Search Gists

Search Gists

Sign in

Sign up

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

Instantly share code, notes, and snippets.

skorotkiewicz/justfile

Created<br>July 17, 2026 05:58

Show Gist options

Download ZIP

Star

(0)

You must be signed in to star a gist

Fork

(0)

You must be signed in to fork a gist

Embed

Select an option

Embed<br>Embed this gist in your website.

Share<br>Copy sharable link for this gist.

Clone via HTTPS<br>Clone using the web URL.

No results found

Learn more about clone URLs

Clone this repository at &lt;script src=&quot;https://gist.github.com/skorotkiewicz/33e92829cecc98381760faec49b54851.js&quot;&gt;&lt;/script&gt;

" readonly="readonly" data-autoselect="true" data-target="primer-text-field.inputElement " aria-describedby="validation-d40df968-ea35-4310-a023-fbc231acd0e5" class="form-control FormControl-monospace FormControl-input FormControl-small rounded-left-0 rounded-right-0 border-right-0" type="text" name="gist-share-url-sized-down" />

Save skorotkiewicz/33e92829cecc98381760faec49b54851 to your computer and use it in GitHub Desktop.

Embed

Select an option

Embed<br>Embed this gist in your website.

Share<br>Copy sharable link for this gist.

Clone via HTTPS<br>Clone using the web URL.

No results found

Learn more about clone URLs

Clone this repository at &lt;script src=&quot;https://gist.github.com/skorotkiewicz/33e92829cecc98381760faec49b54851.js&quot;&gt;&lt;/script&gt;

" readonly="readonly" data-autoselect="true" data-target="primer-text-field.inputElement " aria-describedby="validation-72e35ca7-3461-479d-bf99-8d39620f593a" class="form-control FormControl-monospace FormControl-input FormControl-small rounded-left-0 rounded-right-0 border-right-0" type="text" name="gist-share-url-original" />

Save skorotkiewicz/33e92829cecc98381760faec49b54851 to your computer and use it in GitHub Desktop.

Download ZIP

my justfile to quick bootstrap and start journey with odin

Raw

justfile

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.<br>Learn more about bidirectional Unicode characters

Show hidden characters

# https://github.com/casey/just

set shell := ["bash", "-uc"]

odin_dir := env_var("HOME") / "odin-dev"

odin := odin_dir / "odin"

odinfmt := odin_dir / "odinfmt"

source := "src"

binary := `basename "$PWD"` # binary have always the name as your current directory

odin_release_api := "https://api.github.com/repos/odin-lang/Odin/releases/latest"

ols_release_api := "https://api.github.com/repos/DanielGavin/ols/releases/latest"

[private]

default:

@just --list

# Install the latest official Odin release.

setup:

#!/usr/bin/env bash

set -euo pipefail

if [[ ! -x "{{odin}}" ]]; then

case "$(uname -s)-$(uname -m)" in

Linux-x86_64) platform=linux-amd64 ;;

Linux-aarch64) platform=linux-arm64 ;;

Darwin-x86_64) platform=macos-amd64 ;;

Darwin-arm64) platform=macos-arm64 ;;

*) echo "error: unsupported platform" >&2; exit 1 ;;

esac

tag="$(curl -fsSL "{{odin_release_api}}" | jq -r .tag_name)"

url="https://github.com/odin-lang/Odin/releases/download/$tag/odin-$platform-$tag.tar.gz"

mkdir -p "{{odin_dir}}"

curl -fL "$url" |

tar -xz --strip-components=1 -C "{{odin_dir}}"

fi

if [[ ! -x "{{odinfmt}}" ]]; then

tag="$(curl -fsSL "{{ols_release_api}}" | jq -r .tag_name)"

tmp="$(mktemp -d)"

trap 'rm -rf "$tmp"' EXIT

curl -fL "https://github.com/DanielGavin/ols/archive/refs/tags/$tag.tar.gz" |

tar -xz --strip-components=1 -C "$tmp"

cd "$tmp"

"{{odin}}" build tools/odinfmt/main.odin \

-file \

-collection:src=src \

-out:"{{odinfmt}}" \

-o:speed

fi

"{{odin}}" version

# Remove generated files.

clean:

rm -rf "{{binary}}"

# Build.

build: setup

{{odin}} build "{{source}}" -out:"{{binary}}" -o:speed

build-debug: setup

{{odin}} build "{{source}}" -out:"{{binary}}" -debug -o:none

build-size: setup

{{odin}} build "{{source}}" -out:"{{binary}}" -o:size

build-native: setup

{{odin}} build "{{source}}" -out:"{{binary}}" -o:aggressive -microarch:native

build-timings: setup

{{odin}} build "{{source}}" -out:"{{binary}}" -o:speed -show-more-timings

# Check.

check: setup

{{odin}} check "{{source}}"

vet: setup

{{odin}} check "{{source}}" -vet -vet-tabs -vet-style -vet-semicolon

lint: setup

{{odin}} check "{{source}}" \

-vet \

-vet-tabs \

-vet-style \

-strict-style \

-warnings-as-errors

# Format project Odin files.

fmt: setup

"{{odinfmt}}" "{{source}}" -w

# Run.

run *args: setup

{{odin}} run "{{source}}" -debug -- {{args}}

exec *args: build

"./{{binary}}"...

odin build gist source setup github

Related Articles