/ The CLI
Documentation

Getting Started

Language Guide

SDL2 and Graphics

CLI Reference

CLI Reference

The vexel command-line tool is the entry point for compiling, running, and inspecting Vexel programs.

vexel run

JIT-compile a source file and execute it immediately. No output binary is written to disk. This is the fastest way to run a Vexel program during development.

vexel run <file.vx>

Examples

vexel run hello.vx
vexel run examples/fib.vx

vexel compile

Compile a source file to a native binary. The binary can be run independently without Vexel installed.

vexel compile <file.vx> [-o <output>] [--sdl2]
-o <name> Output binary name. Defaults to the stem of the source filename.
--sdl2 Link with SDL2. Required for programs that use SDL2 graphics functions.

Examples

# Produces hello.exe (Windows) or hello (Linux/macOS)
vexel compile hello.vx

# Custom output name
vexel compile hello.vx -o my_program

# Compile a game with SDL2
vexel compile game.vx --sdl2 -o game

vexel ir

Print the generated LLVM IR for a source file to stdout. Useful for understanding how Vexel code maps to low-level operations and for debugging codegen issues.

vexel ir <file.vx>
vexel ir hello.vx

vexel parse

Print the Abstract Syntax Tree (AST) for a source file. Runs the lexer and parser but stops before semantic analysis. Useful for debugging parser behavior or understanding how the language is parsed.

vexel parse <file.vx>

vexel lex

Print the full token stream produced by the lexer for a source file. Each token is shown with its type and value. Useful for debugging tokenization issues or understanding how the lexer handles edge cases.

vexel lex <file.vx>

vexel analyze

Run the semantic analyzer on a source file and print all type errors, undefined names, and other analysis errors. Does not produce a binary. Use this to check a file for errors without running it.

vexel analyze <file.vx>

Command Summary

vexel run file.vx JIT-compile and run immediately
vexel compile file.vx Compile to native binary
vexel compile file.vx -o name Compile with custom output name
vexel compile file.vx --sdl2 Compile with SDL2 support
vexel ir file.vx Print LLVM IR
vexel parse file.vx Print AST
vexel lex file.vx Print token stream
vexel analyze file.vx Type-check without compiling
← SDL2 and Graphics