1. Install xCommand to Slack
Before you can connect your CLI, you need to add the xCommand app to your Slack workspace.- Click the Add to Slack button above.
- Review the requested permissions. xCommand requires permissions to:
- Slash commands: Specifically the
/xcommandcommand for interaction. - Post messages: To send command results back to your channels.
- Channel history: To understand context in threads where xCommand is active.
- Slash commands: Specifically the
- Click Allow to complete the installation.
2. Connect Your CLI Session
Once the app is installed in your workspace, you can connect your specific CLI session (the machine where xCommand is running) to Slack.- In your terminal, start
xcommandor resume a session. - Type
/plugin slack connectand press Enter. - xCommand will generate a unique subscription command for this session. It looks like this:
- Copy this command.
3. Activate the Connection in Slack
To finish the bridge, go to any Slack channel where you want to interact with your terminal:- Paste the command you copied into the Slack message bar:
- Press Enter.
- You should receive a confirmation message in Slack:
“Slack Connection Active! Tunnel is open and waiting for events…“
4. Usage
Now that you’re connected, you can interact with your xCommand session directly from Slack.- Mentions: In any channel or thread where the app is present, mention
@xcommandfollowed by your request to get a response. - Example:
@xcommand What is the status of my pods? - Shell commands:
@xcommand \ls -la - Threaded context: Replies within a thread are automatically treated as part of the same conversation. Just keep mentioning
@xcommandin the thread to continue the investigation.
Your CLI session must be active and running for the Slack connection to work. If you quit the CLI, the tunnel will close.