# Elide documentation > Elide is a high-performance runtime and toolchain for Kotlin, Java, JavaScript, TypeScript and Python. This file contains every page of https://elide.help in navigation order. Each page starts with its title and URL; the index is https://elide.help/llms.txt. # Elide Overview URL: https://elide.help/ > What Elide is, where to start, and the commands you will use most Elide is one binary that runs JavaScript, TypeScript, Python, Java, Kotlin, and WebAssembly, and builds, tests, formats, and installs dependencies for your projects. ## Start here 1. [Install Elide](https://elide.help/docs/installation). 2. [Run your first program](https://elide.help/docs/getting-started). 3. Pick a language: [JavaScript and TypeScript](https://elide.help/docs/web), [Python](https://elide.help/docs/python), [Java and Kotlin](https://elide.help/docs/jvm), or [WebAssembly](https://elide.help/docs/wasm). With `--interop`, languages share one process; a REPL session can pass values between them: One REPL session — JavaScript values used from Python ## Common commands ```bash elide run app.ts # run a file elide python script.py # run Python with CPython-style arguments elide repl # interactive REPL elide init # start a new project from a template elide adopt # migrate an existing project with an AI coding agent elide install # install Maven dependencies elide install --ecosystems=npm # install npm dependencies elide build # build the project elide test # run tests elide format -- src # format Java and Kotlin sources elide serve --no-tui ./dist # serve a directory over HTTP elide --help-all # every command and flag elide help # any page of these docs, in the terminal ``` ## Explore further - [Code Samples](https://elide.help/docs/code-samples) - [Elide Projects](https://elide.help/docs/projects) - [Adopt an Existing Project](https://elide.help/docs/toolchain/usage/adopt) - [Languages and Interop](https://elide.help/docs/languages) - [CLI Reference](https://elide.help/docs/cli-references) - [Compatibility Matrix](https://elide.help/docs/compatibility) - [API Overview](https://elide.help/docs/api-overview) - [Elide for AI Agents](https://elide.help/docs/agents) - Coming from Node, Bun, Deno, Python, Java or Kotlin: [Node](https://elide.help/docs/elide-for-node), [Bun](https://elide.help/docs/elide-for-bun), [Deno](https://elide.help/docs/elide-for-deno), [Python](https://elide.help/docs/elide-for-python), [Java](https://elide.help/docs/elide-for-java), [Kotlin](https://elide.help/docs/elide-for-kotlin) --- # Installation URL: https://elide.help/docs/installation > Install Elide with the install script, PowerShell, npm, a package manager, or a container Elide has two channels: `release` (versions such as `1.6.0`) and `nightly` (daily builds). The install scripts default to `nightly`. ## macOS, Linux, or WSL ```bash curl -sSL --tlsv1.2 elide.sh | bash -s -- --channel=release ``` Installs under `${ELIDE_HOME:-${XDG_DATA_HOME:-$HOME/.local/share}/elide}` and adds `bin` to your shell profile. | Option | Effect | | --- | --- | | `--channel=release` or `--channel=nightly` | Select the channel (default `nightly`). | | `--install-rev=VERSION` | Install a specific version. | | `--install-dir=PATH` | Install somewhere else. | | `--with-python` | Also install the Python component. | | `--no-path` | Leave shell profiles unchanged. | | `--help` | List every option without installing. | ## Windows ```powershell & ([scriptblock]::Create((irm https://elide.sh/install.ps1))) -Channel release ``` Installs under `$env:ELIDE_HOME`, or `$env:LOCALAPPDATA\elide` when that is unset. Options: `-Channel`, `-InstallRev`, `-InstallDir`, `-WithPython`, and `-NoPath`. ## npm ```bash npm install -g @elide-dev/elide ``` `latest` tracks `release`; install `@elide-dev/elide@nightly` for nightly. Set `ELIDE_WITH_PYTHON=1` to include Python. ## Python Python is an optional component: ```bash elide setup python ``` | Install method | Python | | --- | --- | | Install script | `--with-python` (`-WithPython` on Windows), or `elide setup python` later | | npm | `ELIDE_WITH_PYTHON=1` during `npm install` | | Homebrew | Included | | Container images | Included | | apt, RPM, MSI, macOS installers | Not available; use one of the methods above | `elide setup python` uses the binary's own channel; `--channel=release` or `--channel=nightly` overrides it. ## Other methods - [Packages & Installers](https://elide.help/docs/installation/packages): Homebrew, apt, RPM, macOS and Windows installers - [Container Images](https://elide.help/docs/installation/containers) - [Continuous Integration](https://elide.help/docs/installation/ci-cd) - [GitHub Releases](https://github.com/elide-dev/elide/releases): archives, checksums, and older builds. Keep an archive's `bin/` and `lib/` together; `bin/elide` needs `lib/`. Update a script install with `elide upgrade`, and a package-manager install through its manager. ## Verify the install ```bash elide --version elide info ``` Verifying an Elide installation from the command line `elide info` lists the available languages, including `python` when it is installed. If the shell cannot find `elide`, open a new terminal or add the install's `bin` folder to `PATH`. | Platform | Architectures | | --- | --- | | Linux | `amd64`, `arm64` | | macOS | Apple Silicon | | Windows | `amd64` | --- # Packages & Installers URL: https://elide.help/docs/installation/packages > Install Elide with Homebrew, apt, RPM, or the macOS and Windows installers, and verify downloads Upgrade these installs through their package manager, not `elide upgrade`. Only Homebrew includes Python; see [Installation](https://elide.help/docs/installation#python). ## Homebrew ```bash brew install elide-dev/elide/elide brew upgrade elide ``` The [`elide-dev/homebrew-elide`](https://github.com/elide-dev/homebrew-elide) tap tracks `nightly` on macOS (Apple Silicon) and Linux (`amd64`, `arm64`). ## Debian and Ubuntu (apt) ```bash curl -fsSL https://keys.elide.dev/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/elide.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/elide.gpg]" \ "https://dl.elide.dev release main" | sudo tee /etc/apt/sources.list.d/elide.list sudo apt update && sudo apt install elide ``` Replace `release` with `nightly` for daily builds. Upgrade with `sudo apt update && sudo apt upgrade elide`. The package installs into `/opt/elide/`; `/opt/elide/current` and `/usr/bin/elide` point at it. ## Fedora and RHEL (RPM) ```bash sudo dnf install ./elide__.rpm ``` Download the RPM for `amd64` or `arm64` from [GitHub Releases](https://github.com/elide-dev/elide/releases); there is no yum repository. Upgrade by installing a newer RPM. ## Native installers These links point at the latest `release`; replace `release` with `nightly` in a URL for the latest nightly.
Platform Format Download Checksum
macOS arm64 PKG elide-installer.macos-arm64.pkg sha256
macOS arm64 DMG elide-installer.macos-arm64.dmg sha256
Windows amd64 MSI elide-installer.windows-amd64.msi sha256
## Verifying downloads Each installer has a SHA-256 checksum (`.sha256`) and a GPG signature (`.asc`). GitHub Releases also carries a Sigstore bundle (`.bundle`). With the download and its `.sha256` file in one directory: ```bash sha256sum -c .sha256 # Linux shasum -a 256 -c .sha256 # macOS ``` PowerShell: ```powershell $file = "elide-installer.windows-amd64.msi" Invoke-WebRequest -Uri "https://elide.zip/artifacts/release/latest/$file" -OutFile $file Invoke-WebRequest -Uri "https://elide.zip/artifacts/release/latest/$file.sha256" -OutFile "$file.sha256" $expected = (Get-Content "$file.sha256").Split(" ")[0] $actual = (Get-FileHash $file -Algorithm SHA256).Hash.ToLower() if ($expected -eq $actual) { Write-Host "OK" } else { Write-Host "MISMATCH" } ``` Signature: ```bash curl -fsSL https://keys.elide.dev/gpg.key | gpg --import curl -LO https://elide.zip/artifacts/release/latest/elide-installer.windows-amd64.msi.asc gpg --verify elide-installer.windows-amd64.msi.asc elide-installer.windows-amd64.msi ``` A valid signature reports `Good signature from "Elide Releases (Release key, Elide 1.0 and up) "`. GPG warns that the key is not certified until you sign it yourself. --- # Container Images URL: https://elide.help/docs/installation/containers > Run Elide from the elide and bash container images, with release and nightly tags Linux images for `amd64` and `arm64`, with Python included. | Image | Entrypoint | Use | | --- | --- | --- | | `elide.dev/elide` | `elide` | Run a command directly. | | `elide.dev/bash` | `bash` | Open a shell with Elide on `PATH`. | Both are also published as `ghcr.io/elide-dev/elide` and `ghcr.io/elide-dev/bash`. ## Tags | Tag | Points at | | --- | --- | | `1.6.0` | That release. | | `1.6`, `1` | The newest release in that line. | | `latest` | The newest release. | | `nightly` | The newest nightly build. | | `nightly-` | The nightly build from that date. | Pin a version or dated nightly tag for reproducible builds. The [`elide`](https://github.com/elide-dev/elide/pkgs/container/elide) and [`bash`](https://github.com/elide-dev/elide/pkgs/container/bash) package pages list every tag. ## Run a command ```bash docker run --rm elide.dev/elide:1.6.0 --version docker run --rm -v "$PWD":/work -w /work elide.dev/elide:1.6.0 run app.js # run in the current directory ``` ## Open a shell ```bash docker run --rm -it elide.dev/bash:1.6.0 ``` --- # Continuous Integration URL: https://elide.help/docs/installation/ci-cd > Install a pinned Elide release in GitHub Actions with setup-elide The [setup-elide](https://github.com/elide-dev/setup-elide) action installs Elide and adds it to `PATH`. It defaults to `nightly`; pin a release: ```yaml - name: Set up Elide uses: elide-dev/setup-elide@v4.2.0 with: version: 1.6.0 channel: release ``` The action's README lists its other inputs and outputs. ## Example workflow ```yaml name: CI on: [push, pull_request] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: elide-dev/setup-elide@v4.2.0 with: version: 1.6.0 channel: release - run: elide install --workspace - run: elide format --list-files -- --dry-run src - run: elide test ``` `elide install --workspace` installs every ecosystem the project declares; plain `elide install` installs Maven only. The format step fails when a file under `src` needs formatting. The action does not install Python. Add a step when the workflow needs it: ```yaml - run: elide setup python ``` --- # Getting Started URL: https://elide.help/docs/getting-started > Run a first program in each language, then create or adopt an Elide project [Install Elide](https://elide.help/docs/installation), then try these in an empty directory. ## JavaScript or TypeScript ```js // hello.js console.log("Hello from JavaScript!"); ``` ```bash elide run hello.js ``` TypeScript runs directly, with no compile step: ```ts // hello.ts const message: string = "Hello from TypeScript!"; console.log(message); ``` ```bash elide run hello.ts ``` Running a TypeScript file directly with Elide ## Python Needs the Python component ([Installation](https://elide.help/docs/installation#python)). ```python # hello.py print("Hello from Python!") ``` ```bash elide python hello.py ``` ## Java or Kotlin ```java // Hello.java public class Hello { public static void main(String[] args) { System.out.println("Hello from Java!"); } } ``` ```bash elide run Hello.java elide run Hello.kt # Kotlin works the same way ``` ## WebAssembly ```bash elide run app.wasm ``` See [WebAssembly with Elide](https://elide.help/docs/wasm). ## Start a project ```bash elide init --plain --skip-defaults --template java elide build elide run elide test ``` `elide init --templates` lists templates. In a terminal, `elide init` without flags opens an editor for the parameters. To move an existing Java or Kotlin project to Elide, run `elide adopt` in it; see [Adopt an Existing Project](https://elide.help/docs/toolchain/usage/adopt). Next: [Elide Projects](https://elide.help/docs/projects) or [Code Samples](https://elide.help/docs/code-samples). --- # JavaScript and TypeScript with Elide URL: https://elide.help/docs/web > Run JavaScript and TypeScript, install npm packages, test, and serve with Elide Elide runs JavaScript and TypeScript directly, with CommonJS, ES modules, and a subset of the Node and Web APIs. TypeScript needs no compile step and no `tsconfig.json`. ```bash elide run app.js elide run app.ts elide app.ts elide run -s 'console.log(1 + 1)' ``` Extensions: `.js`, `.mjs`, `.cjs`, `.jsx`, `.ts`, `.mts`, `.cts`, `.tsx`. JSX and TSX are transformed, but Elide provides no UI framework or DOM; install what your code imports, such as React's `react/jsx-runtime`. ## npm packages Declare dependencies in `package.json`. Plain `elide install` skips npm, so pass `--ecosystems=npm`: ```json { "type": "module", "dependencies": { "zod": "3.24.1" } } ``` ```ts // app.ts import { z } from "zod"; const User = z.object({ name: z.string() }); console.log(`Hello, ${User.parse({ name: "Ada" }).name}!`); ``` ```bash elide install --ecosystems=npm elide run app.ts ``` elide install — package.json dependencies used from TypeScript Packages are installed into `node_modules`. Use `--ecosystems=maven,npm` or `--workspace` when the project also has Maven dependencies. See [NPM Installer](https://elide.help/docs/toolchain/web/npm) for lockfiles and options. ## Tests `elide test` finds `*.test.ts`, `*.spec.js`, files under `test/`, and similar. Write them with `node:test`: ```ts // math.test.ts import test from "node:test"; import assert from "node:assert"; test("adds", () => { assert.equal(1 + 1, 2); }); ``` ```bash elide test ``` ## Servers ```bash elide serve --no-tui ./dist # static files on 127.0.0.1:8080 elide dev --no-tui ./src # live reload on port 3000 ``` Given a script, `serve` and `dev` run it; a module that exports a `fetch` handler is served directly. See [Development Server](https://elide.help/docs/dev-server). ## More Implemented Node and Web modules are listed in the [API Overview](https://elide.help/docs/api-overview); measured results are in the [Compatibility Matrix](https://elide.help/docs/compatibility). --- # Python with Elide URL: https://elide.help/docs/python > Run Python 3.13 with elide python: CPython-style arguments, the bundled stdlib, and JS interop Python support is experimental in 1.6.0. Elide runs Python 3.13 with its standard library; no CPython install is needed. Python is an optional component: ```bash elide setup python ``` `--channel=release` or `--channel=nightly` picks the channel, and `--force` reinstalls. apt and RPM installs cannot add it; [Installation](https://elide.help/docs/installation#python) lists the methods that can. Without the component, a Python command prints `Python support is not installed. Run 'elide setup python' to add it.` and exits `2`. ## Run Python `elide python` takes the same arguments as `python`: ```bash elide python app.py --name Elide --count 2 # sys.argv: ['app.py', '--name', 'Elide', '--count', '2'] elide python -c 'import sys; print(sys.version)' elide python -m json.tool input.json echo 'print("from stdin")' | elide python - ``` Every token after the script, `-c CMD`, or `-m MODULE` is a program argument. Bare `elide python` starts the REPL in a terminal and reads standard input otherwise. Running a Python program with command-line arguments in Elide The general commands also run `.py` files, with the same `sys.argv`: ```bash elide app.py elide run app.py elide -l python -s 'print(1 + 1)' ``` ### Interpreter options These go before the script, `-c`, or `-m`. `elide --help-all` lists them under "Python interpreter options". | Flag | Effect | | --- | --- | | `-c CMD` | Run `CMD` as the program; trailing tokens become `sys.argv[1:]`. | | `-m MODULE` | Run a library module as `__main__`. | | `-s` | Don't add the user site directory to `sys.path`. | | `-I` | Isolated mode. | | `-E` | Ignore `PYTHON*` environment variables. | | `-S` | Don't `import site` on startup. | | `-P` | Don't prepend a potentially unsafe path to `sys.path`. | | `-B` | Don't write bytecode files. | | `-u` | Unbuffered standard output and error. | | `-O` | Optimization level; repeat for `-OO`. | | `-b` | Warn on `bytes`/`str` comparisons; repeat to raise errors. | | `-W ARG` | Warning control; repeatable. | | `-x` | Accepted for compatibility; no effect. | ## Standard library The Python 3.13 standard library is included, among it `json`, `pathlib`, `sqlite3`, `ssl`, `zlib`, and `ctypes`. `bz2` and `lzma` need no system `libbz2` or `liblzma`. ## JavaScript interop With `--interop`, Python evaluates JavaScript through the built-in `elide` module: ```python # sum.py from elide import js print(js("[1, 2, 3].reduce((a, b) => a + b, 0)")) ``` ```bash elide --interop python sum.py ``` JavaScript and TypeScript import a Python module's default export: ```javascript // main.mjs import mod from "./mod.py"; console.log(mod.hello()); ``` ```bash elide --interop run main.mjs ``` Without `--interop`, these calls fail. See [Languages and Interop](https://elide.help/docs/languages). ## Third-party packages Elide does not install PyPI packages: `elide install` skips `dependencies.pypi`, and `elide install --ecosystems=pypi` exits `2`. Packages in a Python 3.13 virtual environment load when `VIRTUAL_ENV` points at it: ```bash export VIRTUAL_ENV=/path/to/venv elide python app.py ``` Elide reads the environment's `lib/python3.13/site-packages`. ## Known limitations - **C extensions**: some C extension modules do not load. - **macOS**: native module isolation is not available. - **WebAssembly SIMD**: installing Python disables it; see [WebAssembly with Elide](https://elide.help/docs/wasm#limits). - **CPython differences**: some edge cases behave differently from CPython 3.13; see the [Compatibility Matrix](https://elide.help/docs/compatibility). --- # Java and Kotlin with Elide URL: https://elide.help/docs/jvm > Run, compile, format, build, and test Java and Kotlin with Elide's built-in JDK 25 and Kotlin toolchain Elide compiles, formats, builds, and tests Java (up to JDK 25) and Kotlin (2.5.0-Beta1), and resolves Maven dependencies. ## Run a source file A file with a `main` entrypoint compiles and runs directly: ```bash elide run Hello.java elide run Hello.kt ``` ## Use individual tools `elide java`, `elide javac`, `elide kotlinc`, and `elide jar` behave like the tools of the same name. Pass their arguments after `--`: ```bash elide javac -- -d target src/main/java/app/Main.java elide kotlinc -- -d target src/main/kotlin/app/Main.kt elide java -- -cp target app.Main ``` `elide format` formats Java with Google Java Format and Kotlin with ktfmt: ```bash elide format -- src # rewrite files elide format --list-files -- --dry-run src # list files that would change; exit 1 if any ``` ## Start a project ```bash elide init --plain --skip-defaults --template java ``` | Template | Creates | | --- | --- | | `java` | A Java project. | | `ktjvm` | A Kotlin project. | | `workspace` | A Kotlin library and an app that depends on it. | For an existing Maven or Gradle project, `elide adopt` runs an AI coding agent to do the migration; see [Adopt an Existing Project](https://elide.help/docs/toolchain/usage/adopt). ## Build a project ```bash elide install # resolve Maven dependencies elide build # compile and assemble artifacts elide test # run JUnit tests elide run # run the project's main class ``` Elide projects — build, run, and reuse cached work `elide build --inspect` lists the project's task names. See [Elide Projects](https://elide.help/docs/projects) for the manifest and [JVM Toolchain](https://elide.help/docs/toolchain/jvm) for compiler and packaging options. --- # WebAssembly with Elide URL: https://elide.help/docs/wasm > Run WASI command modules and load WASM libraries from JavaScript and TypeScript WebAssembly support is experimental in 1.6.0. | You have | Use | Result | | --- | --- | --- | | A WASI command | `elide run app.wasm` | Runs the module with WASI Preview 1 imports. | | A WASM library | The `WebAssembly` API or an ES module import from JS/TS | Exposes the module's exports. | elide app.wasm — WASI commands and WASM libraries from JavaScript To compile Java or Kotlin to WebAssembly, see [WebImage](https://elide.help/docs/toolchain/jvm/webimage); its output needs its JavaScript loader and does not run with `elide run`. ## Run a WASM file ```bash elide run app.wasm elide app.wasm elide run app.wasm -- first second # program arguments elide run --timeout=5s app.wasm # exit 124 after 5 seconds ``` Elide calls the module's exported `_start`, or `_main` if `_start` is absent; a module with neither fails, so load it from JavaScript instead. | Behavior | Value | | --- | --- | | Argument zero | The module's absolute path. | | Exit status | Set by WASI `proc_exit`, not by a function's return value. | | Traps, malformed binaries | Nonzero exit. | | `--timeout` | Covers instantiation and execution; exits `124`. | ### Project entrypoints Name a module as the project entrypoint in `elide.pkl`, then run `elide run` in the project: ```pkl amends "elide:project.pkl" name = "wasm-app" entrypoint { "app.wasm" } ``` See [Elide Projects](https://elide.help/docs/projects). ## WASI Commands receive **WASI Snapshot Preview 1** imports under `wasi_snapshot_preview1`: standard streams, arguments, exit status, and filesystem operations. Libraries loaded from JavaScript do not get WASI. ### Directory access WASI commands cannot access host directories until you map one: ```bash elide -Xpolyglot.wasm.WasiMapDirs=work::./data run app.wasm ``` This exposes `./data` as the guest directory `work`. Separate mappings with commas: `work::./data,output::./results`. The sandbox still applies, and WASI file opens need both read and write permission, even for reads: ```bash elide -Xpolyglot.wasm.WasiMapDirs=work::./data run \ --sandbox --allow-read=./data --allow-write=./data app.wasm ``` See [Sandbox and Limits](https://elide.help/docs/sandbox). ## JavaScript and TypeScript interop The global `WebAssembly` API needs no flag: ```javascript import { readFile } from "node:fs/promises"; const bytes = await readFile(new URL("./math.wasm", import.meta.url)); const { instance } = await WebAssembly.instantiate(bytes, {}); console.log(instance.exports.add(20, 22)); ``` Elide does not call `_start` or `_main` on modules loaded from JavaScript. The second argument supplies the module's imports: ```javascript const imports = { env: { log: (value) => console.log(value) } }; const { instance } = await WebAssembly.instantiate(bytes, imports); ``` The API includes `validate`, `compile`, `Module`, `Instance`, `Memory`, `Table`, `Global`, and import and export inspection. A compiled `Module` can be instantiated more than once. File reads follow the same permissions as other JS code. ### ES module imports ```javascript import { add } from "./math.wasm"; console.log(add(20, 22)); ``` ```javascript const math = await import("./math.wasm"); console.log(math.add(20, 22)); ``` Specifiers can be relative or absolute paths, `file:` URLs, or package exports that resolve to `.wasm`. A source-phase import gives you the compiled module to instantiate yourself: ```javascript import source mathModule from "./math.wasm"; const math = await WebAssembly.instantiate(mathModule, {}); console.log(math.exports.add(20, 22)); ``` ## Supported WebAssembly proposals Defaults for both commands and JS/TS interop: | Feature / proposal | Standard distribution | With Python installed | | --- | --- | --- | | Mutable globals, sign-extension operators | Enabled | Enabled | | Non-trapping float-to-integer conversions | Enabled | Enabled | | Multi-value function and block results | Enabled | Enabled | | Bulk memory operations and reference types | Enabled | Enabled | | Multiple memories | Enabled | Enabled | | Extended constant expressions | Enabled | Enabled | | Exception handling | Enabled | Enabled | | Typed function references | Enabled | Enabled | | Garbage-collected types (WasmGC) | Enabled | Enabled | | Tail calls | Enabled | Enabled | | Fixed-width SIMD (`v128`) | Enabled | Disabled | | Relaxed SIMD | Enabled | Disabled | Off by default: | Proposal | Option | Notes | | --- | --- | --- | | Memory64 | `wasm.Memory64` | Also requires `wasm.UseUnsafeMemory`. | | Threads and atomics | `wasm.Threads` | No WASI thread-spawning host API is supplied. | | Wide integer arithmetic | `wasm.WideArithmetic` | Separate from ordinary `i64` arithmetic. | | Legacy exception handling | `wasm.LegacyExceptions` | The newer exception-handling proposal is on by default. | Enable one with `-Xpolyglot.