Native software, documented for agents.
Nyx compiles to native code through LLVM, hosts its own compiler and ships every project with what an AI agent needs to write it correctly.
Install
$curl -sSf https://nyxlang.com/install.sh | sh
Linux · x86_64 / aarch64 / armv7l · Termux
01 Install
One command to install it. One to start a project.
| Requires | clang, make and git, plus the libgc, OpenSSL and zlib development headers. The installer installs whatever is missing with the package manager it finds: apt, dnf, pacman, apk, xbps, or pkg on Termux. |
|---|---|
| Installs to | ~/.nyx, with a link at ~/.local/bin/nyx (on Termux, $PREFIX/bin/nyx). If that directory is not on your PATH, the installer adds it to your shell profile and tells you. |
| Verify | nyx --version — prints the installed version. |
| Update | nyx update — pulls the new version, rebuilds it and prints what changed. |
| Remove | nyx uninstall — removes the toolchain and the link it created. |
First projectterminal
$ nyx init my-app creates nyx.toml, src/main.nx, AGENTS.md and docs/nyx/$ cd my-app$ nyx run builds the project and runs it
Sample
What the language reads like.
sample.nxnyx
enum Shape { Circle(int), Square(int), Rect(int, int) } fn area(s: Shape) -> int { return match s { // exhaustive: every variant must be covered Shape.Circle(r) => 3 * r * r, Shape.Square(l) => l * l, Shape.Rect(w, h) => w * h } } fn main() { let rect: Shape = Shape.Rect(3, 7) print("area = ${area(rect)}") }
| Shows | An enum with an exhaustive match over every variant, string interpolation and explicit types on every binding. |
|---|---|
| Checked with | nyx check — parses and type-checks, without linking and without running. |
| Run it | nyx sample.nx |
02 Docs
The guide, step by step.
- 01Installrequirements, what lands where, how to update and how to remove it.
- 02First programfrom a single .nx file to a native binary you can ship.
- 03Projectsnyx.toml, src/, tests/ and dependencies.
- 04AgentsAGENTS.md, CAPABILITIES.md and docs/nyx/: the context an assistant reads.
- 05Command lineevery subcommand: build, run, check, vet, fmt, test, add, update.
- 06Syntaxtypes, enums, exhaustive match, Result and the ? operator.
03 Develop with agents
Every project ships the context an agent needs to write it.
Seeded by nyx init
| AGENTS.md | The playbook: how to build a program here, the hard rails, the traps that break a first try. Provider-neutral, following the agents.md convention. |
|---|---|
| CAPABILITIES.md | Generated index of the standard library — what already exists, so nothing gets reinvented. Regenerated on every build. |
| docs/nyx/ | The dense reference plus three guides: write a program, fix a compile error, report friction. |
Tooling
- nyx vetNames the grep-able traps instead of leaving a parser error:
warning[W101] src/main.nx:12 - nyx init --agent=claude,cursor,copilotAn optional short adapter file per tool. AGENTS.md stays the single source of truth; the adapter only points at it.
- nyx init --sddSeeds the spec-driven scaffolding: constitution, glossary, ADR template and specs/ — so the agent asks instead of inventing.
- nyx reportLeaves a FRICTION.md in the project. Nothing is sent on its own.
AGENTS.md — seeded by nyx initexcerpt
> **GOLDEN RULE — do NOT read the compiler or stdlib source** (`std/`, `compiler/`, or > anything under your Nyx install) "to understand how it works". You don't need to and > you WILL get lost. If you want a function, look it up in `CAPABILITIES.md`. … ## Hard rails (do NOT do these) - **Do NOT invent syntax.** If you're unsure a keyword/feature exists, it probably doesn't — check `CAPABILITIES.md` (or <https://nyxlang.com/by-example/>) instead of guessing. - **Do NOT reinvent stdlib functionality.** If `CAPABILITIES.md` lists it, use it. - **Do NOT hack around a limitation.** Report it with `nyx report` and stop. …
04 Source
Open, versioned, and honest about being 0.x.
| License | Apache-2.0 |
|---|---|
| Repository | https://github.com/nyxlang-dev/nyx |
| Changelog | CHANGELOG.md — every release, with what changed and why. |
| Status | 0.x: under active development. The API can change, and compatibility between minor versions is not guaranteed. |