Skip to main content

Control your browser's tabs from the command line

Project description

BroTab

GitHub GitHub tag (latest by date) PyPI version Mozilla Add-on Chrome Web Store

Control your browser's tabs from the terminal.

About

No command has been specified
usage: bt [-h] {move,list,close,activate,search,open,words,text,html,dup,windows,clients} ...

bt (brotab = Browser Tabs) is a command-line tool that helps you manage browser tabs. It can
help you list, close, reorder, open and activate your tabs.

positional arguments:
  {move,list,close,activate,active,search,index,open,words,text,html,dup,windows,clients,install}
    move                move tabs around. This command lists available tabs and runs
                        the editor. In the editor you can 1) reorder tabs -- tabs
                        will be moved in the browser 2) delete tabs -- tabs will be
                        closed 3) change window ID of the tabs -- tabs will be moved
                        to specified windows
    list                list available tabs. The command will request all available
                        clients (browser plugins, mediators), and will display
                        browser tabs in the following format:
                        "<prefix>.<window_id>.<tab_id><Tab>Page title<Tab>URL"
    close               close specified tab IDs. Tab IDs should be in the following
                        format: "<prefix>.<window_id>.<tab_id>". You can use "list"
                        command to obtain tab IDs (first column)
    activate            activate given tab ID. Tab ID should be in the following
                        format: "<prefix>.<window_id>.<tab_id>"
    active              display active tabs for each client/window in the following
                        format: "<prefix>.<window_id>.<tab_id>"
    search              Search across your indexed tabs using sqlite fts5 plugin.
    query               Filter tabs using chrome.tabs api.
    index               Index the text from browser's tabs. Text is put into sqlite
                        fts5 table.
    open                open URLs from the stdin (one URL per line). One positional
                        argument is required: <prefix>.<window_id> OR <client>. If
                        window_id is not specified, URL will be opened in the active
                        window of the specifed client
    navigate            navigate to URLs from the stdin (one URL per line). <tab_id> are
                        specified in the arguments, URLs are passed to stdin. There should be
                        matching number of arguments and lines in stdin, e.g.: echo
                        'https://google.com' | bt navigate b.20.1
    update              Update tabs state, e.g. URL. Arguments are a JSON of the form:
                        [{"tab_id": "b.20.130", "properties": {"url":
                        "http://www.google.com"}}] Where "properties" can be anything defined
                        here: https://developer.mozilla.org/en-US/docs/Mozilla/Add-
                        ons/WebExtensions/API/tabs/update Example: echo
                        '[{"tab_id":"a.2118.2156",
                        "properties":{"url":"https://google.com"}}]' | bt update
    words               show sorted unique words from all active tabs of all
                        clients. This is a helper for webcomplete deoplete plugin
                        that helps complete words from the browser
    text                show text form all tabs
    html                show html form all tabs
    dup                 display reminder on how to show duplicate tabs using
                        command-line tools
    windows             display available prefixes and window IDs, along with the
                        number of tabs in every window
    clients             display available browser clients (mediators), their
                        prefixes and address (host:port), native app PIDs, and
                        browser names
    install             configure browser settings to use bt mediator (native
                        messaging app)

optional arguments:
  -h, --help            show this help message and exit
  --target TARGET_HOSTS
                        Target hosts IP:Port

Demo [TBD]

Features to show:

  • list tabs
  • close multiple tabs (fzf)
  • move tabs, move, same window
  • move tabs, move, different window
  • move tabs, move, different browser (NOT IMPLEMENTED)
  • move tabs, close
  • words, complete in neovim (integration with coc, ncm2, deoplete)
  • open tabs by url
  • open tab by google query, search (should be extendable, NOT IMPLEMENTED)
  • integration with fzf:
    • activate tab
    • close tabs
  • integration with rofi:
    • activate tab
    • close tabs
  • integration with albert
    • index text of available tabs (requires sqlite 3.25, fts5 plugin)
    • search a tab by text in albert
  • show duplicate tabs and close them

Installation

  1. Install command-line client: pip install --user brotab (alternatively: sudo pip install brotab)
  2. Install native app manifests: bt install
  3. Install Firefox extension: https://addons.mozilla.org/en-US/firefox/addon/brotab/
  4. Install Chrome (Chromium) / Brave extension: https://chrome.google.com/webstore/detail/brotab/mhpeahbikehnfkfnmopaigggliclhmnc/
  5. Enjoy! (try bt clients, bt windows, bt list, bt words)

Build, test and manual installation

see DEVELOPMENT.md

Author

Yuri Bochkarev

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brotab-1.4.0.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brotab-1.4.0-py3-none-any.whl (47.1 kB view details)

Uploaded Python 3

File details

Details for the file brotab-1.4.0.tar.gz.

File metadata

  • Download URL: brotab-1.4.0.tar.gz
  • Upload date:
  • Size: 41.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for brotab-1.4.0.tar.gz
Algorithm Hash digest
SHA256 6e879205f68515de7f640c3ddcea9b03132c115c13db7047d5a194f4886f2f21
MD5 50bce8e3f01e71c98f363fe8bd908f30
BLAKE2b-256 a9f643108a3ceb59a030b316345572b1ded82bfd8a50784e5db4e4b1e1862431

See more details on using hashes here.

File details

Details for the file brotab-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: brotab-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 47.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for brotab-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c9a8572928af3dce45539e864727ab808fd75e3bb2de5730b29bd1bf4546395f
MD5 c134fbe9f11f6fb1acff65149d8e44d6
BLAKE2b-256 e1f83f9d12818fe003323f714ca60b338f417ea9af22b3348d11b00c4f820f5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page