Skip to content

CLI Reference

chad <command> [options] <file>

Commands

CommandDescription
chad build <file>Compile to a native binary (output: .build/<name>)
chad run <file>Compile and immediately run
chad watch <file>Watch for changes, recompile and re-run on save
chad initGenerate chadscript.d.ts, tsconfig.json, and a starter file for editor support
chad cleanRemove the .build directory
chad ir <file>Emit LLVM IR without compiling — useful for debugging codegen
chad targetManage cross-compilation SDKs (list, add <target>, remove <target>)

Options

OptionDescription
-o <output>Output file path
--target <target>Cross-compile for a different platform
-v, --verboseShow compilation steps
-gEmit DWARF debug info for use with gdb/lldb
--keep-tempsKeep intermediate .ll and .o files
--link-obj <path>Link an external object file or static library (repeatable)
-fsanitize=addressBuild with AddressSanitizer

Cross-Compilation

bash
chad target add linux-x64        # install the SDK (one-time)
chad build app.ts --target linux-x64

Only linux-x64 is currently supported as a cross-compile target. SDKs are installed to ~/.chadscript/targets/.