npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@extension-cli/cli

v0.1.3

Published

A skill-first browser extension CLI for AI agents on Chrome, Firefox, and Edge.

Readme

Extension CLI

A skill-first browser extension CLI for AI agents on Chrome, Firefox, and Edge.

Why Extension CLI?

  • Agent-first browser automation with predictable CLI primitives.
  • Works with real browser state (tabs, windows, history, sessions, bookmarks).
  • Safer defaults for destructive operations via human-in-the-loop confirmation.
  • Built for local workflows: fast iteration, explicit outputs, easy scripting.

How it works

flowchart LR
  A["AI Agent / User"] --> B["extension-cli (CLI)"]
  B --> C["Local Daemon (127.0.0.1:19883)"]
  C --> D["Browser Extension (WebSocket /ext)"]
  D --> E["Chrome APIs (tabs/windows/history/sessions/bookmarks/topSites/cookies/downloads/storage/readingList/debugger)"]
  E --> D
  D --> C
  C --> B
  B --> F["Structured JSON Output"]
  1. extension-cli sends commands to a local daemon.
  2. Daemon talks to the browser extension through WebSocket.
  3. Extension executes Chrome APIs and returns structured results.
  4. CLI prints JSON-friendly output for humans and AI agents.

Features

  • Unified browser API surface: tabs, tab-groups, windows, history, sessions, bookmarks, top-sites, cookies, downloads, storage, reading-list.
  • Event bridge support (events, events-clear, --follow) for runtime observability.
  • Cloudflare Browser Rendering integration (rendering namespace).
  • Risk controls for delete/remove operations:
    • interactive YES/NO confirmation
    • target tab preview (tabs remove: tabId, title, url)
    • machine-readable safety error (SAFETY_CONFIRMATION_REQUIRED)
    • non-interactive explicit ack (--yes --risk-ack ...)

Agent Prompt Examples

  • Group browser tabs into meaningful categories in current window.
  • Find inactive tabs in the current window and close the ones older than 7 days.
  • Summarize top domains from recent history and output JSON.
  • Move all tabs from social media domains into a new tab group named Later.
  • Export bookmark tree stats, then suggest cleanup candidates with duplicated titles.

Install

CLI Install

pnpm i -g @extension-cli/cli

Or run directly without global install:

npx @extension-cli/cli --help

Skill Install by npx skills

npx skills add extension-cli/extension-cli --skill extension-cli

Note: the executable command is still extension-cli.

Project Governance

  • Contributing guide: CONTRIBUTING.md
  • Code of conduct: CODE_OF_CONDUCT.md
  • Security policy: SECURITY.md
  • Support: SUPPORT.md

Setup Extension (required for browser APIs)

  1. Build extension
cd extension
pnpm install
pnpm run build
  1. Load extension (multi-browser)
  • Open chrome://extensions
  • Enable Developer mode
  • Click Load unpacked
  • Chrome: choose <project-root>/extension/.output/chrome-mv3
  • Edge: choose <project-root>/extension/.output/edge-mv3
  • Firefox: use <project-root>/extension/.output/firefox-mv3 as temporary add-on
  1. Back to project root
cd <project-root>

Command Reference

Use extension-cli <namespace> --help or extension-cli <namespace> <command> --help to view full argument and option details.

Safety: Human-in-the-loop for Destructive Commands

Commands that include remove or delete now require explicit human confirmation in an interactive terminal before execution.

  • If terminal is non-interactive (no TTY), these commands are rejected.
  • The prompt requires explicit YES/NO; only YES continues.
  • For extension-cli tabs remove, the prompt previews each target tab (tabId, title, url) before confirmation.
  • This is intentional to reduce accidental data loss or irreversible actions.

For AI Agent / non-interactive execution, use explicit acknowledgement flags:

extension-cli --yes --risk-ack "tabs remove" tabs remove --tab-ids "123"
extension-cli --yes --risk-ack "ALL" history delete-range --range '{"startTime":1,"endTime":2}'

When blocked in non-interactive mode, CLI emits machine-readable JSON with code SAFETY_CONFIRMATION_REQUIRED.

High-risk commands include:

extension-cli tabs remove
extension-cli windows remove
extension-cli history delete-all
extension-cli history delete-range
extension-cli history delete-url
extension-cli sessions remove-tab-value
extension-cli sessions remove-window-value
extension-cli bookmarks remove
extension-cli bookmarks remove-tree
extension-cli cookies remove
extension-cli downloads erase
extension-cli downloads remove-file
extension-cli storage local-remove
extension-cli storage sync-remove
extension-cli storage session-remove
extension-cli storage local-clear
extension-cli storage sync-clear
extension-cli storage session-clear
extension-cli reading-list remove-entry

Core

extension-cli doctor
extension-cli status [--verify-rendering-token]

extension-cli daemon status
extension-cli daemon start
extension-cli daemon stop

Tabs (chrome.tabs)

extension-cli tabs query
extension-cli tabs capture-visible-tab
extension-cli tabs connect
extension-cli tabs create
extension-cli tabs detect-language
extension-cli tabs discard
extension-cli tabs duplicate
extension-cli tabs get
extension-cli tabs get-current
extension-cli tabs get-zoom
extension-cli tabs get-zoom-settings
extension-cli tabs go-back
extension-cli tabs go-forward
extension-cli tabs group
extension-cli tabs highlight
extension-cli tabs move
extension-cli tabs reload
extension-cli tabs remove
extension-cli tabs send-message
extension-cli tabs set-zoom
extension-cli tabs set-zoom-settings
extension-cli tabs ungroup
extension-cli tabs update
extension-cli tabs methods
extension-cli tabs events
extension-cli tabs events-clear

Tab Groups (chrome.tabGroups)

extension-cli tab-groups get
extension-cli tab-groups move
extension-cli tab-groups query
extension-cli tab-groups update
extension-cli tab-groups methods
extension-cli tab-groups events
extension-cli tab-groups events-clear

Windows (chrome.windows)

extension-cli windows create
extension-cli windows get
extension-cli windows get-all
extension-cli windows get-current
extension-cli windows get-last-focused
extension-cli windows remove
extension-cli windows update
extension-cli windows methods
extension-cli windows events
extension-cli windows events-clear

History (chrome.history)

extension-cli history auth grant
extension-cli history auth revoke
extension-cli history auth events

extension-cli history sync
extension-cli history viz
extension-cli history stats
extension-cli history categories
extension-cli history domains
extension-cli history classify

extension-cli history add-url
extension-cli history delete-all
extension-cli history delete-range
extension-cli history delete-url
extension-cli history get-visits
extension-cli history search

extension-cli history methods
extension-cli history events
extension-cli history events-clear

Sessions (chrome.sessions)

extension-cli sessions auth grant
extension-cli sessions auth revoke
extension-cli sessions auth events

extension-cli sessions get-recently-closed
extension-cli sessions get-devices
extension-cli sessions restore
extension-cli sessions set-tab-value
extension-cli sessions get-tab-value
extension-cli sessions remove-tab-value
extension-cli sessions set-window-value
extension-cli sessions get-window-value
extension-cli sessions remove-window-value

extension-cli sessions methods
extension-cli sessions events
extension-cli sessions events-clear

Bookmarks (chrome.bookmarks)

extension-cli bookmarks auth grant
extension-cli bookmarks auth revoke
extension-cli bookmarks auth events

extension-cli bookmarks sync
extension-cli bookmarks viz
extension-cli bookmarks stats
extension-cli bookmarks categories
extension-cli bookmarks domains
extension-cli bookmarks classify

extension-cli bookmarks create
extension-cli bookmarks get
extension-cli bookmarks get-children
extension-cli bookmarks get-recent
extension-cli bookmarks get-tree
extension-cli bookmarks get-sub-tree
extension-cli bookmarks move
extension-cli bookmarks remove
extension-cli bookmarks remove-tree
extension-cli bookmarks search
extension-cli bookmarks update

extension-cli bookmarks methods
extension-cli bookmarks events
extension-cli bookmarks events-clear

Top Sites (chrome.topSites)

extension-cli top-sites auth grant
extension-cli top-sites auth revoke
extension-cli top-sites auth events

extension-cli top-sites get
extension-cli top-sites methods

Cookies (chrome.cookies)

