# cortexd

Source: https://usecns.dev/cortex-cli-cortexd/

[Start here](https://usecns.dev/manual-cortex/)
[CLI commands](https://usecns.dev/commands-cortex/)
[Configuration & integration](https://usecns.dev/cortex-topics/)

Usage: `cortexd [OPTIONS]`. Starts the daemon in the foreground. It loads `.env`, host channel credentials and may refresh host OAuth before listening; use `PI_DURABLE_DISABLE_HOST_CONFIG=1` to disable host-secret loading/refresh in isolated setups. It performs Thalamus discovery once, creates the model catalog, optionally preloads a sandbox, acquires registry role and starts HTTP. It has no command/subcommand/help/version dispatch; unknown arguments are ignored, so **`--help` is not safe startup-free help**. This parser accepts separated values, not `--key=value`.

| Option | Environment/default | Meaning |
| --- | --- | --- |
| `--host <HOST>` | `PI_DURABLE_HOST` or `127.0.0.1` | HTTP bind host. |
| `--port <N>` | `PI_DURABLE_PORT` or `4319` | Numeric port. |
| `--session-dir <DIR>` | `PI_DURABLE_SESSION_DIR` or `./.pi-durable-sessions` | Session state, registry lock, discovery file and sandbox directory. |
| `--no-sandbox` | Sandbox preload enabled | Skip isolated implementer seat preload. |
| `--seat <ID>` | `PI_DURABLE_DEFAULT_SEAT` or `sandbox@local` | Sandbox seat ID, not a global selection for every client. |
| `--tunnel` | `PI_DURABLE_AUTO_TUNNEL` equals `1`/`true`, otherwise off | Auto-start ingress; with suitable Twilio configuration may update webhooks. |
| `--no-slack` | Auto-Slack on unless `PI_DURABLE_AUTO_SLACK` is `0`/`false` | Disable auto Socket Mode startup (otherwise requires app and bot tokens). |

`PI_DURABLE_API_TOKEN` configures daemon bearer authentication (no token CLI option). SIGINT/SIGTERM release the guard, remove daemon discovery state and close server/seats. Startup failure exits 1. Tunnel/Slack autostart failures log warnings rather than preventing the daemon from remaining up.

See [CLI conventions](https://usecns.dev/cortex-cli-usage/) for shared configuration and exit behavior, or [browse all commands](https://usecns.dev/commands-cortex/).