trywright
v1.1.0
Published
Visual Playwright browser sessions with an interactive UI — explore, debug, and automate without writing test code
Maintainers
Readme
Trywright
Trywright is a local Playwright control panel for exploring websites through a live browser session without creating a test project.
Open the UI, launch any URL in Chromium, Firefox, or WebKit, and use an interactive REPL to inspect and interact with the page.
Features
- Live browser preview in headless mode
- Native browser window in headed mode
- Single-line and multi-line Playwright REPL
page.autocomplete, examples, and reusable snippets- Page console, network failure, and uncaught error capture
- Searchable Playwright page API reference
- Full Playwright emulation for eight curated phones and tablets
- Configurable timeouts and screenshot rate
- Light and dark themes
Trywright is an exploration and learning tool. It is not a test runner, code generator, CI debugger, or replacement for Playwright codegen or UI mode.
Requirements
- Node.js 20 or later
- macOS or Linux
Windows is not supported.
Installation
npm install -g trywrightPlaywright browser binaries are downloaded automatically during installation. If that step is skipped or fails, run:
npx playwright installSome Linux distributions also require:
sudo npx playwright install-depsQuick Start
# Start the daemon in the background
trywright start
# Open the UI, optionally launching a URL immediately
trywright open
trywright open https://example.com
# Stop the daemon
trywright stopThe UI is served at http://localhost:3333 by default.
CLI Reference
| Command | Description |
|---|---|
| trywright start | Start the daemon in the background |
| trywright start --foreground | Start the daemon in the foreground and show logs |
| trywright stop | Stop the daemon |
| trywright open [url] | Open the UI, starting the daemon first when necessary |
| trywright status | Show daemon status and active sessions |
| trywright cleanup | Close all active browser sessions |
| trywright uninstall | Stop the daemon and remove its login startup item |
| trywright --version | Print the installed version |
| trywright --help | Show CLI help |
Using the REPL
page is the active Playwright Page.
Single-line mode awaits expressions automatically:
page.title()
page.locator('h1').textContent()
page.getByRole('button').count()
page.fill('#search', 'playwright')
page.keyboard.press('Enter')
page.goto('https://playwright.dev')
page.evaluate(() => window.innerWidth)Use Shift+Enter or the expand button for multi-line mode. Write await explicitly and use return when you want to display a result:
const heading = await page.locator('h1').textContent()
const links = await page.locator('a').count()
return { heading, links }Each REPL run is isolated. Variables do not persist between runs. Module loading, system globals, and waitFor* methods are blocked.
Session Modes
| Mode | Description | |---|---| | Headless | Runs the browser invisibly and streams screenshots to the UI | | Headed | Opens a native browser window for direct interaction |
Device Emulation
Desktop sessions use a 1280x800 viewport and allow Chromium, Firefox, or WebKit.
Named profiles apply Playwright's complete device descriptor, including viewport, user agent, device scale factor, touch support, and mobile behavior:
- Phones: iPhone SE (3rd gen), iPhone 15, iPhone 15 Pro Max, Pixel 7, Galaxy S24
- Tablets: iPad Mini, iPad Pro 11, Galaxy Tab S9
Portrait and landscape orientations are supported. Apple profiles use WebKit; Android profiles use Chromium. Profiles unavailable in the installed Playwright version are disabled.
Configuration
Trywright creates ~/.config/trywright/config.json on first run:
{
"port": 3333,
"maxSessions": 3,
"defaultMode": "headless",
"defaultBrowser": "chromium",
"screenshotFps": 10
}| Option | Default | Description |
|---|---|---|
| port | 3333 | Daemon HTTP and WebSocket port |
| maxSessions | 3 | Maximum concurrent sessions |
| defaultMode | "headless" | Initial session mode |
| defaultBrowser | "chromium" | Initial browser |
| screenshotFps | 10 | Headless preview refresh rate |
Restart the daemon after editing this file.
Troubleshooting
Browser binaries are missing
npx playwright installThe CLI is not found after installation
Restart the terminal, then verify that npm's global binary directory is on PATH:
npm config get prefix
trywright --versionThe UI does not open
Run the daemon in the foreground to inspect its output:
trywright start --foregroundDocumentation and Support
- Full documentation: trywright.dev/docs
- Report an issue: github.com/abhivaikar/trywright-issues/issues
License
See LICENSE.
