Workspaces¶
Workspaces are isolated container environments for your apps.
What is a Workspace?¶
A Workspace is a containerized development environment:
- Belongs to an App (your codebase)
- Runs in a Docker container
- Mounts your app's source code directory
- Has its own image with tools/dependencies
- Can be customized with different configurations
Think of it as your App running in dev mode.
Creating Workspaces¶
Basic Workspace¶
Create a workspace for the active app:
In a Specific App¶
With Description¶
With Custom Image Name¶
Default Neovim Configuration¶
New workspaces automatically get a pre-configured Neovim setup including:
- Structure:
lazyvimframework for modern Neovim - Plugin Package:
corewith 6 essential IDE plugins: - nvim-treesitter - Syntax highlighting
- telescope.nvim - Fuzzy finder
- which-key.nvim - Keybinding help
- nvim-lspconfig - Language server support
- nvim-cmp - Autocompletion
- gitsigns.nvim - Git integration
- Theme: Inherits from the theme cascade system
This means you get a fully functional IDE experience immediately—no manual configuration needed.
Managing Workspaces¶
List Workspaces¶
Output:
NAME APP IMAGE STATUS CREATED
● dev my-app dvm-dev-my-app:20240204-1200 ready 2024-02-04
test my-app dvm-test-my-app:pending pending 2024-02-04
feature-x my-app dvm-feature-x-my-app:pending pending 2024-02-04
Get Workspace Details¶
Delete a Workspace¶
Setting Active Workspace¶
Set which workspace commands operate on:
Check current context:
Clear active workspace:
Multiple Workspaces¶
Create different workspaces for different purposes:
Development Workspace¶
Your main coding environment:
Testing Workspace¶
For running test suites:
Feature Branch Workspaces¶
Isolated environments for features:
dvm create ws feature-auth --description "Authentication feature"
dvm create ws feature-payments --description "Payment integration"
Debug Workspace¶
With extra debugging tools:
Workspace Lifecycle¶
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ create │────▶│ build │────▶│ attach │
│ workspace │ │ (image) │ │ (container) │
└─────────────┘ └─────────────┘ └─────────────┘
│
▼
┌─────────────┐
│ detach │
│ (stop) │
└─────────────┘
- Create - Define the workspace
- Build - Build the container image
- Attach - Start and enter the container
- Detach - Stop the container
Switching Workspaces¶
# Start with dev
dvm use ws dev
dvm build
dvm attach
# ... work on code ...
# Exit container (Ctrl+D or exit)
# Switch to test
dvm use ws test
dvm build
dvm attach
# ... run tests ...
# Switch to feature branch
dvm use ws feature-auth
dvm build
dvm attach
Image Versioning¶
Workspace images are tagged with timestamps:
Format: dvm-<workspace>-<app>:<YYYYMMDD-HHMMSS>
When you run dvm attach:
- If the image changed since last attach, container is recreated
- Your code changes persist (they're mounted, not in the image)
Best Practices¶
Use Purpose-Specific Workspaces¶
# Good
dvm create ws dev
dvm create ws test
dvm create ws staging
# Less ideal - one workspace for everything
dvm create ws main
Add Descriptions¶
dvm create ws dev --description "Daily development with hot reload"
dvm create ws ci --description "Mimics CI environment"
Clean Up Unused Workspaces¶
Next Steps¶
- Apps - Understand the App object
- Building & Attaching - Container lifecycle details
- Commands Reference - Full command documentation