Concepts
Runs and sessions
Both start a Linux guest from a snapshot of your checkout. A run ends with its command. A session stays until you close it.
The snapshot in /work
At startup, unContainer copies the Git worktree root (or the current directory outside Git) into /work. The copy includes uncommitted, untracked and ignored files. Large directories such as node_modules add to startup time and guest memory.
Runs
uncontainer run -- COMMAND boots a guest, runs the command in /work, relays stdout, stderr and the exit code, and discards the guest. Every run sees the current state of your files.
Session lifecycle
- Open.
session openboots a guest for the current worktree. Opening it again from the same worktree reuses the running session. - Exec.
session exec -- COMMANDruns in/work. Commands share files, processes and localhost. - Refresh. Host edits made after startup enter the guest when you close and reopen the session. A fresh
runalways sees them, andrun --httpscopies them in as you save. - Close.
session closediscards guest state, including build outputs and Docker data.
Sharing a session
Agents working in the same worktree share its session. One agent can start a service while another runs tests against it. Coordinate before closing a shared session.
CPU, memory and distro
| Setting | Flag | Range | Default |
|---|---|---|---|
| vCPUs | --cpus N | 1–16 | 1 |
| Guest RAM | --memory SIZE | 128MiB–4GiB, whole MiB | Engine default |
| Distro | --distro NAME | debian, alpine, debian:docker | debian |
Settings apply when the guest boots. Opening an existing session without them keeps its current allocation. To change them, close and reopen. Alpine uses musl and BusyBox; Debian uses glibc. Pick the one that matches your project’s Linux binaries.
Sessions without a worktree
A session can outlive the worktree it came from. session list marks those entries, and prune closes them:
uncontainer session prune --dry-run
uncontainer session prunePruning closes sessions whose original worktree disappeared or whose path now points to a different directory. Use session close ID from any directory to close a single one.