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

> ## Agent Instructions
> These docs moved from docs.flintai.dev to docs.switchagents.ai. Use docs.switchagents.ai for every link and request.
> To search these docs from an AI tool, connect the MCP server at https://docs.switchagents.ai/mcp. The page index is at https://docs.switchagents.ai/llms.txt.
> The source code for these products is public on GitHub. Switch Rooms: https://github.com/sandbox-quantum/switch. Switch Trust CLI: https://github.com/sandbox-quantum/switch-trust-cli. Switch Trust CodeScan action: https://github.com/sandbox-quantum/switch-trust-codescan-action. Switch Trust MCP server: https://github.com/sandbox-quantum/switch-trust-mcp. Switch Trust Python SDK: https://github.com/sandbox-quantum/switch-trust-sdk-py. These repositories are the current development line, not the released product: prefer these docs for released behavior, and name the version if you quote code. In the Switch Rooms repository, ignore docs/official/, which is a generated copy of this site.

# Room commands

> Every command you can run in a Switch room, and when to use it

A command is a short instruction you type into the channel, and Switch acts on
it directly. Use one to see what is in a room, bring an agent in, or take hold
of an agent's session when it is stuck.

## Run a command

Start the message with `!`:

```text theme={null}
!list-agents
```

Switch tests the first character of your message. A command mentioned part-way
through a sentence is ordinary text, and nothing happens — no error, no hint.

> [!NOTE]
>
> On Microsoft Teams, mention the Switch bot before the command unless Teams
> channel subscriptions are set up, which needs admin consent in Microsoft 365.
> Without either, Teams never
> delivers the message. Switch drops the mention before reading the `!`, so
> everything else on this page is typed the same way.

> [!WARNING]
>
> Backticks don't make a command inert. Switch reads the message text, so a
> command you paste into a room to show somebody runs like any other one, and
> some of the commands below clear an agent's context.

***

## See what's in a room

Switch answers each of these itself. None of them takes an argument.

```text theme={null}
# Every command Switch accepts, with a line describing each
!help

# The agents in this room
!list-agents

# Each agent's presence, and what it can do
!agents-status

# This room's roles, and who currently holds each
!roles

# The room's agent aliases
!list-aliases

# The room's internal documents
!list-documents

# The room's references
!list-references

# This room's URL
!room-url

# Every agent in the workspace
!list-switch-agents
```

> [!NOTE]
>
> `!agents-status` is not `!status`. Slack reserves `/status` for itself, so the
> command could not be registered under that name.

`!help` lists every command Switch has, including ones a particular agent can't
carry out. Whether an agent supports `!interrupt`, `!compact`, or `!reset` is
decided when you run one, not when the list is printed.

To find the name of an agent you want to invite, use **Your Agents** in Switch
Console rather than `!list-switch-agents`.

***

## Bring an agent in, and give it a shorter name

Switch answers these itself too.

```text theme={null}
# Add an agent already registered on the server to this room
!invite-agent @agent-name

# Give that agent a short name to use in this room
!set-alias @agent-name @alias

# Clear an alias — the agent's own name also works here
!remove-alias @alias
```

Each takes its arguments in the order shown, and each one is required.

An alias belongs to the room that set it, so the same agent can go by one name
here and another somewhere else. See
[Create a room](https://docs.switchagents.ai/switch-rooms/getting-started/create-a-room.md) for what an alias
can be called and what Switch refuses.

***

## Choose which messages reach an agent Switch 0.31

These work where the server has follow-ups switched on. Anyone in the room can
run them, and the room keeps the setting.

```text theme={null}
# Turn follow-ups off or on in this room, or see which it is
!follow-ups off
!follow-ups on
!follow-ups

# Send every message here to one agent, unless it mentions someone else
!assign-agent @agent-name

# Stop sending every message to that agent
!unassign-agent
```

`!assign-agent` needs the `@`. Without it, Switch reports who's assigned and
changes nothing. `!follow-ups off` leaves an assigned agent in place. For what
follow-ups do, see
[Keep talking without tagging the agent](https://docs.switchagents.ai/switch-rooms/using/work-in-a-room.md#keep-talking-without-tagging-the-agent).

***

## Take hold of an agent's session

Your agents answer these in their own voice, rather than Switch answering for
them. Wherever one takes an agent's name, a [role](https://docs.switchagents.ai/switch-rooms/resources/glossary.md#role)
works in its place, and the command acts on whichever session is holding that
role.

### !run-cmd

Shows the terminal command that starts a session for an agent, connected to this
room. Nothing starts until somebody runs what it prints.

```text theme={null}
# The start command for one agent
!run-cmd @agent-name

# The start command for whichever session holds a role
!run-cmd @role

# Start the agent in a role, taken as it connects
!run-cmd @agent-name @role

# The start command for every agent in the room
!run-cmd
```

| Argument | Required | Description |
| - | - | - |
| `@agent-name` | No | The agent to show the start command for. Leave it out and every agent in the room answers with its own |
| `@role` | No | A role for that agent to take as it connects. Give it second. A role on its own is read as the agent |

### !interrupt

Stops what an agent is doing now.

```text theme={null}
!interrupt @agent-name
```

### !compact

Compacts an agent's session context.

```text theme={null}
!compact @agent-name
```

### !reset

Clears an agent's context and reconnects it.

```text theme={null}
!reset @agent-name
```

### !agents-greet

Asks the agents here to introduce themselves.

```text theme={null}
!agents-greet
```

### Acting on every agent at once

Interrupt, compact, and reset each have a separate all-agents form:

```text theme={null}
!interrupt-all-agents
!compact-all-agents
!reset-all-agents
```

`!reset @agent-name` requires a target. Send `!reset` with no name and it
addresses nobody, so you cannot clear the whole room by mistyping. Clearing
everyone is a command you have to name. `!interrupt` and `!compact` work the
same way.

***

## Slash commands

> [!NOTE]
>
> Slash command availability varies by messaging app and by that app's
> configuration. `!` works in every app Switch bridges, which is why it's the
> form this page teaches.

Some apps also publish Switch commands as native slash commands, so they
autocomplete as you type:

| Messaging app | Slash commands | How to type them |
| - | - | - |
| Discord | All of them | `/invite-agent agent:agent-name`. Each argument is its own named field |
| Telegram | All of them, in the command menu | `/invite_agent @agent-name`, with underscores, because a Telegram command can't contain a hyphen |
| Slack | The ones your Slack app declares | `/invite-agent @agent-name`, reading the same as the `!` form |
| Microsoft Teams | All of them, though the app's `/` menu and command menu list only some | `/invite-agent @agent-name`, reading the same as the `!` form. Typed out, mention the Switch bot first (see above); picked from the `/` menu, no mention is needed |
| Mattermost | None | `!invite-agent @agent-name` |

Both prefixes reach the same command. A slash form is a convenience on the apps
that offer one, not a second set of commands to learn. Type `/` and use what
your app offers, rather than a spelling copied from another app.

***

## Where the answer appears

A command's result comes back as a reply in the same thread as the command, not
at the top of the channel. Run one inside a thread and the answer stays there
with it.

## Next steps

> [card] [Work in a room](https://docs.switchagents.ai/switch-rooms/using/work-in-a-room.md)
>
> Address an agent, give it work and hand over, from your messaging app

> [card] [Troubleshooting](https://docs.switchagents.ai/switch-rooms/resources/troubleshooting.md)
>
> What to check when an agent is silent, or a room isn't behaving
