> ## Documentation Index
> Fetch the complete documentation index at: https://www.orionjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> CLI is used to develop and run Orionjs applications

The Orionjs CLI is a command-line tool that helps you develop, build, and run Orionjs applications. Starting with v4.3, it defaults to **Bun** as the runtime.

## Installation

The CLI is part of the `@orion-js/core` package.

```bash theme={null}
bun add -D @orion-js/core
```

## Available Commands

### orion dev

Runs your Orionjs application in development mode with automatic restart on file changes.

```bash theme={null}
bunx orion dev [options]
```

**Options:**

* `--node`: Use Node.js (with tsx watch) instead of Bun
* `--repl`: Enable REPL endpoint for `orion repl` (see below)
* `--shell`: Opens a shell in Chrome developer tools
* `--clean`: Build the TypeScript project from scratch

**What happens under the hood:**

| Runtime         | Command executed             |
| --------------- | ---------------------------- |
| Bun (default)   | `bun --watch ./app/index.ts` |
| Node (`--node`) | `tsx watch ./app/index.ts`   |

### orion prod

Starts an Orionjs application in production mode.

```bash theme={null}
bunx orion prod [options]
```

**Options:**

* `--node`: Use Node.js instead of Bun
* `--path [path]`: Specify a pre-compiled build directory (Node.js only)

**What happens under the hood:**

| Runtime         | Command executed                                                    |
| --------------- | ------------------------------------------------------------------- |
| Bun (default)   | `bun ./app/index.ts` (runs TypeScript directly)                     |
| Node (`--node`) | Builds with esbuild, then runs `node --import=tsx ./build/index.js` |

### orion build

Compiles the application using esbuild for Node.js deployment.

```bash theme={null}
bunx orion build
```

### orion check

Runs TypeScript type checking without emitting files.

```bash theme={null}
bunx orion check
```

### orion info

Shows the available runtimes and the default runtime.

```bash theme={null}
bunx orion info
```

### orion repl

Evaluates a TypeScript expression against a running Orionjs dev server. Requires `orion dev --repl` to be running.

```bash theme={null}
bunx orion repl -e "<expression>"
```

**Options:**

* `-e, --expression <expr>`: **(Required)** The expression to evaluate
* `--port <port>`: Port of the dev server (default: auto-detect from `.orion/port`)

**Examples:**

```bash theme={null}
# Start dev server with REPL enabled
bunx orion dev --repl

# In another terminal:
bunx orion repl -e "return 1 + 1"

# Query a service
bunx orion repl -e "const {UserService} = await import('./app/services/UserService'); return await getInstance(UserService).getUserById('abc')"
```

See the [REPL guide](/guides/repl) for more details.

### orion create

Creates a new Orionjs project from the starter kit.

```bash theme={null}
bunx orion create
```

## Environment Variables Integration

Orionjs CLI automatically integrates with `@orion-js/env`. To use encrypted environment variables, set these two variables:

```
ORION_ENV_FILE_PATH=./config/env.yml
ORION_ENV_SECRET_KEY=your-decryption-password
```

See the [Env documentation](/overview/other-modules/env) for details.

## Requirements

* **Bun** >= 1.0 (default runtime)
* **Node.js** >= 22 (when using `--node` flag, also requires `tsx`)
* TypeScript
