Sessions And Environments
rmux is built around two things:
- environments for a project directory
- sessions inside that environment
Environment Lifecycle
Create an environment for the current directory:
You can also use the namespaced form:
Check status:
env status shows the current environment record plus runtime details such as provider, region or zone, transport, deployment state, last sync time, exposed public IP details, and the session table for that environment.
Sync the local directory into the bound environment:
Stop compute but keep remote state:
Destroy the environment entirely:
rmux env down <name-or-id> and rmux env down --all are also available when you want to stop other visible environments.
If a destroy hits partial cleanup failures, rmux env status shows the cleanup state and rmux env destroy can be retried.
Default Session
When you create a new environment, rmux creates a default session named main.
Attach to it:
Run a command inside it:
rmux session run bun test
Named Sessions
Create a new session:
rmux session new -s agent-a
Attach to a named session:
rmux session attach -t agent-a
List all sessions:
Kill a named session:
rmux session kill -t agent-a
If the target session workspace has uncommitted changes, rmux session kill may ask for confirmation. Use --force to skip that prompt.
Workspace Isolation
Session workspaces are isolated by session name:
main uses the shared /workspace root
- non-
main sessions use git worktrees when the project is a git repo
- non-
main sessions use copied folders when the project is not a git repo
You can inspect the workspace type and path with:
rmux session ls
rmux env status
Logs
Show logs for the default session:
Follow logs for a named session:
rmux session logs -t agent-a --follow
Secrets And Ports
Set a secret on the current environment:
rmux env secrets set OPENAI_API_KEY your-value
List secrets:
Remove a secret:
rmux env secrets rm OPENAI_API_KEY
List exposed ports:
Expose a port:
rmux env expose returns the generated URL immediately. rmux env ports lists all current exposed ports and URLs.
Usage And Targeting
Show backend-wide usage and visible environments:
Stop another environment by name or ID:
rmux env down my-environment
rmux env down env_123
Stop every visible environment for the current backend:
Backend Differences
| Backend | Attach transport | Sync behavior | Notes |
|---|
aws | AWS SSM Session Manager | env sync stages an archive through S3 into the devbox. | BYOC AWS can auto-discover or create shared defaults such as the workspace bucket and security group during preflight and create. |
gcp | gcloud compute ssh | env sync copies the current directory directly with gcloud compute scp. | The current GCP path does not use a workspace bucket, and the preflight check is read-only. |
managed | AWS SSM Session Manager through the control plane | env sync stages an archive through deployment-managed S3. | If managed.attachRoleArn is configured, attach can use short-lived AWS credentials instead of permanent user AWS credentials. |
Across all backends, the remote workspace root is /workspace, sessions run in host tmux, and non-main sessions use git worktrees for git repos and copied directories for non-git projects.Last modified on March 19, 2026