CLI
| Command | Role |
|---|---|
xu build <file|dir> | AOT compilation; directories require xu.xun and combine sources without recursion |
xu run <file|dir> [-- args] | Compile and run for the host; temporary output is removed unless --output is supplied |
xu check <file|dir> | Parse, type-check, and borrow-check without emitting an executable |
xu test <file|dir> | Build and run fn test_* from test.<name>.xu files |
xu install [dir] | Resolve require:, verify dependencies, and populate vendor; defaults to the current directory |
xu fmt [path...] [-w] | Format; -w rewrites files |
xu map [path...] | Generate a flowchart; Mermaid by default, --graph opens a canvas |
xu doc [path...] [--public] [--serve] | Extract Markdown declarations or start a local XUDOCS preview |
xu doctor [--target T] | Check host tools and desktop packaging prerequisites |
xu setup [options] | Launch native Setup installer GUI wizard or run silent global install (provided by sibling xu-setup) |
xu up / xu update | Download and install the official GitHub release package for this system, updating the compiler, tools and standard library |
xu --version | Show the actual compiler version and host target |
Build options
Build, run, and test optimize automatically. Use --no-opt to disable optimization or --debug-build for an unoptimized build with DWARF line tables. --debug adds debug information without changing optimization; --timings prints phase statistics. Target --target wasm32 compiles directly into standard WebAssembly modules.
xu build hello.xu --output hello
xu run hello.xu -- arg1
xu build hello.xu --debug-build --output hello-debug
xu build app/main.xu --target wasm32 --output dist/app.wasm
xu check app/main.xu --offline
xu build app/main.xu --frozen --output app/program
xu test app/ -v
xu doc src/net --public --output net.md
xu doc src/net --public --serve --addr 127.0.0.1:6060
Directory build/check skip test files. Test options include -run, -v, -count, -failfast, -list, -short, -bench, and --cover. xu lsp is not implemented.
Update the toolchain
xu up --check
xu up
xu update --version 0.8.8
xu update --prefix /path/to/sdk
The default selects the latest official GitHub Release and downloads the release package matching the host architecture. The installation is atomically replaced after download and verification succeed. --check only checks versions; --force permits reinstalling or downgrading. Development checkouts require --prefix to install to a separate directory.
--target > XUOS + XUARCH > the running compiler’s host target。In PowerShell prefer --output。
--offline / --frozen: Modules and dependencies。--desktop: UI / WebView。
xu doc --serve serves /、/docs.md、/health。Use xu check for diagnostics.