How do I get Codex to use the browser?

Hi!

I’m really happy there’s a Codex CLI topic now - I have a huuuge list of questions :slight_smile: Starting with the first one: when I use Codex CLI, it often tells me that it cannot use the browser, which is very limiting for me. Example:

I didn’t run the test harness here since I can’t open the browser, so you’ll be the source of truth for the numbers.

However, I’m pretty sure there’s a way to let it use it. Do you have any suggestions? I installed npm install -g @playwright/cli@latest but apparently there are no Playwright skills for Codex, only for Claude Code or GitHub Copilot. I would include the link to the Playwright-cli repo, but the forum is telling me that I cannot include links….

1 Like

Good qeustion.

Note: I have never used playwright or used an AI to control or access a browser, just trying to help.

Checked the Issues both open and closed

For example:

by simonegiacomelli (Simone) · GitHub

Just for reference, below the excerpt that fixed the issue for me.

Pertinent section from ~/.codex/config.toml:

[mcp_servers.playwright]
command = "npx"
args = ["@playwright/mcp@latest"]
env_vars = ["DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "XDG_RUNTIME_DIR"]

HTH


FYI for others

3 Likes

Hi!
You can install the Playwright skill right inside the Codex CLI by using the /skills slash command and then following the decision tree.

/skills
1. List skills
skill-installer
19. playwright
3 Likes

I like this! Will try today and let you know how it goes.

EDIT: I followed your suggestion and it worked flawlessly! And it tastes even better when served with GPT-5.3-Codex :grin: man, do you guys cook!!

2 Likes