See the installation page of the Onyx Wiki.
Injecting to Stable or PTB is currently unsupported. However, you can use npm run onyx stable
or npm run plug ptb
to run the aforementioned unsupported versions of Onyx.
Long story short... yes. Onyx is against the Discord Terms of Service — but, you should keep reading:
As of right now, Discord is not going out of their way to detect client mods or ban client mod users. On top of that, Powercord does not make any manual HTTP requests unlike certain client mods / plugins, so your client's user agent is the same as a legitimate client. Meaning, Discord doesn't detect a client mod like Onyx. They can go out of their way to start detecting it, but they don't.
Hypothetically speaking - even if they somehow did detect Onyx, users are very unlikely to be banned on sight. It doesn't make sense for Discord to start banning a substantial part of it's userbase (client mod users) without any kind of warning. Not to mention it is mandatory for Onyx plugins to be fully API-compliant and ethical, implying Powercord users can't be banned for indirect ToS violations (e.g. selfbotting).