Execute a Shell script failed with error

I'm trying to trigger a script to run on login: sudo yabai --load-sa. I have the current user added in the sudoers group so that there's no password prompt in the terminal. The command only works with sudo otherwise it throws yabai: '--load' is not a valid option!. But, with KM it throws the error below, while in the terminal it works fine. I could not figure out why?

Screenshot 2024-02-16 at 09.05.03

In your Terminal.app shell instance, you have defined a search path on which yabai can be found.

In the vanilla shell instance of a Keyboard Maestro Execute Shell Script action, you need to do the same (it starts afresh and doesn't automatically import settings from Terminal.app).

Alternatively, and perhaps more simply, you need to use the full path to yabai, rather than just its name.

( i.e. in Terminal, first try the incantation which yabai)