{"id":31614272,"url":"https://github.com/lucasvtiradentes/chrome-cmd","last_synced_at":"2026-03-07T18:11:15.162Z","repository":{"id":318243492,"uuid":"1070466886","full_name":"lucasvtiradentes/chrome-cmd","owner":"lucasvtiradentes","description":"🌐 interact your Chrome browser from the command line","archived":false,"fork":false,"pushed_at":"2026-03-04T03:18:37.000Z","size":3475,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-04T07:32:30.411Z","etag":null,"topics":["automation","browser","chrome","claude-code","cli","terminal"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucasvtiradentes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-06T01:04:40.000Z","updated_at":"2026-03-04T01:07:45.000Z","dependencies_parsed_at":"2025-10-24T06:18:55.292Z","dependency_job_id":null,"html_url":"https://github.com/lucasvtiradentes/chrome-cmd","commit_stats":null,"previous_names":["lucasvtiradentes/chrome-cmd"],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/lucasvtiradentes/chrome-cmd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasvtiradentes%2Fchrome-cmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasvtiradentes%2Fchrome-cmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasvtiradentes%2Fchrome-cmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasvtiradentes%2Fchrome-cmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucasvtiradentes","download_url":"https://codeload.github.com/lucasvtiradentes/chrome-cmd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasvtiradentes%2Fchrome-cmd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30225858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T17:00:40.062Z","status":"ssl_error","status_checked_at":"2026-03-07T17:00:39.026Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","browser","chrome","claude-code","cli","terminal"],"created_at":"2025-10-06T10:36:53.594Z","updated_at":"2026-03-07T18:11:15.155Z","avatar_url":"https://github.com/lucasvtiradentes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://www.google.com/chrome/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n  \u003cimg width=\"64\" src=\"https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome.svg\" alt=\"Chrome logo\"\u003e\n\u003c/a\u003e\n\u003ch2\u003eChrome CMD\u003c/h2\u003e\n\u003cp\u003e\n  \u003ca href=\"#rocket-quick-start\"\u003eQuick Start\u003c/a\u003e • \u003ca href=\"#bulb-usage\"\u003eUsage\u003c/a\u003e • \u003ca href=\"#package-additional-information\"\u003eAdditional Information\u003c/a\u003e • \u003ca href=\"#star-inspiration\"\u003eInspiration\u003c/a\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n## Overview\n\nControl Chrome from the command line: list tabs, execute JavaScript, monitor network, capture screenshots, automate forms.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"80%\" src=\"https://raw.githubusercontent.com/lucasvtiradentes/chrome-cmd/main/.github/images/demo.webp\"\u003e\n\u003c/div\u003e\n\n## :sparkles: Features\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;✔️ **Tab control** - list, create, close, focus, and navigate tabs from terminal\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;✔️ **JavaScript execution** - run code in any tab and get instant results\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;✔️ **Network inspection** - capture HTTP requests with headers, payloads, and response bodies\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;✔️ **Console monitoring** - view color-coded logs with smart formatting and type filtering\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;✔️ **Screenshots** - capture full-page or viewport screenshots with single command\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;✔️ **Form automation** - click elements and fill input fields programmatically\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;✔️ **Storage inspection** - view cookies, localStorage, and sessionStorage data\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;✔️ **Multi-profile support** - manage multiple Chrome profiles with seamless switching\u003cbr\u003e\n\n## :rocket: Quick Start\n\n```bash\n# 1. Install\nnpm install -g chrome-cmd\n\n# 2. Run install command\nchrome-cmd install\n# → Shows extension path\n# → Guides you through the installation process\n# → Waits for Extension ID\n\n# 3. Load extension in Chrome\n# → Open chrome://extensions/\n# → Enable \"Developer mode\"\n# → Click \"Load unpacked\" and select the path shown\n# → Copy the Extension ID\n\n# 4. Paste Extension ID in terminal\n# → Paste and press Enter\n# → Installation complete!\n\n# 5. Start using!\nchrome-cmd tab list\n```\n\n## :bulb: Usage\n\nAll commands use the **selected tab** by default. Override with `--tab \u003cindex\u003e` flag.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eTab Management\u003c/b\u003e\u003c/summary\u003e\n\n\u003c!-- BEGIN:TAB_MANAGEMENT --\u003e\n```bash\n# List all open Chrome tabs\nchrome-cmd tab list\n\n# Select tab for subsequent commands\nchrome-cmd tab select\nchrome-cmd tab select --tab 1\n\n# Focus/activate a tab (bring to front)\nchrome-cmd tab focus\nchrome-cmd tab focus --tab 3\n\n# Create a new tab\nchrome-cmd tab create https://google.com\nchrome-cmd tab create https://google.com --background\nchrome-cmd tab create\n\n# Navigate tab to a specific URL\nchrome-cmd tab navigate https://github.com\nchrome-cmd tab navigate https://github.com --tab 2\n\n# Execute JavaScript in selected tab\nchrome-cmd tab exec \"document.title\"\nchrome-cmd tab exec \"document.images.length\"\nchrome-cmd tab exec \"Array.from(document.querySelectorAll('a')).map(a =\u003e a.href)\"\nchrome-cmd tab exec \"2 + 2\"\n\n# Close selected tab\nchrome-cmd tab close\n\n# Reload/refresh selected tab\nchrome-cmd tab refresh\n\n# Capture screenshot of selected tab\nchrome-cmd tab screenshot\nchrome-cmd tab screenshot --output ~/Downloads/page.png\nchrome-cmd tab screenshot --tab 2\nchrome-cmd tab screenshot --only-viewport\n\n# Extract HTML content from selected tab\nchrome-cmd tab html\nchrome-cmd tab html --selector \"div.content\"\nchrome-cmd tab html --raw\nchrome-cmd tab html --include-compacted-tags\n\n# Get console logs from selected tab\nchrome-cmd tab logs\nchrome-cmd tab logs -n 100\nchrome-cmd tab logs --error\nchrome-cmd tab logs --warn\nchrome-cmd tab logs --info --log --debug\nchrome-cmd tab logs --error --warn\n\n# Get network requests from selected tab\nchrome-cmd tab requests\nchrome-cmd tab requests -n 100\nchrome-cmd tab requests --method GET\nchrome-cmd tab requests --method POST\nchrome-cmd tab requests --status 200\nchrome-cmd tab requests --status 404\nchrome-cmd tab requests --url \"/api\"\nchrome-cmd tab requests --url \"google.com\"\nchrome-cmd tab requests --all\nchrome-cmd tab requests --failed\nchrome-cmd tab requests --body\nchrome-cmd tab requests --headers\nchrome-cmd tab requests --method POST --status 200 --url \"/api\"\nchrome-cmd tab requests --details 1\n\n# Get storage data from selected tab\nchrome-cmd tab storage\nchrome-cmd tab storage --cookies\nchrome-cmd tab storage --local\nchrome-cmd tab storage --session\n\n# Click on an element in selected tab\nchrome-cmd tab click --selector \"button.submit\"\nchrome-cmd tab click --text \"Sign In\"\n\n# Fill an input field in selected tab\nchrome-cmd tab input --selector \"#username\" --value \"myuser\"\nchrome-cmd tab input --selector \"#search\" --value \"query\" --submit\n\n```\n\n\u003c!-- END:TAB_MANAGEMENT --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eJavaScript Execution\u003c/b\u003e\u003c/summary\u003e\n\n\u003c!-- BEGIN:JAVASCRIPT --\u003e\n```bash\n# Execute JavaScript on selected tab\nchrome-cmd tab exec \"document.title\"\n# Output: \"GitHub - Chrome CMD\"\n\n# More examples\nchrome-cmd tab exec \"document.images.length\"\nchrome-cmd tab exec \"Array.from(document.querySelectorAll('a')).map(a =\u003e a.href)\"\nchrome-cmd tab exec \"2 + 2\"\n```\n\n\u003c!-- END:JAVASCRIPT --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eConsole Logs\u003c/b\u003e\u003c/summary\u003e\n\n\u003c!-- BEGIN:LOGS --\u003e\n```bash\nchrome-cmd tab logs\nchrome-cmd tab logs -n 100\nchrome-cmd tab logs --error\nchrome-cmd tab logs --warn\nchrome-cmd tab logs --info --log --debug\nchrome-cmd tab logs --error --warn\n```\n\n**Features:** Color-coded output, smart object formatting, type filtering, adjustable limit\n\n\u003c!-- END:LOGS --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eNetwork Requests\u003c/b\u003e\u003c/summary\u003e\n\n\u003c!-- BEGIN:REQUESTS --\u003e\n```bash\nchrome-cmd tab requests\nchrome-cmd tab requests -n 100\nchrome-cmd tab requests --method GET\nchrome-cmd tab requests --method POST\nchrome-cmd tab requests --status 200\nchrome-cmd tab requests --status 404\nchrome-cmd tab requests --url \"/api\"\nchrome-cmd tab requests --url \"google.com\"\nchrome-cmd tab requests --all\nchrome-cmd tab requests --failed\nchrome-cmd tab requests --body\nchrome-cmd tab requests --headers\nchrome-cmd tab requests --method POST --status 200 --url \"/api\"\nchrome-cmd tab requests --details 1\n```\n\n**Captured data:** URL, method, status, headers, payload, response body, timing, type, errors\n\n\u003c!-- END:REQUESTS --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eHTML Extraction\u003c/b\u003e\u003c/summary\u003e\n\n\u003c!-- BEGIN:HTML --\u003e\n```bash\nchrome-cmd tab html\nchrome-cmd tab html --selector \"div.content\"\nchrome-cmd tab html --raw\nchrome-cmd tab html --include-compacted-tags\n```\n\n**Features:** Pretty printing, CSS selectors, token optimization, raw mode\n\n\u003c!-- END:HTML --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eScreenshots\u003c/b\u003e\u003c/summary\u003e\n\n\u003c!-- BEGIN:SCREENSHOTS --\u003e\n```bash\nchrome-cmd tab screenshot\nchrome-cmd tab screenshot --output ~/Downloads/page.png\nchrome-cmd tab screenshot --tab 2\nchrome-cmd tab screenshot --only-viewport\n```\n\n\u003c!-- END:SCREENSHOTS --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eStorage Inspection\u003c/b\u003e\u003c/summary\u003e\n\n\u003c!-- BEGIN:STORAGE --\u003e\n```bash\nchrome-cmd tab storage\nchrome-cmd tab storage --cookies\nchrome-cmd tab storage --local\nchrome-cmd tab storage --session\n```\n\n**Data includes:** Cookie flags, expiry, size, key-value pairs\n\n\u003c!-- END:STORAGE --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eForm Automation\u003c/b\u003e\u003c/summary\u003e\n\n\u003c!-- BEGIN:FORM_AUTOMATION --\u003e\n```bash\nchrome-cmd tab click --selector \"button.submit\"\nchrome-cmd tab click --text \"Sign In\"\n```\n\n```bash\nchrome-cmd tab input --selector \"#username\" --value \"myuser\"\nchrome-cmd tab input --selector \"#search\" --value \"query\" --submit\n```\n\n\u003c!-- END:FORM_AUTOMATION --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eSystem Commands\u003c/b\u003e\u003c/summary\u003e\n\n\u003c!-- BEGIN:SYSTEM_COMMANDS --\u003e\n```bash\n# Install Chrome CMD extension\nchrome-cmd install\n\n# Update to latest version\nchrome-cmd update\n\n# Shell completion (bash/zsh)\nchrome-cmd completion install\n\nchrome-cmd completion uninstall\n\n# Profile management\nchrome-cmd profile remove           # Remove profile and bridge configuration\nchrome-cmd profile select           # Select active profile from configured profiles\n\n```\n\n\u003c!-- END:SYSTEM_COMMANDS --\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eCommand History\u003c/b\u003e\u003c/summary\u003e\n\nClick the Chrome CMD extension icon in your browser toolbar to view recent commands, execution times, and results.\n\n\u003c/details\u003e\n\n## :package: Additional Information\n\n**Prerequisites:** Node.js 18+, Google Chrome, Linux/macOS/Windows\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eMulti-Profile Support\u003c/b\u003e\u003c/summary\u003e\n\nYou can use chrome-cmd with multiple Chrome profiles. Just repeat the Quick Start setup for each profile:\n\n1. Open your other Chrome profile\n2. Run `chrome-cmd install` again\n3. Load the extension and paste the Extension ID\n\nTo switch between profiles:\n\n```bash\nchrome-cmd profile select\n# → Shows list of registered profiles\n# → Type the profile number\n# → All commands now run on selected profile\n```\n\nThe extension icon indicates which profile is active: the active profile shows the CLI icon, while other connected profiles show the default icon.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eUninstallation\u003c/b\u003e\u003c/summary\u003e\n\nTo completely remove chrome-cmd, run these commands in order:\n\n```bash\n# 1. Remove shell completions (if installed)\nchrome-cmd completion uninstall\n\n# 2. Manually remove the Chrome extension\n# Open chrome://extensions/ and click \"Remove\" on the Chrome CMD extension\n\n# 3. Uninstall the CLI package\nnpm uninstall -g chrome-cmd\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDevelopment setup\u003c/b\u003e\u003c/summary\u003e\n\nFor local development:\n\n```bash\n# Clone repository\ngit clone https://github.com/lucasvtiradentes/chrome-cmd.git\ncd chrome-cmd\n\n# Build CLI\ncd packages/cli\nnpm install\nnpm run build\n\n# Use with npm run dev\nnpm run dev -- tabs list\n```\n\n```bash\n# install\ncat \u003e ~/.local/bin/chrome-cmd-dev \u003c\u003c EOF\n#!/bin/bash\ncd $(pwd) \u0026\u0026 npx tsx src/cli/index.ts \"\\$@\"\nEOF\nchmod +x ~/.local/bin/chrome-cmd-dev\n\n# remove\nrm ~/.local/bin/chrome-cmd-dev\n```\n\nLoad extension from `packages/chrome-extension/` directory.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eHow it works\u003c/b\u003e\u003c/summary\u003e\n\nThe architecture uses a 3-layer design to enable terminal control of Chrome:\n\n```\n┌──────────────────────────────────────────────────────────────────────┐\n│  LAYER 1: Command Line Interface                                     │\n│  ┌────────────────────────────────────────────────────────────────┐  │\n│  │ $ chrome-cmd tab exec \"document.title\"                        │  │\n│  │                                                                │  │\n│  │ • Commander.js for CLI parsing                                 │  │\n│  │ • BridgeClient sends HTTP to bridge                           │  │\n│  │ • ConfigManager selects active Chrome profile                  │  │\n│  └────────────────────────────────────────────────────────────────┘  │\n└────────────────────────────────┬─────────────────────────────────────┘\n                                 │\n                          HTTP POST Request\n                       http://localhost:8765-8774\n                                 │\n┌────────────────────────────────▼─────────────────────────────────────┐\n│  LAYER 2: Bridge Server                                              │\n│  ┌────────────────────────────────────────────────────────────────┐  │\n│  │ Node.js HTTP Server + Native Messaging Bridge                  │  │\n│  │                                                                │  │\n│  │ • One instance per Chrome profile (auto-started)               │  │\n│  │ • HTTP server on dynamic port (8765-8774)                      │  │\n│  │ • Converts HTTP ↔ Chrome Native Messaging (stdin/stdout)       │  │\n│  │ • Registered in ~/.config/chrome-cmd/bridges.json              │  │\n│  └────────────────────────────────────────────────────────────────┘  │\n└────────────────────────────────┬─────────────────────────────────────┘\n                                 │\n                     Native Messaging Protocol\n                         (stdin/stdout JSON)\n                                 │\n┌────────────────────────────────▼─────────────────────────────────────┐\n│  LAYER 3: Chrome Extension (Service Worker)                          │\n│  ┌────────────────────────────────────────────────────────────────┐  │\n│  │ background.ts - Main command handler                           │  │\n│  │                                                                │  │\n│  │ • Connects to bridge via chrome.runtime.connectNative()        │  │\n│  │ • Dispatches commands to chrome.debugger API                   │  │\n│  │ • Returns results through bridge to CLI                        │  │\n│  │ • popup.ts shows command history                               │  │\n│  └────────────────────────────┬───────────────────────────────────┘  │\n└────────────────────────────────┼─────────────────────────────────────┘\n                                 │\n                      Chrome Debugger Protocol (CDP)\n                       chrome.debugger.sendCommand()\n                                 │\n                    ┌────────────▼─────────────┐\n                    │      Chrome Tabs         │\n                    │                          │\n                    │ • Execute JavaScript     │\n                    │ • Network monitoring     │\n                    │ • Console log capture    │\n                    │ • Screenshots            │\n                    │ • DOM manipulation       │\n                    └──────────────────────────┘\n```\n\n**Key Features:**\n- **Multi-profile support**: Each Chrome profile gets its own bridge instance\n- **Auto-recovery**: Bridge auto-starts when extension connects\n- **Port allocation**: Dynamic ports (8765-8774) prevent conflicts\n- **Bi-directional**: Commands flow down, results flow back up\n\n**Required permissions:**\n\n- `debugger` - Execute JavaScript, capture screenshots, monitor network/console\n- `scripting` - Inject content script for command details modal in popup\n- `tabs` - List and manage tabs, navigate, focus windows\n- `nativeMessaging` - Connect CLI to Chrome extension via bridge\n- `storage` - Track command history in extension popup\n- `identity` + `identity.email` - Auto-detect Chrome profile name (email)\n- `management` - Get extension installation info\n\n**⚠️ Not suitable for Chrome Web Store distribution** (requires debugger permission)\n\n\u003c/details\u003e\n\n## :star: Inspiration\n\n- [BroTab](https://github.com/balta2ar/brotab) - Original Python implementation\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e\n    \u003ca target=\"_blank\" href=\"https://www.linkedin.com/in/lucasvtiradentes/\"\u003e\u003cimg src=\"https://img.shields.io/badge/-linkedin-blue?logo=Linkedin\u0026logoColor=white\" alt=\"LinkedIn\"\u003e\u003c/a\u003e\n    \u003ca target=\"_blank\" href=\"mailto:lucasvtiradentes@gmail.com\"\u003e\u003cimg src=\"https://img.shields.io/badge/gmail-red?logo=gmail\u0026logoColor=white\" alt=\"Gmail\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp\u003eMade with ❤️ by \u003cb\u003eLucas Vieira\u003c/b\u003e\u003c/p\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasvtiradentes%2Fchrome-cmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucasvtiradentes%2Fchrome-cmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasvtiradentes%2Fchrome-cmd/lists"}