npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

get-google-drive-oauth-token-cli

v1.0.0

Published

Interactive CLI to generate Google OAuth2 tokens for Google Drive and browse/select a Drive folder.

Readme

get-google-drive-oauth-token-cli

Interactive CLI to generate Google OAuth2 tokens for Google Drive. It spins up a temporary local server to capture the OAuth redirect, exchanges the code for tokens, and then lets you browse and select a Drive folder.

Requirements

  • Node.js >= 18
  • A Google OAuth Client of type Desktop app (create one in the Google Cloud Console). The dynamic loopback port (http://localhost:<port>) only works for the "Desktop app" client type; a "Web application" client would require the exact redirect URI to be pre-registered.

Usage

Run it directly with npx (no install required):

npx oauth-gdrive-token

Or install it globally:

npm install -g get-google-drive-oauth-token-cli
oauth-gdrive-token

Flow

  1. You are prompted for your OAuth Client ID and Client Secret.
  2. The tool opens your browser with Google's consent screen (and prints the URL in case it doesn't open automatically).
  3. After you authorize, the local callback server captures the authorization code and exchanges it for tokens.
  4. You can browse your Drive folders interactively and optionally select one.
  5. The result (tokens + selected folder) is printed to stdout as JSON.

Scopes

  • https://www.googleapis.com/auth/drive.file — upload/manage files created by the app.
  • https://www.googleapis.com/auth/drive.metadata.readonly — read Drive metadata to list/browse folders.

Development

npm install
npm run dev     # run from source with tsx
npm run build   # compile TypeScript to dist/
npm start       # run the compiled CLI

License

MIT