Skip to content

Your first project

Odyn vendors Odin dependencies as plain git clones under deps/ and pins each one to an exact commit in Odyn.lock. Once it is installed, here is the loop for a first project.

Terminal window
odyn init myapp
cd myapp

This creates an Odin project with a main.odin, an ols.json that maps the deps collection, an empty Odyn.lock, and a git repository. Pass . (or leave empty default) to scaffold in the current directory instead.

odyn get clones a repository into deps/ and records its commit in Odyn.lock. Point it at any git host:

Terminal window
# short form resolves against the default forge (GitHub)
odyn get odin-lang/examples
# choose a forge with -p/--platform
odyn get user/repo -p codeberg
# or pass a full URL
odyn get https://codeberg.org/user/repo

Useful flags:

  • -n, --name sets the folder under deps/ (defaults to the repo name).
  • -t, --tag resolves a tag. Use latest for the newest semver tag, or a specific tag like v1.2.0.

The scaffolded ols.json maps a deps collection, so you import a dependency by its folder name:

import ex "deps:examples"

Build your project with the same collection flag:

Terminal window
odin build . -collection:deps=deps

Next: learn the daily workflow for keeping dependencies in sync.