EnraiEnrai

Getting Started

Launch Enrai fast, pick the right runtime model, and know what to do next.

Fastest path

If you want the shortest route to a working Enrai instance, use the portable runtime first and add complexity later.

Try it locally in minutes

Use the CLI and run Enrai directly from npm.

npx enrai@latest start
Run it in a container

Use Docker if you want an isolated runtime with a mounted workspace.

docker run -p 3001:3001 ...
Develop the stack itself

Install dependencies and run the editor, backend, and docs separately.

npm install

Quick start with npx

If you want the shortest path to a working Enrai instance:

npx enrai@latest start

This launches Enrai with the portable flow and serves the editor from the backend.

If you want to load a local config file:

npx enrai@latest start --config ./enrai.config.json

Once it is running, open the editor, point it at a real workspace, and verify three things immediately:

  1. the file explorer opens the directory you expect
  2. the terminal starts inside that workspace
  3. the preview or runtime tab can reach your local app when needed

Quick start with Docker

If you want the portable runtime without installing the repository locally:

Pull the image:

docker pull agentrouter/enroi:latest

Run Enrai with your current folder mounted as the workspace:

docker run --rm -it \
  -p 3001:3001 \
  -e EDITOR_WORKDIR=/workspace \
  -e OPENAI_API_KEY=your_key_here \
  -v "$(pwd):/workspace" \
  agentrouter/enroi:latest

Open:

http://localhost:3001/editor

If you want a different host port, keep Enrai on 3001 inside the container and publish another host port:

docker run --rm -it \
  -p 3009:3001 \
  -e EDITOR_WORKDIR=/workspace \
  -e ENRAI_PUBLIC_URL=http://localhost:3009 \
  -e OPENAI_API_KEY=your_key_here \
  -v "$(pwd):/workspace" \
  agentrouter/enroi:latest

Open:

http://localhost:3009/editor

Notes:

  • The Docker image already includes the portable frontend, backend, zsh, fish, oh-my-zsh, and codex.
  • -p HOST:CONTAINER must point to the actual internal Enrai port.
  • Mount a real folder if you want persistent files inside the editor workspace.

For the fuller deployment model and image notes, see Deployment.

Requirements

  • Node.js 22 or newer is required for the full Enrai toolchain.
  • npm is used throughout this repository.
  • macOS, Linux, or WSL is recommended for PTY support.

Develop from source

If you are modifying Enrai itself rather than only using it, install dependencies from the repository root.

Install dependencies

From the repository root:

npm install
cd backend && npm install
cd ../documentation && npm install

Run the main workspace

Frontend:

npm run dev

Backend:

cd backend
npm run dev

Default local URLs:

  • Frontend: http://localhost:3000/editor
  • Backend: http://localhost:3001

This is the right mode when you want:

  • fast iteration on the UI and backend independently
  • easier debugging of editor versus server behavior
  • separate deploy pipelines later

Run the documentation site

cd documentation
npm run dev

Default local URL:

  • Docs: http://localhost:3000/docs

If your main editor app is already using port 3000, Next will pick the next available port automatically.

Portable mode

You can also serve the frontend from the backend:

npm run build:portable
npm run start:portable

Portable URL:

  • http://localhost:3001/editor

Use portable mode when you want the fewest moving pieces in a trusted environment.

Choose your operating model

Portable runtime

Best for internal machines, demos, and the shortest setup path.

Split frontend and backend

Best when the UI and the backend need different hosts, proxies, or deploy cadences.

Containerized runtime

Best when you want reproducibility with a mounted project directory.

Screenshot checklist

Main workspace screenshot
Main workspace

Use this as the first product screenshot. It should explain the editor in one glance.

Drop replacement PNG here

Replace documentation/public/images/editor-main-workspace.png and the docs will update without changing this page.

  • Left activity bar visible
  • File explorer open with folders collapsed cleanly
  • 2 or 3 file tabs open
  • A real code file visible in Monaco
  • Terminal open at the bottom with useful output
documentation/public/images/editor-main-workspace.png
  • Deployment if you need to choose between portable and split hosting
  • Security if the workspace will run anywhere beyond a trusted internal network
  • Architecture if you want to understand the editor/backend split and task flow