Skip to main content
Mo runs on its own machine, so it cannot see localhost:3000 or an internal staging host. A tunnel exposes one or more hostname:port addresses from your machine to Mo through a Momentic Connector. Start the tunnel, pass its ID to qa start --tunnel, and stop it when the session is done. Named tunnels keep their ID across process restarts. Tunnels without --name are revoked when their process exits.
string
Read and write tunnel state in this directory instead of ~/.momentic/mo-tunnels. Use the same directory for every tunnel command and supervisor. To share it between accounts on one machine, grant those accounts read and write access; Linux accounts need a shared group. The directory contains private credentials.

tunnel start

Start a tunnel to one or more addresses.
string
One or more hostname:port addresses reachable from this machine. Required for a new tunnel. When resuming with --name, omit them to reconnect the saved tunnel.
string
Create or resume a named tunnel. qa tunnel stop <tunnel-id> stops its process and keeps its saved identity. Add --delete to revoke the tunnel and delete that identity.
boolean
Keep the tunnel attached to the terminal and run until you press Ctrl+C. By default the tunnel detaches and keeps running in the background.
boolean
Print the tunnel ID as JSON. Output is also JSON automatically when piped.
In a terminal, the ready summary shows the exposed addresses, a CLI command to start a session, and instructions for using Mo. It includes a link when the configured server has a known web URL. In Mo, open Session settings > Connector and select the tunnel ID in the same organization used by the CLI. Keep your app and this machine running while Mo uses the tunnel. The suggested CLI commands include the tunnel’s server. If you started the tunnel with --api-key, set MOMENTIC_API_KEY to that same key before running the suggested commands. The summary never prints your API key. Use --json for structured output:
In background mode the command returns immediately. In foreground mode it runs until you press Ctrl+C. Resume a named tunnel on the same machine without addresses or an API key:

tunnel update

Replace a tunnel’s destinations without restarting its host:
Pass the full address list. The command removes omitted addresses. Use the tunnel’s name or ID and an API key for the same organization. You can run the command from another machine; use the same --server as the tunnel. Sessions created with live tunnel access get the new routes; older sessions keep their original destinations. Changes take effect asynchronously; open connections may continue. If routing changes fail to apply, the CLI asks you to retry the same update.

tunnel stop

Stop the local host. Named tunnels keep their registration and saved identity so they can resume with the same name; no API key is needed to stop them.
Use qa tunnel start --name quiet-river-jump to resume a named tunnel. To revoke its registration and remove its saved identity, pass --delete with an API key:
Unnamed tunnels remain temporary and are revoked when their host exits. Both stop modes print { "tunnelId": "..." } on success.

tunnel list

List tunnels started from this machine.
status is starting, running, offline (a named tunnel saved on this machine but not running; resume it with qa tunnel start --name), unreachable (the state file exists but the process does not respond), or cleanup_failed (the process exited without revoking the tunnel; run qa tunnel stop to finish cleanup). mode is detached or foreground. Offline entries have no mode, pid or startedAt. An entry has an error string when the tunnel recorded a failure.

Example: test a local dev server

Keep the tunnel open while Mo and its sub-agents work. Export the report before closing it:
If qa wait exits 2, answer Mo with qa send and wait again. If it fails or the session is stopped, decide whether to resume the session before closing the tunnel with qa tunnel stop.

Notes

  • qa tunnel list shows tunnels saved in the selected state directory.
  • Multiple tunnels can run on the same machine and use the same state directory. Each tunnel ID has one running process and can serve several addresses.
  • A background tunnel outlives your shell. It stays open until you run qa tunnel stop.