Skip to content

Terminal UI

Switch environments, follow logs, run commands, restart services, and add teammates from the terminal.

Run mm with no arguments in an interactive terminal, from anywhere inside a project:

sh
mm
mm --environment staging

The terminal UI opens on the default environment, or on the one you name. It refreshes on its own: every 3 seconds for a local environment and every 10 seconds for a remote one. Press ? in any view for its keys and q to quit.

Use explicit subcommands in scripts; the terminal UI needs an interactive terminal.

Find your way around

The header shows the project, the environment, and where that environment runs: local, or remote and the target's name. A remote environment gets a solid label so it is hard to miss.

Views are listed in the sidebar and numbered. Press the number to open one.

KeyViewWhat it is for
1OverviewHealth at a glance and what needs attention
2EnvironmentsEvery environment, where it runs, and switching
3ServicesServices and containers, with their actions
4IngressRoutes and why a service has none
5VariablesWhat each service reads and where the value comes from
6MountsDevelopment mounts
7DiagnosticsEvery finding, with its fix
8TLSThe local certificate authority
9AccessWho you are on the host, and the team
0GatesAccess policies and their users

Providers, Jobs, and Guided have no number: reach them with tab, or with [ and ], which jump between sidebar groups.

See and switch environments

Press 2.

The Environments view lists four environments with where each runs, its services, and its deployed commit

Each row is one environment from the project configuration: where it runs, its runtime, how many services are running, the deployed commit, and when it was last checked. The current environment is live. The others are checked when you open the view; press r to check them again. Checking a remote environment opens one SSH connection to its host, so the view does not poll them.

Select an environment and press enter to switch to it. Every other view then shows that environment. If the host cannot be reached, the terminal UI says why and stays where it was. esc cancels a switch in progress.

An environment marked not set up names a target this machine does not know. Register the target, or use the repository's target definition, then press r.

Act on a service or a container

Press 3. Services with more than one container list them underneath; space folds and unfolds the selected service.

Select a service or one of its containers and press enter for its actions, or use the action's key directly.

The action menu for a service offers logs, run a command, restart, and variables

KeyActionOn a serviceOn a container
lLogsEvery containerThat container
xRun a commandIts first running containerThat container
rRestartEvery containerThat container
vVariablesThe service's variablesThe same

Follow logs

l opens the last 200 lines and follows new ones.

The log view follows a service and marks warnings and errors

KeyEffect
j k, arrows, pgup pgdnScroll. Scrolling up pauses; new lines are counted
spacePause, or return to the newest line
/Show only lines that contain the text you type
wWrap long lines, or cut them at the edge
tShow the time of each line
cClear the lines shown so far
rConnect again after the stream ended
escClose

Lines from standard error have a bar in the margin. Lines that mention an error or a warning are tinted. Configured secret values are redacted, as in mm service logs. The view keeps the newest 5,000 lines.

Run a command

x asks for a command and runs it in one container.

The output of a command, with its exit code

The arguments are passed exactly as typed: no shell runs and there is no TTY. Quotes group words. For pipes, redirects, or variables, start a shell yourself:

text
sh -c 'ls /app | wc -l'

The up and down arrows recall earlier commands. A command may run for 30 seconds, the same limit as mm service exec; esc stops it sooner. When it ends, enter asks for another and r runs the same one again. Commands that need input, such as a shell or a database console, need mm service shell instead.

Restart

r asks first, then restarts the containers. The image, configuration, and volumes stay as deployed; to pick up a changed variable or image, press u to deploy instead. On Docker Swarm, restart replaces the service's tasks in the order its update policy sets, and a single container cannot be restarted.

Change the configuration

Environments, jobs, schedules, configuration values, and the team can be changed without leaving the terminal UI. The keys are the same in every view that supports them:

KeyEffect
aAdd
eEdit the selected item
DRemove the selected item

Each change follows the same three steps as mm config:

  1. Fill in a short form. tab moves between fields and the arrow keys change a choice. An edit keeps every key the form does not show.
  2. Review the exact diff of the configuration file. Nothing is written before this point; b goes back to the form.
  3. enter writes the file. If your review is out of date because the file changed meanwhile, mm refuses and asks you to review again.

A change is a change to files in your checkout. On a remote environment it takes effect when you commit, push, and deploy; the terminal UI lists those steps after it saves.

ViewWhat you can change
EnvironmentsAdd, edit (target, runtime, deploy branches), and remove
VariablesSet or remove a key's value for the current environment
JobsAdd, edit, and remove jobs and schedules
AccessAdd a teammate, change their level, remove them

Change a variable

Press 5, or v on a service to see only its variables. / searches and p shows only the variables with a problem.

KeyOn a local environmentOn a remote environment
enterSet a value for this workspace only (a local override), or enter a secret without showing itSet the value in the configuration
xRemove the local overrideNot available
cSet the value in the configuration, for everyoneThe same
DRemove the value from the configurationThe same

After a local change, press u to start the stack again with the new value.

Add a teammate

Access to remote environments is declared in the repository's users: key: who each person is, their public keys, and their level per environment. See manage remote access for the levels.

Press 9 for the Access view, then a.

The form to add a teammate asks for a name, a public key, and a level per remote environment

  1. Ask your teammate to run mm key create and then mm key show, and to send you the line that starts with ssh-ed25519. It is a public key; the private half never leaves their machine.
  2. Enter their name and paste the key.
  3. Choose a level for each remote environment with the arrow keys. none leaves them out of that environment.
  4. Press enter and review the diff.
    The review shows the lines added to the users file
  5. Press enter again to write the file. The terminal UI then lists what is left to do.
    After saving, the terminal UI lists the commit, merge, and deploy steps

The change gives nobody access by itself. It takes effect when it is merged and each environment is deployed, or when an admin runs mm team sync there. Who may merge it is up to your repository: move the users into their own file with mm config split users and list .config/mm/users.yaml in CODEOWNERS to give access its own reviewers.

To change someone's level, select them and press e. To remove them, press D; they keep access to an environment until it is deployed again.

Request access for yourself

On a new machine, press 9 and then j. The terminal UI creates this device's key if it has none, proposes your entry with the levels you ask for, and shows the same review. Commit the change on a branch and open a pull request; a code owner grants the access by merging it.

Work on a remote environment

The Services view of a remote environment shows the target, who you are on the host, and the deployed commit

On a remote environment the terminal UI talks to the host's remote daemon with your device key, and the host decides what you may do. The Services view shows the target, who the host says you are, your access, and the deployed commit.

ActionOn a remote environment
Status, logsAvailable with view access
Run a commandAvailable when the host grants you exec for the service
uReviews and applies a deploy of your current commit
RestartNot available yet. Deploy again to replace the containers
StopNot available. Stop the stack on the host
Variablesenter sets the value in the configuration. Local overrides do not reach a host, so commit and deploy to apply it

Variables are shown from your checkout. When your checkout differs from the deployed commit, the view says so instead of showing values the host does not use.