diff --git a/documentation/blog/2025-06-19-isolated-development-environments/index.md b/documentation/blog/2025-06-19-isolated-development-environments/index.md new file mode 100644 index 00000000..5f56b644 --- /dev/null +++ b/documentation/blog/2025-06-19-isolated-development-environments/index.md @@ -0,0 +1,119 @@ +--- +title: "Isolated Dev Environments in Goose with container-use" +description: Never worry about breaking your development setup again with containerized, git-branch-isolated development environments powered by container-use +authors: + - mic +tags: [extensions, containers, development, isolation, mcp, dagger] +--- + + + +Over ten years ago, Docker came onto the scene and introduced developers en masse to the concept and practice of containers. These containers helped solve deployment and build-time problems, and in some cases, issues with development environments. They quickly became mainstream. The technology underlying containers included copy-on-write filesystems and lightweight, virtual-machine-like environments that helped isolate processes and simplify cleanup. + +Dagger, the project and company founded by Docker’s creator [Solomon Hykes](https://www.linkedin.com/in/solomonhykes), has furthered the reach of containers for developers. + + One project that emerged from this work is [Container Use](https://github.com/dagger/container-use), an MCP server that gives agents an interface for working in isolated containers and git branches. It supports clear lifecycles, easy rollbacks, and safer experimentation, without sacrificing the ergonomics developers expect from local agents. + +Container Use brings containerized, git-branch-isolated development directly into your [Goose](/) workflow. While still early in its development, it's evolving quickly and already offers helpful tools for lightweight, branch-specific isolation when you need it. + + + +## The Problem with Local-Only Development + +Traditionally, developers build directly on their local machines, but that approach carries risks such as: + +- Dependencies can conflict between projects +- System changes might break other tools +- Experimental code risks your stable codebase +- Cleanup after failed experiments is tedious +- Processes are left running, resources consumed that aren't freed +- Changes are made which can't easily be undone + +## A Safer Alternative: Isolated Development Environments + +Container Use solves these problems by giving Goose the ability to work in completely isolated environments. Every experiment gets its own sandbox where nothing can affect your main development setup. + +- **Git branch isolation**: Each experiment automatically gets its own git branch, keeping code changes separate from your main codebase. +- **Container isolation**: Your code runs in clean, reproducible containers with exactly the dependencies it needs—nothing more, nothing less. +- **Easy reset**: When you're done experimenting, simply exit the environment. No cleanup required, no residual changes to worry about. + +## Getting Started + +### 1. Install Container Use + +**macOS (recommended):** +```bash +brew install dagger/tap/container-use +``` + +**All platforms:** +```bash +curl -fsSL https://raw.githubusercontent.com/dagger/container-use/main/install.sh | bash +``` + +### 2. Add to Goose + +Click this link to automatically add the extension: + +**[🚀 Add Container Use to Goose](goose://extension?cmd=cu&arg=stdio&id=container-use&name=container%20use&description=use%20containers%20with%20dagger%20and%20git%20for%20isolated%20environments)** + +Or manually add to `~/.config/goose/config.yaml`: + +```yaml +extensions: + container-use: + name: container-use + type: stdio + enabled: true + cmd: cu + args: + - stdio + envs: {} +``` + +## Real-World Use Cases + +### Experimenting with New Dependencies + +- **Prompt**: "I want to try adding Redis to this project, but I'm not sure if it's the right fit. Can you set up an isolated environment?" + +- **Result**: Goose creates a new git branch, spins up a container with Redis, and lets you experiment. If it doesn't work out, simply exit—no cleanup needed. + +### Risky Refactors + +- **Prompt**: "I want to completely restructure this codebase, but I need to be able to roll back easily." + +- **Result**: Work in an isolated branch and container where you can make sweeping changes without fear. Test your new architecture thoroughly. If the refactor succeeds, merge it back to main. If it fails, delete the branch and container. + +### Learning New Technologies + +- **Prompt**: "I want to try this new framework without installing dependencies on my main system." + +- **Result**: Experiment in a pre-configured container with all the tools you need. Learn at your own pace without cluttering your host system or worrying about version conflicts. + +### Split Testing Features + +- **Prompt**: "I want to test two different approaches to this feature - one using a REST API and another with GraphQL. Can you run both experiments simultaneously?" + +- **Result**: Goose spins up two isolated environments, each with its own git branch and container. One agent works on the REST implementation while another tackles GraphQL, both running in parallel without interfering with each other or your main codebase. Compare results and merge the winner. + +## Guide + +**[Get started with the full guide →](/docs/guides/isolated-development-environments)** + +--- + +*Questions? Join our [GitHub discussions](https://github.com/block/goose) or [Discord](https://discord.gg/block-opensource). Learn more about Dagger at [dagger.io](https://dagger.io/).* + +
+ + + + + + + + + + + \ No newline at end of file diff --git a/documentation/blog/2025-06-19-isolated-development-environments/sandbox.png b/documentation/blog/2025-06-19-isolated-development-environments/sandbox.png new file mode 100644 index 00000000..51906338 Binary files /dev/null and b/documentation/blog/2025-06-19-isolated-development-environments/sandbox.png differ diff --git a/documentation/docs/getting-started/using-extensions.md b/documentation/docs/getting-started/using-extensions.md index 451b7eec..955a3302 100644 --- a/documentation/docs/getting-started/using-extensions.md +++ b/documentation/docs/getting-started/using-extensions.md @@ -15,6 +15,10 @@ Goose to a wide ecosystem of capabilities. Check out the [step-by-step tutorials](/docs/category/tutorials) for adding and using several Goose Extensions ::: +:::tip Featured Extension +Looking for isolated development environments? Check out our guide on [Isolated Development Environments](/docs/guides/isolated-development-environments) using the new container-use extension. +::: + ## Built-in Extensions Out of the box, Goose is installed with a few extensions but with only the `Developer` extension enabled by default. diff --git a/documentation/docs/guides/isolated-development-environments.md b/documentation/docs/guides/isolated-development-environments.md new file mode 100644 index 00000000..660543eb --- /dev/null +++ b/documentation/docs/guides/isolated-development-environments.md @@ -0,0 +1,188 @@ +--- +title: Isolated Development Environments +sidebar_position: 25 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +This guide shows you how to set up isolated development environments using the **[Container Use MCP](https://github.com/dagger/container-use)** 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](https://github.com/dagger/container-use)** 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](https://github.com/dagger/container-use/blob/main/README.md) 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: + +**[Add Container-Use to Goose](goose://extension?cmd=cu&arg=stdio&id=container-use&name=container%20use&description=use%20containers%20with%20dagger%20and%20git%20for%20isolated%20environments)** + +### Method 2: Manual Configuration + +