CLI Vitte

Use :

vitte [command] [options] <input>

Commands (recommended):

  • help Show help and common tasks
  • init [dir] Create a minimal project skeleton
  • explain <code> Explain a diagnosis (e.g. E0001)
  • doctor Check toolchain prerequisites
  • parse Parser only (without backend)
  • check Parse + resolve + IR (without backend)
  • emit Only emit Vitte (without compilation)
  • build Complete build (default)
  • profile Complete construction with summary of times/memory per step
  • reduce Reduce a failed file to a minimal reproducer
  • clean-cache Delete stage cache files .vitte-cache
  • mod graph Display the import graph, cycles and module weights (LOC/exports/imports)
  • mod doctor Check the hygiene of imports (unused, aliases, canonical paths, collisions)
  • mod contract-diff Compare the exported contract of a module between 2 entries (--old / --new)

Options:

  • --lang <code> Language of diagnostics (e.g. en, fr). By default LANG/LC_ALL, then en.
  • --explain <code> Explain a diagnosis (e.g. E0001).
  • --stage <name> Stop at parse|resolve|ir|backend.
  • --diag-json Issue diagnostics in JSON.
  • --diag-json-pretty Issue readable JSON diagnostics (includes diag_schema).
  • --diag-code-only Issue compact diagnostics (file:line:col CODE), useful for CI.
  • --deterministic Stable output order for diagnostics and tools.
  • --cache-report Show cache hit/miss ratio parse/resolve/ir.
  • --runtime-profile <name> Restrict runtime/stdlib imports: core|system|desktop|arduino.
  • --allow-experimental Allow imports from modules experimental/....
  • --warn-experimental Degrade an experimental import refusal to a warning (migration mode).
  • --deny-internal Enforce confidentiality of internal modules (default behavior).
  • --allow-internal Disable internal module privacy checking.
  • --strict-modules Prohibit glob imports and impose a strict form of module imports.
  • --dump-stdlib-map Show resolved map stdlib module -> exported symbols (history option name).
  • --dump-module-index Export the full JSON of the module index (modules, imports, exports, loc).
  • --json For mod graph: emit the JSON payload of the graph.
  • --from <module> For mod graph: limit the view to the subgraph reachable from the module.
  • --dump-ast Export the AST after parsing.
  • --dump-ir Export IR (--dump-mir as alias).
  • --strict-types Reject compatibility aliases (integer, uint32, etc.) and enforce canonical names.
  • --strict-imports Require explicit import aliases, reject unused aliases, and disallow relative paths.
  • --fix For mod doctor: Show concrete rewrite suggestions.
  • --max-imports <N> For mod doctor: report modules whose fan-out exceeds N.
  • --old <file> / --new <file> For mod contract-diff.
  • --strict-bridge Alias ​​of --strict-imports for the binding policy.
  • --fail-on-warning Treat warnings as errors.
  • --stdout Output Vitte to standard output (implies emit).
  • --emit-vitte Emit a Vitte artifact only.
  • --repro Enable reproducible output.
  • --repro-strict Impose a strictly deterministic order for IR lowering.
  • --parse-modules Parse + load modules (without resolution/lowering).
  • --parse-silent Delete parse-only mode information logs.
  • Diagnostics include stable error codes (e.g. error[E0001]: ...).

Examples:

vitte help
vitte init
vitte init app
vitte explain E0001
vitte doctor
vitte parse --lang=fr src/main.vit

Error codes:

  • Diagnostics use stable prefixes per layer:
  • E000x: parse/grammar
  • E100x: resolution
  • E1007: invalid signed/unsigned cast
  • E1010..E1020: module/stdlib import contract
  • E200x: IR/lowering
  • E300x: backend/toolchain
  • Codes are defined in src/compiler/frontend/diagnostics_messages.vitl.
  • .ftl localization files can translate by code (preferred) or by message key.

Stdlib:

  • See docs/book/stdlib.html for stdlib modules and examples.
  • Contract and ABI surface: docs/book/compiler-stdlib-contract.html, docs/book/stdlib_abi_surface_v1.txt.

Historical options (still supported):

  • mod api-diff (aka mod contract-diff)
  • --stdlib-profile (historical alias of --runtime-profile)
  • correspondence: minimal->core, kernel->system, full->desktop
  • --parse-only
  • --resolve-only
  • --hir-only
  • --mir-only
  • --emit-vitte
  • --strict-parse

Notes:

  • The commands set a default mode, but explicit options take precedence.
  • For strict analysis, use parse --strict-parse <file>.
  • For the JSON of the graph in CI: vitte mod graph --json --from __root__ <file>.