> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guild.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# guild workspace

> Create, select, and manage workspaces, their agents, and their context.

Manage workspaces and their contents.

```bash theme={null}
guild workspace list                              # List all accessible workspaces
guild workspace create <name>                     # Create a new workspace
guild workspace create <name> --owner <owner>     # Create for a specific owner (name or ID)
guild workspace get <identifier>                  # Get workspace details
guild workspace select                            # Set the default workspace (interactive)
guild workspace select <id-or-name>               # Set the default workspace directly
guild workspace current                           # Show current default workspace
guild workspace clear                             # Remove the default workspace setting
```

<Note>
  After a successful global workspace selection, `guild workspace select` prints to stderr: `To clear the default, run: guild workspace clear`. Pass `--quiet` to suppress it.
</Note>

## chat

Start a conversation with an agent.

```bash theme={null}
guild workspace chat                                   # Interactive chat with the Guild assistant
guild workspace chat "Summarize my open PRs"           # Start with an initial message
guild workspace chat --agent <identifier>              # Chat with a specific agent
guild workspace chat --workspace <identifier>          # Use a specific workspace
guild workspace chat --once "What is 2 + 2?"           # One-shot: send message and exit
guild workspace chat --resume <session-id>             # Resume a previous session (interactive or --once mode)
guild workspace chat --once --resume <session-id> "Another question"   # Resume a session in one-shot mode
guild workspace chat --events all                      # Include system and debug events
```

To chat with the agent you're currently developing, use `guild agent chat` from inside the agent directory.

## Workspace agents

```bash theme={null}
guild workspace agent list                    # List agents installed in workspace
guild workspace agent add <identifier>        # Install an agent
guild workspace agent remove <identifier>     # Remove an agent
```

## Workspace context

```bash theme={null}
guild workspace context list <workspace-id>                      # List context versions
guild workspace context get <workspace-id> <context-id>          # Get a version
guild workspace context edit <workspace-id>                      # Edit in $EDITOR, creates draft
guild workspace context edit <workspace-id> --from <context-id>  # Edit from a specific version
guild workspace context publish <workspace-id> <context-id>      # Publish a draft
```

## clear

Remove the default workspace setting from configuration.

```bash theme={null}
guild workspace clear
```

Behavior depends on where you run the command:

* **In an agent directory** (contains `guild.json`): removes `workspace_id` from `guild.json` and prints `✓ Cleared workspace setting for this agent`.
* **Outside an agent directory**: removes `default_workspace` and `default_workspace_name` from `~/.guild/config.json` and prints `✓ Default workspace cleared`.

If no default workspace is set, the command prints `No default workspace was set.` to stderr and exits successfully — it is not an error.

**Exit codes:** `0` on success or no-op; `1` on filesystem error only.
