Skip to content

Feature Request: Automatically open Drive authorization URL in system browser #108

Description

Problem

Currently, when colab drivemount requests Google Drive authorization, it outputs a long URL that the user must manually copy and paste into their browser. This manual step is tedious and prone to errors, especially when working within terminal emulators like Termux.

Proposal

Enhance the authorization workflow to automatically launch the authorization URL in the user's default system browser.

Implementation Idea

By detecting a system-level browser opener, the CLI can seamlessly bridge the gap between the terminal and the browser. A platform-agnostic approach could look like this:

import shutil
import subprocess

def open_url_in_browser(url: str):
    # Support various platforms
    openers = ["termux-open", "xdg-open", "open"] 
    for opener_name in openers:
        opener = shutil.which(opener_name)
        if opener:
            subprocess.run([opener, url])
            return True
    return False

Benefits

  • Significantly improves user experience by removing manual copy-paste steps.
  • Makes the CLI feel more modern and integrated.
  • Reduces friction during the initial setup/authentication process.

I have implemented this locally in my own environment, and it has proven to be a high-value ergonomic improvement. I would love to see this incorporated into the core CLI.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions