Installation

The fastest way to get started with ImandraX is through the VS Code extension, which provides an integrated editing, proving and proof-exploration experience. For CI/CD pipelines and advanced workflows, you can also install the standalone CLI.

The VS Code extension is the primary way to use ImandraX. It includes:

  • Full LSP integration with syntax highlighting and error reporting
  • A goal state viewer, to see proof obligations and walk through proofs interactively
  • Incremental proof checking, so only what changed is re-verified
  • Integrated counterexample display
  • One-click installation of the ImandraX CLI

Step 1: Install the extension

Open VS Code and install the ImandraX extension from the marketplace:

  1. Open the Extensions panel (Cmd+Shift+X on macOS, Ctrl+Shift+X on Linux/Windows)
  2. Search for "ImandraX"
  3. Click Install

Alternatively, install directly from the VS Code Marketplace.

Step 2: Set your API key

ImandraX requires an Imandra Universe API key. Get one at universe.imandra.ai (free tier available).

Save your key to the config file:

mkdir -p ~/.config/imandrax
echo "your-key-here" > ~/.config/imandrax/api_key

Alternatively, you can set it as an environment variable (more common for Python libraries and CI environments). The following environment variables are checked in order: IMANDRA_UNI_KEY, IMANDRAX_API_KEY, IMANDRA_KEY.

export IMANDRAX_API_KEY="your-key-here"

Python libraries and agents will also look for config files in this order: ~/.config/imandra/api_key, then ~/.config/imandrax/api_key.

VS Code Settings

You can also set your API key in VS Code settings: search for "ImandraX" in Settings and enter your key there.

Step 3: Create your first file

Create a new file with the .iml extension (e.g., hello.iml). The extension will automatically activate and connect to the ImandraX reasoning engine.

(* hello.iml: your first ImandraX file *)
 
let double x = x + x
 
verify (fun x -> double x >= x)

You should see ImandraX process the file and report the verification result inline.

Standalone CLI (Advanced)

The imandrax-cli tool provides a command-line interface for non-interactive verification, useful for CI/CD pipelines and scripting.

Installation

If you installed the VS Code extension, it installs the CLI for you and there is nothing more to do. To install the CLI on its own, download and run the installer script, then follow its prompts. The installer supports the same platforms as ImandraX itself (see System requirements):

curl -fsSLO https://imandra.ai/get-imandrax.sh
sh get-imandrax.sh

Basic usage

Check a file:

imandrax-cli check myfile.iml

This verifies all theorems, lemmas, and verification goals in the file and reports results to stdout. The exit code is 0 if all goals succeed, non-zero otherwise, which makes it ideal for CI pipelines.

Start the HTTP API server:

imandrax-cli serve-http -p 8000

This launches an HTTP server that exposes the ImandraX reasoning engine for programmatic access from Python, OCaml, or any HTTP client. See the API Reference for details.

System Requirements

  • Operating system: macOS (Apple Silicon or Intel) or Linux (x86_64)
  • VS Code: Version 1.85 or later (for the extension)
  • Network: Internet connection required for API key validation

Next steps

Now that ImandraX is installed, head to Your First Proof to write and verify your first theorem.