Command line

Every flag nish --help lists, in the order and the groups it lists them. The CLI in the guide shows them at work; the diagnostic index lists every code a check can report.

Usage

nish <file.ts> [more.ts ...] [flags]   compile to LLVM IR
nish run [flags] <file.ts> [args ...]  build, cache and run it
nish run --watch <file.ts> [args ...]  rebuild and rerun it on each edit
nish upgrade [<version>] [--check]     install a newer release
nish -v, --version | -h, --help

Dialect

--compat[=<feature>,...]

compatibility dialect; implies f64 numbers

--number-modei32|f64

what a bare number is; i32 by default

Build

--link<exe>

link a native binary; the entry exports main

--profilespeed|size|debug|wasi

the link recipe; speed is -O3 with LTO

--cpux86-64-v3

allow AVX2; such a binary needs it to start

--pgo-generate

link a binary that writes a .profraw per run

--pgo-use<file.profdata>

optimise the link with a merged profile

--target<triple>|host

stamp the IR with a target's data layout

--threads

an arena per thread, for --emit-napi-async

--debug-arena

trap a stale arena reference; for tests, slow

--host<file.ts>

a page module whose functions wasm imports

--plain

the IR without LLVM's attributes

--no-strict-exports

keep every function externally visible

--no-stack-alloc

keep every value off the stack

Output

-o, --output<file.ll>|<dir>/

where the IR goes; a dir gets one per module

-g

DWARF debug info, for gdb and lldb

--runtime-decls

declare the runtime even when unused

--emit-header<file.h>

a C header for the exports

--emit-dts<file.d.ts>

their typings, and a <file>.mjs loader

--emit-napi<shim.c>

a Node-API shim, to load them from Node

--emit-napi-async<shim.c>

the same, plus a promise for each export

--emit-ts<dir>

the program as TypeScript, instead of IR

--emit-ast

print the parse tree, one line per node

--emit-checked

print what the checker recorded

--emit-panics<file.json>

list every place the program can panic

--emit-arena<file.json>

write the arena retention report

--emit-capabilities<file.json>

write the capability report

Diagnostics

--fix

apply the safe fixes in place, then recheck

--json

each diagnostic as one JSON line on stdout

--warn-portability

warn where TypeScript would answer otherwise

--no-warn-performance

silence the performance warnings

--explain-memory

why loops and functions keep their memory

--explain-layout

which classes the compact-class rule picks

--capabilities

print what the program can reach, on stderr

Policy

--allow<cap>[,<cap>...]

refuse a program that reaches more

--deny<cap>[,<cap>...]

refuse a program that reaches these

--deny-panics

refuse an unproven panic in your package

--deny-retention

refuse retained arena memory in your package

--deterministic

same float bits everywhere, no clock or I/O

--sandbox[=best-effort]

confine a Linux binary to what main reaches

--update-capability-lock

record what each dependency reaches

Agents

nish --help prints this section only when an agent runs it: Colour, and when an agent runs nish says how it tells.

before writing Nish, read the language as rules, traps first:

docs/AI.md, at the path the install put it.

--json

diagnostics as JSON lines, fixes included

--fix

apply those fixes; read only what is left

nish run <file.ts>

what the program prints, once it compiles

Exit codes

0 ok, 1 rejected, 2 usage, 3 toolchain, 70 a compiler bug: report it

What each one means is the guide's exit codes table.

Examples

nish run hello.ts       # build, cache and run a program
nish app.ts --link app  # write app.ll and a binary, app
nish --fix src/*.ts     # rewrite what the compiler can fix
NO_COLOR=1 nish --help  # this text, without colour