/openbrowser:file-downloadfrom openbrowser
Downloads files from websites using browser sessions, handling PDFs, CSVs, images, and authenticated downloads. Preserves cookies and login sessions.
Ships in openbrowser. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Download files from websites using the browser's authenticated session. Handles PDFs, CSVs, images, and any downloadable content. Preserves cookies and login sessions for authenticated downloads.
Authenticated downloads need the browser session. OpenBrowser no-browser mode starts no Chrome, Blink, or V8 process, but it does not send browser cookies and cannot run JavaScript, so use download_file() for files that depend on a login.
The CLI examples below run with openbrowser-ai -c. The MCP route runs the same browser functions inside execute_code; place a complete task sequence in one execute_code call and reuse its context_id for later calls. The CLI daemon starts automatically and persists variables across calls. Run openbrowser-ai warm once before a multi-call CLI workflow to start the daemon and browser before the workflow begins. Most browser functions are async, use await. list_downloads(), download_outcomes(), and download_failures() are synchronous.
openbrowser-ai -c needs no separate OpenAI, OpenBrowser, or MCP API key.
The CLI daemon persists cookies and login state in the Chrome user-data directory at ~/.config/openbrowser/profiles/daemon, so authenticated sessions can be reused across later runs. No storage_state.json file is written unless you configure one explicitly.
Best route. Call download_file for URL downloads and cookie-bound files. For a click-triggered download, create the wait_for_download task before the click in the same execute_code call, then await it. Use download_outcomes() and download_failures() for synchronous history, and list_downloads() for the directory listing. Keep one MCP context or CLI daemon through login and download so the browser session and cookies stay attached. For MCP, call create_context once, pass its context_id to every execute_code call, and call close_context when the task ends. Use openbrowser-ai -c for a one-off CLI download or when MCP is unavailable, and run openbrowser-ai warm once before repeated CLI calls. Both routes need no separate API key. Use get_status after a failed or stalled call, and reset_browser only when no usable page target remains.
Before running, verify openbrowser-ai is installed:
openbrowser-ai --help
If not found, install:
# macOS/Linux
curl -fsSL https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.ps1 | iex
openbrowser-ai -c - <<'EOF'
await navigate("https://example.com/reports")
# Get browser state to find clickable download links
state = await browser.get_browser_state_summary(include_screenshot=False)
for idx, el in state.dom_state.selector_map.items():
text = el.get_all_children_text(max_depth=1)
if "download" in text.lower() or "pdf" in text.lower() or "export" in text.lower():
print(f"[{idx}] {el.tag_name}: {text}")
EOF
Use download_file() to download directly. This uses the browser's JavaScript fetch internally, preserving cookies and authentication:
openbrowser-ai -c - <<'EOF'
path = await download_file("https://example.com/reports/annual-report.pdf")
print(f"Saved to: {path}")
EOF
With a custom filename:
openbrowser-ai -c - <<'EOF'
path = await download_file(
"https://example.com/api/export?format=csv",
filename="sales-data.csv"
)
print(f"Saved to: {path}")
EOF
When the download URL is not directly visible, extract it from a link or button:
openbrowser-ai -c - <<'EOF'
# Extract href from a download link
download_url = await evaluate("""
(function(){
const link = document.querySelector("a[href$=\".pdf\"]");
return link ? link.href : null;
})()
""")
if download_url:
path = await download_file(download_url)
print(f"Downloaded: {path}")
else:
print("No PDF link found")
EOF
After downloading, use pypdf to extract text (requires pip install openbrowser-ai[pdf]):
openbrowser-ai -c - <<'EOF'
from pypdf import PdfReader
reader = PdfReader(path)
print(f"Pages: {len(reader.pages)}")
# Extract text from all pages
for i, page in enumerate(reader.pages):
text = page.extract_text()
print(f"--- Page {i+1} ---")
print(text[:500])
EOF
openbrowser-ai -c - <<'EOF'
from pathlib import Path
file_path = Path(path)
# CSV
if file_path.suffix == ".csv":
import pandas as pd
df = pd.read_csv(file_path)
print(df.to_string())
# JSON
if file_path.suffix == ".json":
import json
data = json.loads(file_path.read_text())
print(json.dumps(data, indent=2))
# Plain text
if file_path.suffix in (".txt", ".md", ".log"):
print(file_path.read_text())
EOF
openbrowser-ai -c - <<'EOF'
urls = [
"https://example.com/report-q1.pdf",
"https://example.com/report-q2.pdf",
"https://example.com/report-q3.pdf",
]
paths = []
for url in urls:
path = await download_file(url)
paths.append(path)
print(f"Downloaded: {path}")
print(f"Total files: {len(paths)}")
EOF
openbrowser-ai -c - <<'EOF'
files = list_downloads()
for f in files:
print(f)
print(f"Total: {len(files)} files")
EOF
When a button or link triggers the download, start wait_for_download before the click. The waiter captures the terminal outcome even when the file finishes quickly.
openbrowser-ai -c - <<'EOF'
import asyncio
waiter = asyncio.create_task(wait_for_download(timeout=30))
await click(download_button_index)
outcome = await waiter
print(outcome["phase"], outcome["path"], outcome["file_size"], outcome["stage"])
if outcome["phase"] == "failed":
print(outcome["error"])
EOF
wait_for_download returns phase (completed, failed, or cancelled), path, file_size, file_type, stage, error, and download_ref. To inspect earlier attempts, call download_outcomes(). To list only failures, call download_failures(). A download_ref resolves only in the current browser session's live registry; after the session stops or is replaced, read the completed history instead.
download_file() preserves the browser's login session on its browser-fetch path. Log in first, then download:
openbrowser-ai -c - <<'EOF'
# Navigate and log in
await navigate("https://portal.example.com/login")
await input_text(username_index, "[email protected]")
await input_text(password_index, "password")
await click(login_button_index)
await wait(2)
# Now download an authenticated resource
path = await download_file("https://portal.example.com/api/reports/confidential.pdf")
print(f"Downloaded: {path}")
EOF
-c - <<'EOF'), so all Python syntax works without shell escaping issues.download_file(url) when you need a deterministic filename and return path. navigate() may auto-download a PDF when auto_download_pdfs is enabled, but it does not return the saved path.requests fallback does not send browser cookies, so authenticated downloads can fail after fallback.wait_for_download before a click that triggers a download. A fast download can finish before a wait started afterward.(N) suffix (e.g., report (1).pdf).list_downloads() to see all files saved in the downloads directory. download_outcomes() and download_failures() are synchronous.download_file() has a 120-second timeout.Run this step after the task, whether it succeeded or failed.
MCP route cleanup. Call close_context with the same context_id after the last execute_code call. When the result is close_failed with retryable: true, call close_context again. Keep the close result in the task record.
Do not stop a daemon you did not start. Check openbrowser-ai daemon status before the first browser call. If it already reports a running daemon, reuse it and leave it running at the end. If it reports daemon_not_running, this run starts one and must clean it up.
For a daemon started by this run:
openbrowser-ai daemon stop
daemon stop only acknowledges the request and returns. Poll openbrowser-ai daemon status until it reports daemon_not_running, up to about 30 seconds. If the daemon does not exit, run openbrowser-ai daemon force-stop, which waits and verifies listener, owner, and browser cleanup.
If the task can fail mid-workflow, run the workflow and cleanup in one shell block. The same shell detects daemon ownership before installing the EXIT trap:
status=$(openbrowser-ai daemon status 2>&1 || true)
case "$status" in
*daemon_not_running*) OPENBROWSER_DAEMON_OWNED=1 ;;
*) OPENBROWSER_DAEMON_OWNED=0 ;;
esac
cleanup() {
if [ "${OPENBROWSER_DAEMON_OWNED:-0}" != "1" ]; then
return 0
fi
openbrowser-ai daemon stop >/dev/null 2>&1 || true
i=0
while [ "$i" -lt 30 ]; do
status=$(openbrowser-ai daemon status 2>&1 || true)
case "$status" in
*daemon_not_running*) return 0 ;;
esac
sleep 1
i=$((i + 1))
done
openbrowser-ai daemon force-stop >/dev/null 2>&1 || true
}
trap cleanup EXIT
# Place every openbrowser-ai -c call for this run in this same shell block.
Persist results to disk before stopping the daemon. daemon reset clears the Python namespace. Call done() only to mark the task complete inside the agent loop. Persist results and stop the daemon for cleanup.
Downloaded files in ~/Downloads/openbrowser-daemon/ survive daemon stop and daemon reset. Persist the exact paths you need before cleanup.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
file-download, browser-automation, pdf-download, web-scraping
8 skills in this plugin
/accessibility-auditAudit web pages for accessibility issues, WCAG compliance, and screen reader compatibility.
Routes through keyless local MCP `create_context` and `execute_code` tools plus the `openbrowser-ai -c` CLI. No separate API key is required.
Trigger when the user asks to: check accessibility, run an a11y audit, test WCAG compliance,
check screen reader support, audit ARIA attributes, verify keyboard navigation,
find accessibility issues, or check for missing alt text or labels.
/deep-researchUse when the user asks for search, web search, source discovery, research, investigations, evidence gathering, comparisons, literature reviews, briefings, or cited reports.
Uses host reasoning with the keyless `openbrowser-ai web-search`, guarded `safe_scrape.py`, and `-c` CLI. The MCP `web_search` tool is an optional lead-generation helper; its snippets are not evidence. Browser capture uses the dedicated CLI daemon. No separate API key is required. The `-p` prompt route is an optional configured-provider route; this skill never uses it.
/e2e-testingTest web applications end-to-end by simulating user interactions and verifying expected outcomes.
Routes through keyless local MCP `create_context` and `execute_code` tools plus the `openbrowser-ai -c` CLI. No separate API key is required.
Trigger when the user asks to: test a web app, verify a user flow, run end-to-end tests,
QA a feature, check that a page works correctly, validate user journeys, or test a deployment.
npx claudepluginhub billy-enrizky/openbrowser-ai --plugin openbrowserOther plugins' skills for the same job