This repository contains the configuration system and compiler for the Wiz typed shell language. The compiler accepts .wiz and .d.wiz source, preserves shell-oriented syntax, performs binding and static type checking, lowers typed constructs, and emits executable shell with source maps.
Published packages:
@wiz-sh/configdiscovers, merges, validates, and normalizesconfig.wiz.json.@wiz-sh/compilerexposes the stable parse, program, diagnostics, checking, lowering, emission, and source-map APIs.
source text → lexer → lossless syntax tree → AST → binder → checker
→ lowering → target backend → emitted shell + source map
The compiler is handwritten and deliberately keeps its phases in one repository so syntax, semantic, and backend changes can evolve together. Bash, Zsh, POSIX sh, Fish, PowerShell, and cmd targets share an explicit backend boundary; target-specific diagnostics reject constructs that cannot be preserved safely.
Wiz also models byte streams separately from shell strings. This makes null-delimited and binary workflows explicit instead of pretending shell variables can hold NUL bytes.
import {
checkProgram,
createCompilerHost,
createProgram,
emitProgram,
getDiagnostics,
parseSourceFile,
} from "@wiz-sh/compiler";Only stable entry points are exported. Formatter, linter, language service, and other consumers should not import private phase modules.
bun install
bun run check
bun run buildThe test suite includes lexer and parser recovery, binding, type checking, runtime-check insertion, target emission, source maps, bash -n, executable fixtures, and differential shell behavior. Linux and macOS CI additionally exercise installed shell targets.
See the Wiz documentation for language syntax and target behavior. Licensed under MIT.