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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@mariozechner/gdcli

v0.1.1

Published

Minimal Google Drive CLI

Readme

gdcli

Minimal Google Drive CLI for listing, searching, uploading, and downloading files.

Install

npm install -g @mariozechner/gdcli

Setup

Before adding an account, you need OAuth2 credentials from Google Cloud Console:

  1. Create a new project (or select existing)
  2. Enable the Google Drive API
  3. Set app name in OAuth branding
  4. Add test users (all Gmail addresses you want to use)
  5. Create OAuth client:
    • Click "Create Client"
    • Application type: "Desktop app"
    • Download the JSON file

Then:

gdcli accounts credentials ~/path/to/credentials.json
gdcli accounts add [email protected]

You can reuse credentials from gmcli or gccli:

gdcli accounts credentials ~/.gmcli/credentials.json

Usage

gdcli accounts <action>                Account management
gdcli <email> <command> [options]      Drive operations

Commands

accounts

gdcli accounts credentials <file.json>   # Set OAuth credentials (once)
gdcli accounts list                      # List configured accounts
gdcli accounts add <email>               # Add account (opens browser)
gdcli accounts add <email> --manual      # Add account (browserless, paste redirect URL)
gdcli accounts remove <email>            # Remove account

ls

List files in a folder (default: root).

gdcli <email> ls [folderId] [options]

Options:

  • --max <n> - Max results (default: 20)
  • --page <token> - Page token for pagination
  • --query <q> - Drive query filter

Examples:

gdcli [email protected] ls
gdcli [email protected] ls 1ABC123 --max 50
gdcli [email protected] ls --query "mimeType='image/png'"

search

Full-text search across all files.

gdcli <email> search <query> [--max N] [--page TOKEN]

Example:

gdcli [email protected] search "quarterly report"

get

Get file metadata.

gdcli <email> get <fileId>

download

Download a file. Google Docs are exported as PDF/CSV.

gdcli <email> download <fileId> [destPath]

Default destination: ~/.gdcli/downloads/

Examples:

gdcli [email protected] download 1ABC123
gdcli [email protected] download 1ABC123 ./myfile.pdf

upload

Upload a file.

gdcli <email> upload <localPath> [options]

Options:

  • --name <n> - Override filename
  • --folder <folderId> - Destination folder

Examples:

gdcli [email protected] upload ./report.pdf
gdcli [email protected] upload ./report.pdf --folder 1ABC123 --name "Q4 Report.pdf"

mkdir

Create a folder.

gdcli <email> mkdir <name> [--parent <folderId>]

Example:

gdcli [email protected] mkdir "New Folder" --parent 1ABC123

delete

Delete a file (moves to trash).

gdcli <email> delete <fileId>

move

Move a file to a different folder.

gdcli <email> move <fileId> <newParentId>

rename

Rename a file or folder.

gdcli <email> rename <fileId> <newName>

share

Share a file or folder.

gdcli <email> share <fileId> [options]

Options:

  • --anyone - Make publicly accessible (anyone with link)
  • --email <addr> - Share with specific user
  • --role <r> - Permission level: reader (default) or writer

Examples:

gdcli [email protected] share 1ABC123 --anyone
gdcli [email protected] share 1ABC123 --email [email protected] --role writer

unshare

Remove a permission from a file.

gdcli <email> unshare <fileId> <permissionId>

Get permission IDs with permissions command.

permissions

List permissions on a file.

gdcli <email> permissions <fileId>

url

Print web URLs for files.

gdcli <email> url <fileIds...>

Data Storage

All data is stored in ~/.gdcli/:

  • credentials.json - OAuth client credentials
  • accounts.json - Account tokens
  • downloads/ - Downloaded files

Development

npm install
npm run build
npm run check

License

MIT