How to use ego (lite) with OpenCode
Set up OpenCode browser automation with ego (lite). Enable auto-approve permissions, load ego-browser in Desktop or the TUI, and complete a browser task.
OpenCode can control ego (lite) from either its desktop app or terminal interface. In this guide, OpenCode opens Anthropic's X profile in an ego (lite) agent Space, reads the first five posts, and returns the result in the conversation.
The complete video above follows the Desktop workflow. The same ego-browser skill and task prompt work in the TUI.
Before you start: install ego (lite)
Install ego (lite) and finish onboarding before opening OpenCode.
- Download the DMG and open it
- Follow the instructions and double-click the ego (lite) icon to install
- Open ego (lite) and finish onboarding
- Open a project in OpenCode Desktop, or start OpenCode from that project's directory in Terminal
Onboarding writes ego-browser to ~/.agents/skills/. OpenCode discovers skills from this directory. If OpenCode was already running, quit and reopen it before starting the guide.
Choose OpenCode Desktop or the TUI
For Desktop, open a project and start a new session. For the TUI, open Terminal in the project directory and run:
opencode --auto
The --auto flag starts OpenCode with auto-approve enabled. You can use the same ego-browser command and task prompt in both interfaces.
Step 1: Enable auto-accept permissions
Desktop
In OpenCode Desktop, open Settings > General and turn on Auto-accept permissions. This is OpenCode's equivalent of the bypass permissions mode used in this guide. It allows the agent to start ego (lite) and send local browser commands without pausing for approval.
TUI
In the TUI, launch OpenCode with opencode --auto. You can also open the command palette and select Enable auto-approve permissions.
Step 2: Load the ego-browser skill
Desktop
Start a new session and enter /ego-browser. Select ego-browser from the list and submit it as a separate message. Once the skill is loaded, send the browser task in your next message.
The skill can now open ego (lite), create an agent Space, and operate the page inside that Space. If it does not appear, confirm that ego (lite) onboarding is complete and restart OpenCode.
TUI
The recording above shows the TUI workflow. OpenCode loads the ego-browser Skill in the terminal session and then receives the browser task. The Skill works the same way as it does in Desktop: it opens ego (lite), creates an agent Space, and controls the page inside that Space.
Step 3: Let OpenCode work in the browser
Give the task to OpenCode. The agent will use ego-browser to open Anthropic's X profile in ego (lite), read the requested posts, and prepare the result in the OpenCode conversation.
The Desktop app and TUI follow the same process. Once the task is submitted, the Agent handles the browser work through ego (lite).
Step 4: Complete the task
When the run finishes, OpenCode returns the five posts with their visible details, direct links, and a short summary of each post. Anthropic's X profile remains open in ego (lite), and the browser task is complete.
Troubleshooting
ego-browser does not appear
Finish ego (lite) onboarding, quit OpenCode, and open it again. The installed skill should be available from ~/.agents/skills/.
OpenCode loads the skill but ego (lite) does not open
In Desktop, check Settings > General > Auto-accept permissions. In the TUI, close the current session and restart it with opencode --auto.
The TUI opens in the wrong project
Exit OpenCode, change to the project directory in Terminal, and run opencode --auto again. OpenCode uses the current directory as the project context.
X asks you to sign in or verify the account
Complete the login or verification in the ego (lite) agent Space, then ask OpenCode to continue the task.
Go deeper
- Quick start: install ego (lite) and run your first browser task
- Claude Code browser automation: switch from Cowork to Code and enable bypass permissions
- Codex browser automation: use ego-browser from Codex Desktop or the TUI
- Cursor browser automation: run ego-browser from Cursor Agent
- ego-browser: learn the browser helper commands
- OpenCode permissions: see the current auto-approve modes and permission settings
- OpenCode Agent Skills: see where OpenCode discovers installed skills