# The interface

Source: https://laraport.app/docs/interface/

> How laraport's terminal UI works: screens, the frame, the command palette, jumping to a container, confirmations and the keys used everywhere.

## Screens

- **Home** shows the logo, the version and your servers. See [The home screen](#the-home-screen).
- Every other screen has a **header** with where you are (`▲ laraport › server › container › screen`) and how the server is reached, and a **status bar** with the current server and container and the keys that work right now. A [read-only server](https://laraport.app/docs/read-only/) is marked `READ-ONLY` there.
- Confirmations and forms open as **windows** over the dimmed screen.

## The home screen

The home screen lists your servers. Each shows how it is reached, `via <bastion>` for a jump host, its docker command, and `READ-ONLY` when it is [read-only](https://laraport.app/docs/read-only/).

| Key | Action |
|---|---|
| `enter` | Open the server's container list |
| `a` / `e` / `d` | Add / edit / delete a server |
| `i` | Import servers from `~/.ssh/config`. See [Importing](https://laraport.app/docs/servers/#importing-from-sshconfig) |
| `c` | Check every server. See [Checking every server](https://laraport.app/docs/servers/#checking-every-server) |
| `h` | The [journal](https://laraport.app/docs/journal/) of every server |
| `s` | Settings |
| `q` | Quit |

Below the servers, **Recent** lists the last four containers you opened: move down to one and press `enter` to open it, connecting first if needed. `ctrl+p` opens them and the rest, see [Jump to a container](#jump-to-a-container).

When a newer laraport is out, the home screen says so under the logo, with how to upgrade. See [Checking for new versions](https://laraport.app/docs/configuration/#checking-for-new-versions).

## Keys you will use everywhere

| Key | Action |
|---|---|
| `↑` `↓` or `j` `k` | Move |
| `enter` | Open or run |
| `esc` | Back, or close a window |
| `?` | Every key of the current screen |
| `ctrl+k` | Command palette |
| `ctrl+p` | Jump to a container or server |
| `pgup` `pgdn` | Scroll a page |
| `f2` | Line wrapping in output and log screens |
| `ctrl+c` | Quit |

The full list is in [Keyboard](https://laraport.app/docs/keys/).

## Command palette

`ctrl+k` lists every action of the current screen. Type to filter it: on a container, `log` finds Laravel logs, Docker logs and Service logs; `dump` finds the database dumps; `mig` finds Run migrations. `enter` runs the action.

*Screen: The command palette on a container, filtered to Run migrations*

On the home screen the palette opens and edits servers, imports from `~/.ssh/config`, checks all servers and opens the journal. On a container list it also has Events, the server's Journal, and Clean up container settings.

## Jump to a container

`ctrl+p` works from any screen. It lists, filtered as you type:

1. the containers you opened lately, newest first, with their server and when;
2. the other containers of the connected server;
3. every server.

`enter` opens the choice:

- On the same server, the screens above its container list close and the container opens.
- On another server, laraport goes home, connects, and opens the container once the list arrives.
- A Swarm task or Compose container is found by its service, so a redeploy that gave it a new name does not lose it. One that is gone says so.

The recent containers are kept in `~/.config/laraport/recent.json` (20 at most, mode `0600`). Deleting or renaming a server takes its entries with it.

While you type in a text field (a filter, a form, an editor), `ctrl+p` and `ctrl+k` go to that field. In Tinker, `ctrl+p` goes through the snippet history instead. Neither opens over a window such as a confirmation.

## Confirmations

Anything that changes or deletes something opens a confirmation that shows the exact command or SQL. Destructive ones focus **Cancel**, so pressing `enter` by habit does nothing.

## Colours and size

The colours follow Laravel red, with variants for light terminals. Layouts adapt down to 40×12: on small terminals the least important columns and rows go first.
