Isolated Development Environments
This guide shows you how to set up isolated development environments using the Container Use MCP with Goose. With this setup, your development work will be isolated to both git branches and containers, allowing you to experiment freely without affecting your main system state. Note that the container-use MCP is very new and emerging, but offers powerful ways to do isolated development which are very agent friendly (build on tools like Docker, copy on write filesystems and more)
Overview
The Container Use MCP server provides containerized development environments that integrate seamlessly with Goose. This allows you to:
- Work on changes isolated to git branches
- Run code in containers without affecting your local machine
- Easily reset and start fresh when needed
- Maintain clean separation between different projects and experiments
- Work on things in parallel
Prerequisites
- Docker installed and running on your system
- Git installed and configured
- Goose installed and configured
Installation
Install Container Use
Head on over to the Container Use README for up to date install instructions for this fast moving project.
Adding to Goose
Method 1: Quick Setup Link
Click this link to automatically add the extension to Goose:
Method 2: Manual Configuration
- Goose Desktop
- Goose CLI
- Config File
- Click
...
in the top right corner of the Goose Desktop. - Select
Advanced Settings
from the menu. - Under
Extensions
, clickAdd custom extension
. - Fill in the details:
- Type:
Standard IO
- ID:
container-use
- Name:
Container Use
- Description:
Use containers with dagger and git for isolated environments
- Command:
cu
- Arguments:
stdio
- Type:
- Click
Add
button
- Run the configuration command:
goose configure
-
Select
Add Extension
from the menu. -
Choose
Command-line Extension
. -
Follow the prompts:
- Extension name:
Container Use
- Command:
cu stdio
- Timeout:
300
(or your preferred timeout) - Environment variables: None needed
- Extension name:
Add the following configuration to your ~/.config/goose/config.yaml
file:
extensions:
container-use:
name: container-use
type: stdio
enabled: true
cmd: cu
args:
- stdio
envs: {}
timeout: 300
Usage
Once the extension is enabled in Goose, you can:
Starting Isolated Development
Simply mention in your conversation with Goose that you want to work in an isolated environment:
"I want to experiment with adding a new feature, but I want to do it in an isolated environment so I don't affect my main codebase."
Goose will automatically:
- Create a new git branch for your work
- Set up a containerized environment
- Ensure all changes are isolated from your host system
Working with Experiments
"Let me try a completely different approach to this algorithm. Can you set up an isolated environment where I can experiment?"
Learning New Technologies
"I want to try out this new framework, but I don't want to install all its dependencies on my main system."
Benefits
- Safety: Experiment without fear of breaking your main development environment
- Reproducibility: Consistent environments across different machines and team members
- Isolation: Multiple projects can run simultaneously without conflicts
- Easy cleanup: Remove containers and branches when done
- Version control: All changes are tracked in isolated git branches
- Rollback capability: Easily discard failed experiments
Common Workflows
Feature Development
- Start a conversation with Goose about a new feature
- Request isolated development environment
- Goose creates branch and container
- Develop and test the feature
- If successful, merge the branch; if not, discard it
Dependency Exploration
- Ask Goose to explore a new library or tool
- Work in isolated container with the dependency
- Test compatibility and functionality
- Decide whether to integrate into main project
Refactoring
- Request isolated environment for major refactoring
- Make changes in safety of container and branch
- Test thoroughly before merging
- Easy rollback if issues arise
Troubleshooting
Common Issues
Docker not running:
- Ensure Docker Desktop is installed and running
- Check Docker daemon status:
docker info
Permission issues:
- Ensure your user has permission to run Docker commands
- On Linux, add user to docker group:
sudo usermod -aG docker $USER
Git issues:
- Ensure Git is properly configured with user name and email
- Check that you're in a Git repository when starting isolated work
Getting Help
If you encounter issues:
- Check the Container Use GitHub repository for documentation
- Verify all prerequisites are installed and working
- Join our Discord community for support
Next Steps
With container-use enabled in Goose, you're ready to develop with confidence. Try starting a conversation about a project you've been hesitant to experiment with, and let Goose set up a safe, isolated environment for your exploration.
Remember: with isolated environments, there's no such thing as a failed experiment—only learning opportunities that don't affect your main codebase.