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

# CLI Commands

> Reference for TuringDB CLI commands: start, UI, and stop.

## Start

Starts the TuringDB server. This is the default command, running `turingdb` without a subcommand is equivalent to `turingdb start`.

```bash theme={null}
turingdb start [options]
```

### Options

| Flag                  | Description                               | Default     |
| --------------------- | ----------------------------------------- | ----------- |
| `-demon`              | Run TuringDB as a background daemon       | off         |
| `-p <port>`           | HTTP server listen port                   | `6666`      |
| `-i <addr>`           | HTTP server listen address                | `127.0.0.1` |
| `-turing-dir <path>`  | Root Turing home directory                | `~/.turing` |
| `-load <graph>`       | Load a graph at startup (can be repeated) |             |
| `-in-memory`          | Run without writing graphs to disk        | off         |
| `-reset-default`      | Delete the default graph before starting  | off         |
| `-ui`                 | Launch the built-in visualizer proxy      | off         |
| `-ui-port <port>`     | Visualizer proxy port                     | `8080`      |
| `-start-timeout <ms>` | Time to wait for daemon readiness         | `500`       |

### Examples

Interactive mode (default):

```bash theme={null}
turingdb
```

Daemon mode on a custom port:

```bash theme={null}
turingdb start -demon -p 7777
```

Daemon mode with the visualizer:

```bash theme={null}
turingdb -demon -ui
```

Load a graph at startup:

```bash theme={null}
turingdb -load mygraph
```

***

## UI

Launches the built-in graph visualizer.

```bash theme={null}
turingdb start -ui [options]
```

Once started, open the visualizer at `http://127.0.0.1:8080` (or the port set via `-ui-port`).

### Options

| Flag              | Description                    | Default |
| ----------------- | ------------------------------ | ------- |
| `-ui`             | Launch the built-in visualizer | off     |
| `-ui-port <port>` | Visualizer port                | `8080`  |

### Examples

Start TuringDB with the UI:

```bash theme={null}
turingdb -ui
```

Start TuringDB as a daemon with the UI on a custom port:

```bash theme={null}
turingdb -demon -ui -ui-port 9090
```

***

## Stop

Gracefully stops a TuringDB instance running as a daemon. It sends a stop signal through the Unix socket and waits for the process to shut down gracefully.

```bash theme={null}
turingdb stop [options]
```

### Options

| Flag                        | Description                                      | Default     |
| --------------------------- | ------------------------------------------------ | ----------- |
| `-turing-dir <path>`        | Root Turing directory of the instance to stop    | `~/.turing` |
| `-timeout <ms>` / `-t <ms>` | Time to wait for the process to release its lock | `3000`      |

### Examples

Stop the default instance:

```bash theme={null}
turingdb stop
```

Stop an instance running in a custom directory:

```bash theme={null}
turingdb stop -turing-dir /data/myturing
```
