First project and local packages
Source:
docs/guides/first-project.md· revision42e1817227fbc96e8e4a4a85fac78b3fec0a0e0f· blob541f14bd446fee2df6c2bcc525a44b8f3550365d· MIT license.This is a static reading copy. Ori and its full documentation remain canonical in the source repository.
Português: Primeiro projeto e pacotes locais
Status: practical guide for Ori S3 + inference B / workspace 0.3.8-dev. Root-first layout (
ori.proj+main.orl); see spec 17 in the canonical repository.
Create a project
Section titled “Create a project”ori new democd demoori check main.orlori run main.orlori new creates:
demo/ ori.proj # entry = "main.orl" main.orlThere is no required src/ folder. docs/ is optional for .oridoc sidecars. Put more modules in domain folders if you want (board/, api/, …).
Main CLI commands
Section titled “Main CLI commands”ori check main.orlori run main.orlori compile main.orl --out demoori fmt main.orlori doctorori summary .Tests — mark functions with @test:
module demo.mainimport ori.test as test@testmath_is_stable()test.assert(1 + 1 == 2, "math should work")endori test main.orlLocal library dependency
Section titled “Local library dependency”workspace/ app/ ori.proj ori.pkg.toml main.orl math/ ori.pkg.toml lib.orlmath/ori.pkg.toml:
[package]name = "demo.math"version = "0.1.0"entry = "lib.orl"ori_version = "0.3.8"math/lib.orl:
module demo.mathpublic double(value: int) -> intreturn value * 2endapp/ori.proj:
manifest = 1name = "demo.app"version = "0.1.0"kind = "app"entry = "main.orl"[source]root_namespace = "demo.app"[dependencies]demo.math = { path = "../math", version = "0.1.0" }app/main.orl:
module demo.appimport demo.math (double)import ori.io as iomain()io.println(string(double(21)))endcd workspace/appori check main.orlori run main.orlInstall into the local package cache
Section titled “Install into the local package cache”ori install demo.app --path .# cache: ~/.ori/packages/<name>/<version>/ORI_PACKAGE_CACHE=./cache ori install demo.app --path .The local installer validates manifests, copies files, does not execute package code, and rejects symlinks during copy.
An optional registry can be local or HTTP through ORI_REGISTRY:
ori publish . --registry /path/to/registryori install other.pkg@0.1.0See the canonical registry planning document; this is not a marketplace product push.
After upgrading Ori
Section titled “After upgrading Ori”- Read the canonical changelog.
- Run
ori checkandori test. - For pre-S3 syntax, use
ori migrate-syntax ..
Next: Cookbook · Language tour · Install · Examples