No project description provided
Project description
Tabman: Brave Tab Manager
A command-line tool designed to streamline your browsing experience by intelligently organizing your open tabs from the Brave browser. tabman helps you categorize, tag, and save your browsing sessions, making it easier to find and revisit websites later.
Features
- Tab Retrieval: Fetches all open tabs from Brave using its remote debugging interface.
- Intelligent Categorization: Uses AI-powered language models to categorize your tabs:
- Google Gemini: Employs the Gemini 2.0 Flash model for advanced and fast categorization.
- Mistral AI: Leverages Mistral's large language models as an alternative to Gemini.
- Ollama: Enables local categorization using Ollama, supporting a variety of LLMs (e.g., Llama 2, Mistral).
- Dynamic Tagging: Generates a list of concise and relevant keywords to describe the content of each tab.
- Flexible Saving:
- Saves the tab data (title, URL, main category, and tags) as a JSON file, organized in date-based subfolders within the
data/directory. - Creates a Markdown version of each tab session, also stored in the date-based subfolders within the
data/directory. - Maintains a central
all_tabs.mdfile in thedata/directory, where all tab data is appended for easy access.
- Saves the tab data (title, URL, main category, and tags) as a JSON file, organized in date-based subfolders within the
- Secure API Key Management: Utilizes a
.envfile to securely store API keys, which can be set using command-line arguments.
Installation
-
Clone the repository:
git clone https://github.com/Anshulgada/brave-tab-manager.git
-
Navigate to the project directory:
cd Brave Tab Manager
This assumes that your project folder is named
Brave Tab Manager. -
Install
pipx(if you don't have it):python -m pip install --user pipx python -m pipx ensurepath
This ensures that
pipxis installed globally and its executables are present in your system's PATH. You may need to restart your terminal for these changes to take effect. -
Install
tabmanusingpipx:pipx install -e .
This command installs your tool into an isolated environment and makes the
tabmancommand accessible from anywhere. Make sure you run this command from the root of the project directory, i.e.Brave Tab Manager.
Usage
-
Enable Remote Debugging in Brave: To allow
tabmanto connect with your Brave browser, you must enable remote debugging. Here's how:- Windows:
- Right-click on the Brave shortcut in your Start Menu or Taskbar and select "Properties."
- In the "Target" field, add
--remote-debugging-port=9222(or your preferred port number) to the end of the existing path, ensuring there's a space between the path and the flag. For example:"C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe" --remote-debugging-port=9222 - Click "Apply" and "OK."
- macOS/Linux: Modify the Brave shortcut (or application launcher) to include the
--remote-debugging-port=9222flag in the command line that launches Brave. Consult your system's documentation for the specific method. - After enabling remote debugging, make sure that you have restarted your Brave browser.
- Windows:
-
Run the
tabmantool:tabman [OPTIONS]
You can use the following options:
-c,--categorize: Categorize your open tabs using the selected LLM model, and save the data. This is not necessary when setting the api keys.-v,--version: Display the version oftabmanand exits.-m,--model <MODEL>: Specify the LLM model for categorization:gemini(default): Uses Google Gemini.mistral: Uses Mistral AI.ollama: Uses a local LLM with Ollama.
--save-keys: Save the provided API keys to the.envfile. Use this in combination with-mkand-gkoptions to save the keys.-mk,--mistral-key <KEY>: Provide your Mistral AI API key.-gk,--gemini-key <KEY>: Provide your Google Gemini API key.-om,--ollama-model <MODEL>: Provide the Ollama model name (e.g.,llama2,mistral). Default isllama2.
Examples:
-
Categorize tabs using the default Gemini model:
tabman -c -
Categorize tabs using Mistral:
tabman -c -m mistral
-
Categorize tabs using a specific Ollama model:
tabman -c -m ollama -om llama3.2
-
Save API keys to the
.envfile:tabman --save-keys -gk YOUR_GEMINI_API_KEY -mk YOUR_MISTRAL_API_KEY
Replace
YOUR_GEMINI_API_KEYandYOUR_MISTRAL_API_KEYwith your actual API keys. -
Show help message:
tabman
Configuration
- API Keys: API keys for Gemini and Mistral can be provided either directly via command-line arguments or saved to a
.envfile for later use. The tool will read keys from environment variables, and then the command line arguments and the.envfile when using the tool. - Ollama: If you select Ollama model, then you will have to install and run ollama on your system with your desired models.
Development and Testing
-
To avoid re-installing the package again and again, during local development, you should run the tool inside your virtual environment. For this you have to activate your environment and then run
pip install -e .from the root directory. Now you can use the tool with the activated virtual environment. Whenever you want to update the global version then you have to uninstall the current version usingpipx uninstall tabmanand install again usingpipx install .. -
Running tests:
- The tests are located in the
tabman/testsdirectory. You can run the tests usingpytestrom the root of your project i.e. wheresetup.pyexists.
pytest -v -s tabman/tests
- The tests are located in the
Dependencies
openaiollamamarkdownrequeststenacityplaywrightpython-dotenvbeautifulsoup4google-generativeaigoogle-api-python-client
License
This project is licensed under the MIT License.
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 tabman-0.2.0.tar.gz.
File metadata
- Download URL: tabman-0.2.0.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c1fce50765021829bc232deeb091f7c3e51f573e3de299e01610d8c758113b4
|
|
| MD5 |
107f326b93ab349aeb44eb5ce178ea2b
|
|
| BLAKE2b-256 |
09fccd4e710f900822a713cdfb7fbce04b99a881a4d89dd34e26047a50cb3f54
|
File details
Details for the file tabman-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tabman-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae3c02bba1072a7a37af8aaaf36aaa429484a1db07a365571b043379ec947797
|
|
| MD5 |
1335555fa3a91113b93e6f5813c4b036
|
|
| BLAKE2b-256 |
d388a20e4c4582f828ab4ded1f355b728aee16db9b6bd361251b1d2349016689
|