Search code examples
bashslack-apislack

Run bash command from slack


Can I create a slack bot or a custom command to run a bash command or script from slack?


Solution

  • You can't execute a bash command or script directly from a Slack integration, but you could do so indirectly. For example, you could create a slash command that executes a command URL on a host that you control. When that command URL is executed, your host can then run whatever commands or sequences you want on that host.

    But it would be very difficult, but not necessarily impossible, to ultimately execute a script on your local machine.