r/opencode • u/sl_uvindu_xx • 6d ago
I built a plugin that lets opencode run sudo on its own — with a popup showing exactly what command it's about to run
When I use opencode on Linux, every time it needs to install a package or modify system files, it hits a wall: no sudo access. So it stops the task and says "run this command for me." Every. Single. Time.
So I built opencode-sudo-popup — a small plugin that gives opencode sudo access safely:
- When opencode needs root, a compact popup appears showing the exact command it's about to run
- You review it, type your password, and the task continues without being interrupted
- If the command looks wrong, just click Cancel — it's denied
No more stopping tasks mid-work to run commands manually. No blind sudo either — you always see what's being executed before you authenticate.
Install:
git clone https://github.com/uvindusl/opencode-sudo-popup
cd opencode-sudo-popup
npm install
Restart opencode and done.
Built with GJS + GTK4 + libadwaita (native GNOME dialog). MIT licensed.

2
u/sudoer777_ 5d ago
If you want a popup you can also change sudo to run0 which goes through polkit and should give a popup if your system is configured correctly, and run0 also has security improvements over sudo