extension-cli cookies get
extension-cli cookies get-all
extension-cli cookies get-all-cookie-stores
extension-cli cookies set
extension-cli cookies remove

extension-cli cookies methods
extension-cli cookies events
extension-cli cookies events-clear

Downloads (chrome.downloads)

extension-cli downloads download
extension-cli downloads search
extension-cli downloads erase
extension-cli downloads get-file-icon
extension-cli downloads accept-danger
extension-cli downloads cancel
extension-cli downloads open
extension-cli downloads pause
extension-cli downloads remove-file
extension-cli downloads resume
extension-cli downloads show
extension-cli downloads show-default-folder

extension-cli downloads methods
extension-cli downloads events
extension-cli downloads events-clear

Storage (chrome.storage)

extension-cli storage local-get
extension-cli storage local-set
extension-cli storage local-remove
extension-cli storage local-clear
extension-cli storage local-bytes

extension-cli storage sync-get
extension-cli storage sync-set
extension-cli storage sync-remove
extension-cli storage sync-clear
extension-cli storage sync-bytes

extension-cli storage session-get
extension-cli storage session-set
extension-cli storage session-remove
extension-cli storage session-clear
extension-cli storage session-bytes

extension-cli storage managed-get
extension-cli storage managed-bytes

extension-cli storage methods
extension-cli storage events
extension-cli storage events-clear

Reading List (chrome.readingList)

extension-cli reading-list add-entry
extension-cli reading-list query
extension-cli reading-list update-entry
extension-cli reading-list remove-entry

extension-cli reading-list methods
extension-cli reading-list events
extension-cli reading-list events-clear

Rendering (Cloudflare Browser Rendering REST API)

# auth
extension-cli rendering login
extension-cli rendering logout

# content extraction
extension-cli rendering content
extension-cli rendering markdown
extension-cli rendering links
extension-cli rendering json
extension-cli rendering scrape
extension-cli rendering snapshot

# binary output
extension-cli rendering screenshot
extension-cli rendering pdf

# crawl jobs
extension-cli rendering crawl
extension-cli rendering crawl-result
extension-cli rendering crawl-cancel

Key options:

# login (non-interactive)
extension-cli rendering login --account-id <id> --api-token <token>

# most rendering endpoints support body merge
extension-cli rendering markdown <url> --body '{"gotoOptions":{"waitUntil":"networkidle0"}}'
extension-cli rendering markdown <url> --body-file ./payload.json

# json extraction
extension-cli rendering json <url> --prompt "Extract title and summary"
extension-cli rendering json <url> --schema-file ./schema.json
extension-cli rendering json <url> --response-format-file ./response-format.json

# scrape selectors
extension-cli rendering scrape <url> --selector "main" --selector "a"

# snapshot file outputs
extension-cli rendering snapshot <url> --content-out ./page.html --screenshot-out ./page.png

# screenshot/pdf output and navigation controls
extension-cli rendering screenshot <url> --out ./shots/ --wait-until networkidle0 --timeout 45000 --full-page
extension-cli rendering screenshot <url> --viewport-width 1440 --viewport-height 900
extension-cli rendering pdf <url> --output ./reports/page.pdf --wait-until networkidle0 --timeout 45000

# crawl polling controls
extension-cli rendering crawl <url> --wait --poll-interval 5 --timeout 300
extension-cli rendering crawl <url> --no-wait
extension-cli rendering crawl-result <jobId> --limit 100 --cursor <cursor> --status completed

Quickstart Examples

# tabs query
extension-cli tabs query --active --current-window
extension-cli tabs query --url "https://*.github.com/*"

# local sync (cache path: ~/.extension-cli/sync)
extension-cli bookmarks sync
extension-cli history sync --max-results 20000

# local analytics
extension-cli bookmarks viz --json
extension-cli history stats --json

# rendering
extension-cli rendering login
extension-cli rendering markdown https://example.com
extension-cli rendering json https://example.com --prompt "Extract main title"
extension-cli rendering screenshot https://example.com --out ./shots/

Notes

  • rendering screenshot --out supports directory path (auto filename).
  • rendering json supports --prompt, --schema, --response-format, and --body extensions.
  • Credential file defaults to ~/.extension-cli/rendering-auth.json.

License

MIT