# Getting started

Run `dev-cockpit dev` from a directory that contains a `cockpit.yaml`. The TUI boots into the **Targets** tab (or whatever `config.defaultPane` points at) and starts any processes + health checks declared in your config.

Don't have a `cockpit.yaml` yet? `dev-cockpit init-config -i` walks you through it in eight steps with auto-detection from `package.json` / `compose.yaml`.

## At a glance

- **Cycle tabs** — `←` / `→` (or `Tab` / `Shift-Tab`). Empty tabs (Targets with no rows, Health with no checks) auto-hide.
- **Quit** — `q`
- **Toggle notifications for this session** — `n`
- **Open the `:` command palette** — `:` (any tab). Type to filter actions, ↑↓ to navigate, Enter to fire.

Every tab fills the full terminal. Modals (filter, search, `:` palette) render in place of the active pane.

## What the panes do

- **Targets** — repos, docker services, and processes as "runnable units". Split layout (≥200 cols) shows the row list on the left and the actions registered for the selected row on the right; under narrow terminals the panels stack vertically. Built-in `[r]` restarts docker containers and processes; declare more via `config.actions[]` (or a profile's `actions`).
- **Output** — streaming logs from processes and Docker services. Filter + search modals (`f` / `/`); open the most recent error in `$EDITOR` with `e`. Severity glyphs (`⚠`, `✗`) keep lines scannable without color.
- **Health** — workspace health checks; each row has a one-keystroke remediation.
- **Help** — this guide. `j` / `k` to flip pages, `↑` / `↓` to scroll.

## Try it on a fixture

The repo ships two minimal sample projects under `tests/fixtures/`:

- `tests/fixtures/plain-node/` — no docker dependency. Watcher (`tsc --watch`), `http-ok` health against a tiny http server, and a `file-exists` health on `package-lock.json`.
- `tests/fixtures/dockerized/` — a `docker compose` stack (alpine heartbeat + redis), `container-running` and `port-open` health checks, log tailing.

```sh
cd tests/fixtures/plain-node
npm install
node src/server.mjs &      # so the http-ok check goes green
dev-cockpit dev

# Or for the docker variant:
cd tests/fixtures/dockerized
docker compose up -d
dev-cockpit dev
```

These fixtures double as the project's smoke tests (`tests/fixtures/smoke.test.ts`) — running `npm test` parses each `cockpit.yaml` and asserts the shell renders.
