playwright-cli
Browser Automation With playwright-cli
This system provides playwright-cli via Nix (see nixos/flake.nix for the nixpkgs PR patch and nixos/code.nix for installation), so it’s available on PATH without any npm -g installs.
Quick Start
# First run (downloads browser bits used by Playwright)
playwright-cli install-browser
# Open a new browser session (optionally with a URL)
playwright-cli open
playwright-cli open https://example.com/
# Navigate, inspect, and interact
playwright-cli goto https://playwright.dev
playwright-cli snapshot
playwright-cli click e15
playwright-cli type "search query"
playwright-cli press Enter
# Save artifacts
playwright-cli screenshot --filename=page.png
playwright-cli pdf --filename=page.pdf
# Close the browser
playwright-cli close
Practical Workflow
playwright-cli open(oropen <url>)playwright-cli snapshot- Use element refs (
e1,e2, ...) from the snapshot withclick,fill,hover,check, etc. - Take
screenshot/pdfas needed playwright-cli close
Tips
- Use
playwright-cli state-save auth.json/state-load auth.jsonto persist login state across runs. - Use named sessions with
-s=mysessionwhen you need multiple concurrent browsers. - Set
PLAYWRIGHT_CLI_PACKAGEto pin the npm package (default is@playwright/cli@latest).
More from colonelpanic8/dotfiles
email-unsubscribe-check
Use when user wants to find promotional or unwanted recurring emails to unsubscribe from, or when doing periodic inbox hygiene to identify senders worth unsubscribing from
19release
Use when user asks to release, publish, bump version, or prepare a new version for deployment
1slides
Build, edit, render, import, and export presentation decks with the preloaded @oai/artifact-tool JavaScript surface through the artifacts tool.
1spreadsheets
Build, edit, recalculate, import, and export spreadsheet workbooks with the preloaded @oai/artifact-tool JavaScript surface through the artifacts tool.
1org-agenda-api
Use when interacting with the org-agenda-api HTTP server to read/write org-mode agenda data
1journaling
Use when user wants to journal, reflect, write a journal entry, or process thoughts. Also use when user mentions wanting to talk through what's on their mind.
1