Nope, other than the use of the ActivityPub standard to communicate information, Mastodon and Lemmy are entirely separate pieces of software. Whether Lemmy, Kbin and similar also have vulnerabilities that would allow for a similar exploit are dependent on how they've been designed.
While the CLI provides the same functionality, it can be a lot easier to visually parse information or provide direct interactivity with a GUI instead. If you're working on a large project or just want a different way to display the information
git
provides, it makes things a bit smoother.