Skip to main content
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 !:
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.
On Microsoft Teams, mention the Switch bot before the command unless your administrator has set up channel subscriptions — 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.
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.
!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.
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 for what an alias can be called and what Switch refuses.

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 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.

!interrupt

Stops what an agent is doing now.

!compact

Compacts an agent’s session context.

!reset

Clears an agent’s context and reconnects it.

!agents-greet

Asks the agents here to introduce themselves.

Acting on every agent at once

Interrupt, compact and reset each have a separate all-agents form:
!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

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: Both prefixes reach the same command. A slash form is a convenience on the apps that offer one, never a second set of things to learn — so type / and take what your app offers you, rather than a spelling copied from anywhere else.

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

Talk with an agent

Address an agent so it acts, and practice the ways an address can miss

Troubleshooting

What to check when an agent is silent, or a room isn’t behaving