---
title: Editor
description: Edit compose files and environment variables, and manage containers directly from the dashboard.
---

Selecting a stack opens the editor view - a split-pane layout with container management on the left and a full Monaco code editor on the right.

<Frame>
  <img src="/images/editor/editor-overview.png" alt="Editor view showing container panel and Monaco editor" />
</Frame>

## Compose file editor

The right panel shows your `compose.yaml` with full syntax highlighting. By default the editor is **read-only** to prevent accidental changes.

Click **Edit** to enter edit mode. Your changes are unsaved until you explicitly save them.

### Save options

| Button | What it does |
|--------|--------------|
| **Save** | Writes the file to disk. Does not restart any containers. |
| **Save & Deploy** | Writes the file, then immediately runs `docker compose up -d`. Use this to apply compose changes in one step. |
| **Discard** | Reverts the editor to the last saved version. Unsaved changes are lost. |

## Environment file editor

Click the **.env** tab to switch to the environment file editor. If your `compose.yaml` references multiple env files (via `env_file:`), a dropdown lets you select which file to edit.

The `.env` editor has the same save/discard controls as the compose editor. Changes take effect the next time the stack is deployed.

<Note>
  Sencho reads the `env_file:` paths from your `compose.yaml` to discover available env files. If no `env_file:` is declared, a default `.env` in the stack directory is used.
</Note>

## Container panel

The left panel lists all containers that belong to the selected stack. Each container shows:

- **Status badge** - `running`, `exited`, `starting`, or `unhealthy`
- **Live stats** - CPU %, RAM usage, and network I/O updated every 1–2 seconds
- **Port mappings** - host:container port pairs (if any)

### Container actions

Each container row has action buttons that appear on hover:

| Button | Icon | What it does |
|--------|------|--------------|
| **Open App** | External link | Opens the container's web UI in a new tab (uses the first mapped port) |
| **View Live Logs** | Scroll text | Opens a live log stream modal for that container (available when running) |
| **Open Bash Terminal** | Terminal | Opens an interactive bash session inside the container (admin only, available when running) |

<Frame>
  <img src="/images/editor/container-actions.png" alt="Container action buttons on a running container" />
</Frame>

### Log viewer

The log viewer streams output from a single container in real-time using Server-Sent Events. Logs auto-scroll to the bottom as new lines arrive. Close the modal to stop the stream.

### Container terminal (exec)

The terminal modal gives you an interactive bash shell inside the running container - equivalent to `docker exec -it <id> bash`. It uses a full xterm.js emulator with color support and tab completion.

<Warning>
  The container terminal requires the container to have `bash` (or `sh`) installed. Minimal images (e.g. Alpine-based) may need `sh` instead.
</Warning>
