Getting Started
You can go from an empty directory to a checked, tested, native Khora executable in a few minutes.
Two things worth knowing before you start. khora std search <query> finds
anything in the standard library from the terminal — it reads the compiler’s
own view of the std beside it, so it is never out of step with the toolchain
you have. And the compiler’s error messages name the fix, not just the
problem; reading them is usually faster than searching these pages.
1. Install Khora
Section titled “1. Install Khora”On macOS or Linux:
curl -fsSL https://raw.githubusercontent.com/codyspate/khoralang/main/install.sh | shOn Windows, in PowerShell:
irm https://raw.githubusercontent.com/codyspate/khoralang/main/install.ps1 | iexVerify the toolchain is available:
khora --versionIf the installer asks for a system linker, follow the platform-specific instructions in Installation.
2. Create a package
Section titled “2. Create a package”khora new hello_khoracd hello_khoraThat writes the whole package:
hello_khora/├── khora.toml└── src/ └── main.khkhora.toml names the package:
[package]name = "hello_khora"version = "0.1.0"and src/main.kh is a program that compiles:
module hello_khora::main;
pub fn main() -> Int { 0}A package name is a module path segment, so it is letters, digits and
underscores — hello_khora, not hello-khora. khora new says so rather than
creating something that will not compile.
Add khora new --lib for a library, which writes src/lib.kh and no main.
Make it print something:
module hello_khora::main;
import std::core::{print};
pub fn main() -> Int { print("Hello, Khora!"); 0}3. Run it
Section titled “3. Run it”khora run .Hello, Khora!khora run compiles and starts the program, and gives you its exit status as
its own — so it behaves in a script the way running the executable would. The
build is cached, so the second run starts immediately.
To get an executable you can hand to somebody:
khora check .khora build ../build/hello_khoraA build writes into the package’s own build/ directory, named after the
package – build/hello_khora here, and build\hello_khora.exe on Windows,
where the same two commands run it as .\build\hello_khora.exe. Nothing
lands among your sources, and build/ is the one directory a package does not
track.
--out overrides the path, and adds the platform’s extension if you did not
write one.
khora check is the fast feedback command: it parses and resolves your package, checks types and exhaustiveness, and reports diagnostics without producing an executable. khora build continues through native code generation and linking.
4. Format and test as you work
Section titled “4. Format and test as you work”Khora ships the formatter and test runner in the same toolchain:
khora fmt .khora test .khora fmt . --check writes nothing and fails if anything is unformatted,
which is the form for CI.
5. Depend on another package
Section titled “5. Depend on another package”A package that needs another names it under [dependencies], by path:
[package]name = "hello_khora"version = "0.1.0"
[dependencies]postgres = { path = "../packages/postgres" }The name on the left is what your import lines say — import postgres::pool::{Pool} — and it need not match the directory. A dependency’s
own dependencies come with it.
Continue with Your first Khora project to add a function and a test and learn the everyday check-format-test-build loop.
6. Set up your editor
Section titled “6. Set up your editor”Khora’s language server is part of the compiler toolchain. Your editor starts khora lsp for you and gets compiler-backed diagnostics, navigation, formatting, and symbol information.
See Editor setup for configuration and the compiler-backed MCP integration for coding agents.
Where to go next
Section titled “Where to go next”- Installation — toolchains, version pinning, source builds, and optional release candidates.
- Your first Khora project — work through the normal package workflow.
- Language Reference — every construct, one page per topic. Its first section is a reading order, from values and functions through effects and structured concurrency.
- Standard Library — find the APIs available once you start building real programs.
Khora 0.1.0built frombd964738afb6on 2026-10-17 20:41ZVersioningSecurityContributingReleasesSource