Skip to main content

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.md file in the data/ directory, where all tab data is appended for easy access.
  • Secure API Key Management: Utilizes a .env file to securely store API keys, which can be set using command-line arguments.

Installation

  1. Clone the repository:

    git clone https://github.com/Anshulgada/brave-tab-manager.git
    
  2. Navigate to the project directory:

    cd Brave Tab Manager
    

    This assumes that your project folder is named Brave Tab Manager.

  3. Install pipx (if you don't have it):

    python -m pip install --user pipx
    python -m pipx ensurepath
    

    This ensures that pipx is 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.

  4. Install tabman using pipx:

    pipx install -e .
    

    This command installs your tool into an isolated environment and makes the tabman command accessible from anywhere. Make sure you run this command from the root of the project directory, i.e. Brave Tab Manager.

Usage

  1. Enable Remote Debugging in Brave: To allow tabman to connect with your Brave browser, you must enable remote debugging. Here's how:

    • Windows:
      1. Right-click on the Brave shortcut in your Start Menu or Taskbar and select "Properties."
      2. 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
        
      3. Click "Apply" and "OK."
    • macOS/Linux: Modify the Brave shortcut (or application launcher) to include the --remote-debugging-port=9222 flag 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.
  2. Run the tabman tool:

    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 of tabman and 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 .env file. Use this in combination with -mk and -gk options 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 is llama2.

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 .env file:

    tabman --save-keys -gk YOUR_GEMINI_API_KEY -mk YOUR_MISTRAL_API_KEY
    

    Replace YOUR_GEMINI_API_KEY and YOUR_MISTRAL_API_KEY with 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 .env file for later use. The tool will read keys from environment variables, and then the command line arguments and the .env file 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 using pipx uninstall tabman and install again using pipx install ..

  • Running tests:

    • The tests are located in the tabman/tests directory. You can run the tests using pytest rom the root of your project i.e. where setup.py exists.
    pytest -v -s tabman/tests
    

Dependencies

  • openai
  • ollama
  • markdown
  • requests
  • tenacity
  • playwright
  • python-dotenv
  • beautifulsoup4
  • google-generativeai
  • google-api-python-client

License

This project is licensed under the MIT License.

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

tabman-0.2.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

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

tabman-0.2.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

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

Hashes for tabman-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6c1fce50765021829bc232deeb091f7c3e51f573e3de299e01610d8c758113b4
MD5 107f326b93ab349aeb44eb5ce178ea2b
BLAKE2b-256 09fccd4e710f900822a713cdfb7fbce04b99a881a4d89dd34e26047a50cb3f54

See more details on using hashes here.

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

Hashes for tabman-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae3c02bba1072a7a37af8aaaf36aaa429484a1db07a365571b043379ec947797
MD5 1335555fa3a91113b93e6f5813c4b036
BLAKE2b-256 d388a20e4c4582f828ab4ded1f355b728aee16db9b6bd361251b1d2349016689

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