Control your browser's tabs from the command line
Project description
BruvTab
Control your browser's tabs from the terminal.
BruvTab is a fork of brotab, originally created by Yuri Bochkarev.
Features
- Cross-browser: Support for Firefox, Chrome, Chromium, and Brave.
- Unified interface: List and manage tabs from multiple browsers in a single view.
- Scriptable: Ideal for use with
fzf,rofi, or custom shell scripts. - JSON support: Global
--jsonflag for easy integration with other tools. - Search & Index: Index tab contents and search them using SQLite FTS5.
- Rich Output: Colorized help and tables using the
richlibrary.
Usage
Usage: bruvtab [-h] [--target TARGET_HOSTS] [--json]
{move,list,close,activate,active,screenshot,search,query,index,new,open,navigate,update,words,text,html,dup,windows,clients,install} ...
bruvtab (bruvtab = 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,screenshot,search,query,index,new,open,navigate,update,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 tab for each client/window in the following format:
"<prefix>.<window_id>.<tab_id>"
screenshot return base64 screenshot in json object with keys: 'data' (base64 png),
'tab' (tab id of visible tab), 'window' (window id of visible tab), 'api'
(prefix of client api)
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.
new open new tab with the Google search results of the arguments that follow.
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
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. If window_id is 0, URLs will be opened in new window.
navigate navigate to URLs. There are two ways to specify tab ids and URLs: 1.
stdin: lines with pairs of "tab_id<tab>url" 2. arguments: bruvtab
navigate <tab_id> "<url>", e.g. bruvtab navigate b.20.1
"https://google.com" stdin has the priority.
update Update tabs state, e.g. URL. There are two ways to specify updates: 1.
stdin, pass 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/AP
I/tabs/update Example: echo '[{"tab_id":"a.2118.2156",
"properties":{"url":"https://google.com"}}]' | bruvtab update 2.
arguments, e.g.: bruvtab update -tabId b.1.862
-url="http://www.google.com" +muted
words show sorted unique words from all active tabs of all clients. This is a
helper for webcomplete plugin that helps complete words from the browser
text show text from all tabs
html show html from 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 bruvtab mediator (native messaging app)
Options:
-h, --help show this help message and exit
--target TARGET_HOSTS
Target hosts IP:Port
--json JSON output (default=False)
Installation
Standard (pipx / pip)
- Install command-line client:
# Preferred method
pipx install bruvtab
# Alternative
uv tool install bruvtab
pip install --user bruvtab
- Install native app manifests:
bruvtab install
- Install Browser extension:
- Firefox: Prefer the signed XPI attached to each GitHub release, or use the flake's self-hosted XPI output (
firefoxAddon, aliasfirefoxXpi). The release workflow signs Firefox builds for self-distribution instead of publishing them to the AMO store. - Chrome/Brave/Chromium: Pending Chrome Web Store update. For now, load unpacked extension from
bruvtab/extension/chrome/in developer mode.
NixOS / Home Manager
Add bruvtab as an input to your flake and use the following configuration:
{ config, pkgs, inputs, ... }:
let
bruvtabPkg = inputs.bruvtab.packages.${pkgs.system}.bruvtab;
bruvtabCrx = inputs.bruvtab.packages.${pkgs.system}.chromeCrx;
bruvtabFirefoxAddon = inputs.bruvtab.packages.${pkgs.system}.firefoxAddon;
# The Extension ID is calculated from the private key generated during build
extensionId = builtins.readFile "${bruvtabCrx}/extension-id";
in
{
programs.firefox.profiles.default.extensions.packages = [
bruvtabFirefoxAddon
];
programs.chromium = {
enable = true;
extensions = [
{
id = extensionId;
crxPath = "${bruvtabCrx}/bruvtab.crx";
inherit (bruvtabPkg) version;
}
];
nativeMessagingHosts = [ bruvtabPkg ];
};
}
Development
Setup
# Editable install with dev dependencies
pip install -e .[dev,test]
# Install native manifests for testing
bruvtab install --tests
Testing
Run all tests:
just test-all
Or run individual suites:
just unit-test
just smoke-test
just integration-test # Requires Docker
Related Projects
- TabFS -- mounts tabs info a filesystem using FUSE
- dudetab -- collection of useful scripts on top of bruvtab
- ulauncher-bruvtab -- Ulauncher extension for bruvtab
- cmp-bruvtab -- bruvtab completion for nvim-cmp
Authors
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bruvtab-2.0.5.tar.gz.
File metadata
- Download URL: bruvtab-2.0.5.tar.gz
- Upload date:
- Size: 46.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
175899357e03a3e262db1b97fe408dbf49be3d7e21d50500f1b2220e3c842312
|
|
| MD5 |
9ca727ed4110eacb12dc52bdea82462f
|
|
| BLAKE2b-256 |
29fae9e030357a794d239ca36a033518e6f4324f0f22774e03d706d624403051
|
Provenance
The following attestation bundles were made for bruvtab-2.0.5.tar.gz:
Publisher:
pypi.yaml on pschmitt/bruvtab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bruvtab-2.0.5.tar.gz -
Subject digest:
175899357e03a3e262db1b97fe408dbf49be3d7e21d50500f1b2220e3c842312 - Sigstore transparency entry: 1437542601
- Sigstore integration time:
-
Permalink:
pschmitt/bruvtab@0bf87210f4c49780dedf2996a9b65ff642e2f042 -
Branch / Tag:
refs/tags/2.0.5 - Owner: https://github.com/pschmitt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@0bf87210f4c49780dedf2996a9b65ff642e2f042 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bruvtab-2.0.5-py3-none-any.whl.
File metadata
- Download URL: bruvtab-2.0.5-py3-none-any.whl
- Upload date:
- Size: 53.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89d4793ad464728bb2f753171858232db417e89cbaa4f097c231e88a73d52e0f
|
|
| MD5 |
a40820d68de58f791a614fdbbf9f5209
|
|
| BLAKE2b-256 |
f6a5cf365dc8f6c617c9109b673bab56cc2df1465c459bfa998dfe9a768d9b8f
|
Provenance
The following attestation bundles were made for bruvtab-2.0.5-py3-none-any.whl:
Publisher:
pypi.yaml on pschmitt/bruvtab
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bruvtab-2.0.5-py3-none-any.whl -
Subject digest:
89d4793ad464728bb2f753171858232db417e89cbaa4f097c231e88a73d52e0f - Sigstore transparency entry: 1437542620
- Sigstore integration time:
-
Permalink:
pschmitt/bruvtab@0bf87210f4c49780dedf2996a9b65ff642e2f042 -
Branch / Tag:
refs/tags/2.0.5 - Owner: https://github.com/pschmitt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@0bf87210f4c49780dedf2996a9b65ff642e2f042 -
Trigger Event:
push
-
Statement type: