VexaScript CLI

Compile, bundle, run, serve, inspect, and format from the terminal

The vexa CLI covers building, bundling, serving browser demos with live reload, running, providing syntax definitions in different formats, formatting, testing, exploring the AST, LSP and MCP. Project defaults live in vexascript.json.

Core commands

build <input.vx|input.ts>

Compile a VexaScript or TypeScript file to JavaScript, with optional bundling and JSX factory overrides.

cpp <input.vx|input.ts>

Compile, link, or run through the native C++ backend. The direct form is equivalent to cpp build.

cpp build compiles, cpp link compiles and links, and cpp run compiles, links, and executes.

bundle <input>

Bundle a VexaScript entry file and all referenced modules as ESM output.

run <input>

Transpile and execute a VexaScript file with Node.js.

serve <dir> --bundle <input.vx>

Serve a static folder on port 8080 by default, inject the bundle into HTML, and live-reload the page whenever the bundled dependency graph changes.

test [paths...]

Discover and run .test.vx files with the built-in inline helpers.

format <input>

Format a file in place, optionally writing a copy to a separate output path.

tokens <input>
ast <input>

Inspect the tokenizer output or print a simplified AST for debugging parser behavior.

syntax --monaco, --vscode, --textmate, --codemirror

Export editor grammars

Select editor syntax export targets from the syntax command, or use --target <name> for the explicit target id.

lsp

Start the language server. By default using --stdio. This allows editors to get autocompletion and error detection.

mcp

Run the MCP navigation server. This enables agents to do accurate operations on VexaScript codebases.

Command overview

-o, --out <file>

Use the command-specific sections below for the complete flag list.

--target <mode>

Use conservative or optimized transpilation modes on build-oriented commands.

--jsx-factory / --jsx-fragment-factory

Override JSX emit targets for projects that do not use the default React-style factories.

It is possible to define those also in the tsconfig.json file.

--root <dir>

Set the workspace root for the mcp server when resolving files and symbols.

vexa build src/main.vx --out dist/main.js --target optimized
vexa cpp src/main.ts --out dist/main.cpp
vexa cpp link src/main.ts --out dist/main
vexa serve demo/ --bundle demo/main.vx
vexa syntax --monaco
vexa test samples/

Command reference

Flags and supported forms

These sections mirror vexa help <command>. Native C++ operations are grouped below cpp.

vexa build <input>

Compile a file or project to JavaScript.

-o, --out <path> output file or project directory.

--target <mode> conservative or optimized.

--jsx-factory <factory> and --jsx-fragment-factory <factory> override JSX factories.

--bundle bundles the entry and referenced modules; --platform <platform> selects browser or node.

--transpile-only skips semantic diagnostics.

vexa cpp <input>

Compile to C++ directly. This is the short form of vexa cpp build <input>.

-o, --out <path> output C++ file or project directory.

--target <mode> conservative or optimized.

--jsx-factory <factory> and --jsx-fragment-factory <factory> configure JSX emission.

--transpile-only skips semantic diagnostics; --native-source-locations adds native source hooks.

vexa cpp build <input>

Explicit C++ compilation. It accepts the same output, target, diagnostic, and source-location flags as cpp.

-o, --out <path>, --target <mode>, --jsx-factory <factory>, --jsx-fragment-factory <factory>, --transpile-only, and --native-source-locations.

vexa cpp link <input>

Compile and link a native Oilpan executable. Generated C++ and unchanged executables are reused from the cache.

-o, --out <path> executable path or project output directory.

--build-dir <dir> intermediate directory; defaults to <input>.build.

--target <mode>, --jsx-factory <factory>, --jsx-fragment-factory <factory>, --transpile-only, and --native-source-locations.

vexa cpp run <input>

Compile, link, and execute a native Oilpan executable, reusing cached artifacts when inputs are unchanged.

Supports the same flags as cpp link: -o, --out <path>, --build-dir <dir>, --target <mode>, --jsx-factory <factory>, --jsx-fragment-factory <factory>, --transpile-only, and --native-source-locations.

vexa run <input>

Transpile and execute a VexaScript file with Node.js.

--target <mode> selects conservative or optimized.

vexa bundle <input>

Bundle the entry and referenced local and package modules as ESM.

-o, --out <file>, --target <mode>, --jsx-factory <factory>, --jsx-fragment-factory <factory>, and --transpile-only.

--platform <platform> is browser or node.

vexa serve [dir]

Serve static files, optionally bundle an entry, inject it into HTML, and live-reload on changes.

--bundle <input>, --open, --port <number>, --target <mode>, --jsx-factory <factory>, and --jsx-fragment-factory <factory>.

vexa test [paths...]

Discover and run .test.vx files. It has no command-specific flags.

vexa format <input>

Format a VexaScript file in place.

-w, --write is retained as a deprecated compatibility flag; -o, --out <file> selects another output path.

vexa tokens <input> and vexa ast <input>

Print the token stream or simplified AST. Neither command has additional flags.

vexa syntax

Print embedded editor syntax definitions.

--target <name>, --monaco, --monaco-language, --monaco-configuration, --vscode, --vscode-grammar, --vscode-configuration, --codemirror, and --textmate.

vexa lsp

Start the language server. Transport options are passed through to the language-server adapter.

vexa mcp

Start the MCP codebase-navigation server over JSON-RPC on standard input/output. MCP clients discover these tools through tools/list and invoke them through tools/call.

--root <dir> selects the workspace root used to resolve paths and scan symbols.

Provided MCP tools

vexa_workspace_symbols searches top-level symbols and class members across the workspace. Optional arguments: query (case-insensitive name filter; empty returns all symbols) and root.

vexa_document_symbols lists the symbols declared in one file. Required argument: file.

vexa_hover returns type and documentation information at a position. Required arguments: file, line, character. The line is zero-based and character is a zero-based UTF-16 offset. Optional: root.

vexa_definition navigates to the definition at a position, including imported and cross-file symbols. It accepts the same position arguments as vexa_hover.

vexa_references finds references to the symbol at a position across the workspace. It accepts the same position arguments plus optional includeDeclaration, which defaults to true.

vexa_signature_help returns call-signature help around a position. It accepts the same position arguments as vexa_hover.

vexa_rename builds a cross-file rename edit at a position. Required arguments: file, line, character, and newName. Optional: root and apply; apply defaults to false and writes changes only when set to true.