Commands
Quick reference
Section titled “Quick reference”| Command | Aliases | Description |
|---|---|---|
up | Create or start the workspace container | |
down | stop | Stop and remove the workspace container |
remove | rm, delete | Remove the workspace container and state |
shell | sh | Open an interactive shell (detects zsh/bash/sh) |
run | Run a command through a login shell (picks up mise/nvm/rbenv) | |
exec | Execute a command directly in the workspace container | |
restart | Restart the workspace container (picks up safe config changes) | |
rebuild | Rebuild the workspace (down + up) | |
logs | Show container logs | |
doctor | Check workspace health and diagnose issues | |
cache list | List package cache volumes | |
cache clean | Remove package cache volumes | |
prune | Remove stale and orphan workspace images | |
list | ls | List all workspaces |
status | ps | Show workspace container status |
version | Show version information |
Global flags
Section titled “Global flags”| Flag | Description |
|---|---|
--config, -C | Path to the devcontainer config directory |
--debug | Enable debug logging |
--verbose | Show full compose output (suppressed by default) |
Commands
Section titled “Commands”crib up
Section titled “crib up”Build the container image (if needed) and start the workspace. On first run, this builds the image, creates the container, syncs UID/GID, probes the user environment, and runs all lifecycle hooks. On subsequent runs, it starts the existing container and runs only the resume hooks (postStartCommand, postAttachCommand).
crib down
Section titled “crib down”Stop and remove the workspace container. This clears lifecycle hook markers, so the next crib up runs all hooks from scratch. Use this when you want a clean restart.
crib remove
Section titled “crib remove”Remove the workspace container, all associated images, and stored state. Shows a preview of what will be deleted and prompts for confirmation before proceeding.
crib remove # preview + confirmcrib remove --force # skip confirmation (useful in scripts)crib remove -f # shorthandcrib shell
Section titled “crib shell”Open an interactive shell inside the container. crib detects the user’s shell (zsh, bash, or sh) and uses the environment captured during crib up (including tools installed by version managers like mise, nvm, rbenv).
crib run
Section titled “crib run”Run a command inside the container through a login shell. This sources shell init files (.zshrc, .bashrc, .profile) before running your command, making tools installed by version managers (mise, asdf, nvm, rbenv) available on PATH.
crib run -- ruby -vcrib run -- bundle installcrib run -- npm testcrib exec
Section titled “crib exec”Run a command directly inside the container (raw docker exec). Does not source shell init files, so tools installed by version managers may not be on PATH. Use crib run instead if the command depends on shell init.
crib exec -- /usr/bin/envcrib exec -- bash -c "echo hello"Both run and exec inherit the probed environment (remoteEnv) from crib up.
crib restart
Section titled “crib restart”Restart the workspace, detecting what changed since the last crib up. See Smart Restart for details on how change detection works.
crib logs
Section titled “crib logs”Show container logs. Defaults to the last 50 lines. For compose workspaces, shows logs from all services.
crib logs # last 50 linescrib logs -f # follow (stream) all logscrib logs --tail 100 # last 100 linescrib logs -a # show all logs (no tail limit)crib doctor
Section titled “crib doctor”Check workspace health and diagnose issues. Detects orphaned workspaces (source directory deleted), dangling containers (crib label but no workspace state), and stale plugin data. Use --fix to auto-clean.
crib doctor # check for issuescrib doctor --fix # auto-fix found issuescrib cache
Section titled “crib cache”Manage package cache volumes created by the package cache plugin.
crib cache list
Section titled “crib cache list”List cache volumes for the current workspace. Shows volume name, provider, and disk usage.
crib cache list # current workspace onlycrib cache list --all # all workspacescrib cache clean
Section titled “crib cache clean”Remove cache volumes. Without arguments, removes all cache volumes for the current workspace. Pass provider names to remove specific ones.
crib cache clean # remove all for current workspacecrib cache clean npm go # remove specific providers onlycrib cache clean --all # remove all crib cache volumescrib prune
Section titled “crib prune”Remove stale and orphan workspace images. Shows a dry-run preview with sizes before prompting for confirmation.
- Stale: labeled images for an active workspace that are no longer the active build image or snapshot.
- Orphan: labeled images for a workspace that no longer exists in
~/.crib/workspaces/.
crib prune # stale images for current workspace + confirmcrib prune --all # all workspaces including orphanscrib prune --force # skip confirmationcrib rebuild
Section titled “crib rebuild”Full rebuild: runs down followed by up. Use this when the image needs to be rebuilt (changed Dockerfile, base image, or features). Clears any snapshot image so the build starts from scratch.
crib list
Section titled “crib list”List all known workspaces and their container status.
crib status
Section titled “crib status”Show the status of the current workspace’s container, including published ports. For compose workspaces, shows all service statuses with their ports.