Shameless plug, but I’ve had a solution to this problem for years.
https://po-util.com
My tool installs the Particle toolchain and necessary dependencies for local building on Mac and Linux and provides shortcuts for building projects and flashing firmware. It even works with Atom or Workbench.