# jdx daemon

IDE equivalent: Warm background JVM (5-min idle shutdown)

Manage the background daemon: a hot JVM answering queries over a unix socket (start, stop, status, restart). The daemon shuts itself down after --idle without requests (default 5m, 0 disables).

## Usage

```text
jdx daemon [<options>] <command> [<args>]...
```

## Subcommands

### `jdx daemon start`

Start the daemon for a workspace (idempotent: already running exits 0). Spawns a background JVM and waits until its socket answers health.

```text
jdx daemon start [<options>]
```

| Option | Description |
|---|---|
| `--workspace=<text>` | Workspace the daemon serves. |
| `--idle=<text>` | Idle shutdown after this long without requests (e.g. 30s, 5m, 2h; 0 disables). |
| `--json` | Emit machine-readable JSON instead of human-readable text (same information, D-007). |
| `-h, --help` | Show this message and exit |

### `jdx daemon stop`

Stop the daemon for a workspace. Exits 1 when no daemon is running.

```text
jdx daemon stop [<options>]
```

| Option | Description |
|---|---|
| `--workspace=<text>` | Workspace the daemon serves. |
| `--json` | Emit machine-readable JSON instead of human-readable text (same information, D-007). |
| `-h, --help` | Show this message and exit |

### `jdx daemon status`

Report the daemon for a workspace: uptime, memory, indexed artifacts, query count. Exits 1 when no daemon is running.

```text
jdx daemon status [<options>]
```

| Option | Description |
|---|---|
| `--workspace=<text>` | Workspace the daemon serves. |
| `--json` | Emit machine-readable JSON instead of human-readable text (same information, D-007). |
| `-h, --help` | Show this message and exit |

### `jdx daemon restart`

Restart the daemon for a workspace: stop when running, then start.

```text
jdx daemon restart [<options>]
```

| Option | Description |
|---|---|
| `--workspace=<text>` | Workspace the daemon serves. |
| `--idle=<text>` | Idle shutdown after this long without requests (e.g. 30s, 5m, 2h; 0 disables). |
| `--json` | Emit machine-readable JSON instead of human-readable text (same information, D-007). |
| `-h, --help` | Show this message and exit |

### `jdx daemon run`

Run the daemon in the foreground (internal: daemon start spawns this).

```text
jdx daemon run [<options>]
```

| Option | Description |
|---|---|
| `--workspace=<text>` | Workspace the daemon serves. |
| `--idle=<text>` | Idle shutdown after this long without requests (e.g. 30s, 5m, 2h; 0 disables). |
| `-h, --help` | Show this message and exit |

## Options

| Option | Description |
|---|---|
| `-h, --help` | Show this message and exit |

## Full help text

```console
$ jdx daemon --help
Usage: jdx daemon [<options>] <command> [<args>]...

  Manage the background daemon: a hot JVM answering queries over a unix socket (start, stop, status, restart). The daemon shuts itself down after --idle without requests (default 5m, 0 disables).

Options:
  -h, --help  Show this message and exit

Commands:
  start    Start the daemon for a workspace (idempotent: already running exits 0). Spawns a background JVM and waits until its socket answers health.
  stop     Stop the daemon for a workspace. Exits 1 when no daemon is running.
  status   Report the daemon for a workspace: uptime, memory, indexed artifacts, query count. Exits 1 when no daemon is running.
  restart  Restart the daemon for a workspace: stop when running, then start.
  run      Run the daemon in the foreground (internal: daemon start spawns this).
```

## Learn more

Guide: [MCP, daemon, HTTP & batch](https://mohammadmd1383.github.io/jdx/docs/serving/) · [All commands](https://mohammadmd1383.github.io/jdx/docs/reference/)
