Skip to main content

AdeshLang CLI Reference

STABLE(CLI toolchain for running, compiling, testing, and formatting AdeshLang projects)

The adesh command-line tool manages the lifecycle of AdeshLang applications: running, type checking, native building, package management, formatting, and diagnostics.


Command Syntax

adesh <COMMAND> [OPTIONS] <FILE> [-- <ARGS>...]

Primary Commands

adesh run <file>

Executes an AdeshLang script file using the selected execution backend (default: Interpreter).

# Run with default interpreter
adesh run app.adesh

# Run with Native JIT compilation (10-230x speedup)
adesh run --jit-native app.adesh

# Run with Bytecode VM engine
adesh run --bytecode app.adesh

adesh build <file>

Compiles an AdeshLang program ahead-of-time (AOT) into a standalone native binary executable.

adesh build main.adesh -o bin/app.exe

adesh doctor

Scans system dependencies, environment variables, compiler toolchain health, and native linker availability.

adesh doctor

adesh env

Displays current AdeshLang environment paths, installation directories, and system configuration.

adesh env

adesh repair

Automatically repairs broken environment settings, toolchain configurations, or corrupted local caches.

adesh repair

adesh pkg <subcommand>

Manages AdeshLang package dependencies.

adesh pkg init
adesh pkg install <package_name>
adesh pkg list

adesh check <file>

Runs full type checking and semantic borrow analysis on a source file without executing it.

adesh check src/main.adesh

adesh format <file> / adesh fmt <file>

Formats AdeshLang source code according to official style guidelines.

# Preview formatting changes
adesh fmt main.adesh

# Apply formatting directly to the file
adesh fmt --write main.adesh

adesh repl

Starts an interactive Read-Eval-Print Loop (REPL) shell for rapid experimentation.

adesh repl

adesh editor [file]

Launches the bundled cross-platform TUI code editor with LSP diagnostics, multiple buffer tabs, workspace explorer, and interactive backend runner.

# Open editor in current workspace
adesh editor .

# Open specific source file
adesh editor src/main.adesh

For full details and keybindings, see the TUI Code Editor Documentation.


Testing Options (adesh run --test)

AdeshLang includes a built-in test runner.

# Run all tests in a test file
adesh run --test tests/math_test.adesh

# Run a specific test by name
adesh run --test --test-name test_addition tests/math_test.adesh

# Stop on first test failure
adesh run --test --fail-fast tests/suite.adesh

# Benchmark across backends (Interpreter vs JIT vs Native JIT)
adesh run --test --backend-check tests/integration.adesh

# Output machine-readable JSON for CI pipelines
adesh run --test --format json tests/suite.adesh > results.json

Execution Backend Flags

FlagBackend ModeDescription
--interpreterInterpreterStandard interpreter (default, 100% feature coverage)
--bytecode, --vmBytecode VMLIR stack-based bytecode virtual machine
--jitLIR JITIntermediate LIR JIT compiler
--jit-native, --njitNative Cranelift JITCompiles LIR directly to native x86_64/ARM machine code at runtime
--adaptive, --ajitAdaptive JITTiered speculative optimization JIT
--gpuGPU MLIRExperimental MLIR lowering target for CUDA/Vulkan (debug builds)

Environment Variables

AdeshLang respects environment variables to configure toolchain execution, process watchdog limits, build defaults, and MLIR GPU pipeline tools.

Environment VariableDescriptionDefault / Format
ADESH_RUN_TIMEOUT_MSProcess watchdog timeout in milliseconds for adesh run. Terminates long-running or hung processes automatically.e.g., 15000 (15s)
ADESH_FAST_COMPILEDefault to fast compile mode (--fast) for adesh build, skipping optimization passes for ~0.3s builds.1 or 0
ADESH_ENABLE_LTOAutomatically enable Link-Time Optimization (LTO) for production builds.1 or 0
ADESH_ENABLE_DCEAutomatically enable Dead-Code Elimination (DCE) in linker for smaller binaries.1 or 0
ADESH_VERBOSEEnable detailed compiler debug logging and linker command invocations.1 or 0
ADESHLANG_HOMECustom root installation directory for AdeshLang libraries and package cache.Path (e.g. ~/.adeshlang)
ADESHLANG_TOOLCHAINPath override for native linker and compiler toolchains (clang, gcc, lld).Path
ADESH_USE_VIRToggle whether JIT engine uses VIR (Value IR) or LIR (Low-level IR).1 (on) or 0 (off)
ADESH_MLIR_OPTPath override for mlir-opt tool in MLIR GPU backend pipeline.Executable path
ADESH_MLIR_TRANSLATEPath override for mlir-translate tool in MLIR GPU backend pipeline.Executable path
ADESH_LLCPath override for LLVM llc code generator in MLIR GPU backend pipeline.Executable path
ADESH_CLANGPath override for clang compiler driver in MLIR GPU backend pipeline.Executable path
NO_COLORDisable ANSI color codes in terminal output.Any value