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

@tjboudreaux/gdcli

v0.2.1

Published

Google Drive, Docs, Sheets, Slides CLI

Readme

gdcli

gdcli

Minimal CLI for Google Drive, Docs, Sheets, and Slides.

Install

npm install -g @tjboudreaux/gdcli

Setup

Before using gdcli, you need OAuth2 credentials from Google Cloud Console:

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

Then configure gdcli:

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

Usage

gdcli accounts <action>                    Account management
gdcli <email> drive <command> [options]    Google Drive operations
gdcli <email> docs <command> [options]     Google Docs operations
gdcli <email> sheets <command> [options]   Google Sheets operations
gdcli <email> slides <command> [options]   Google Slides 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

drive

# List and search
gdcli <email> drive list [--query Q] [--max N] [--type TYPE]
gdcli <email> drive search <query>

# File operations
gdcli <email> drive get <fileId>
gdcli <email> drive download <fileId> [--out PATH]
gdcli <email> drive upload <file> [--parent ID] [--name NAME]
gdcli <email> drive delete <fileId>
gdcli <email> drive move <fileId> --to <folderId>
gdcli <email> drive copy <fileId> [--name NAME]

# Folder operations
gdcli <email> drive mkdir <name> [--parent ID]

# Sharing
gdcli <email> drive share <fileId> --email <email> --role <reader|writer>
gdcli <email> drive permissions <fileId>

# URLs
gdcli <email> drive url <fileIds...>

Type filter options: document, spreadsheet, presentation, folder, pdf

Query syntax examples:

  • name contains 'report'
  • mimeType = 'application/pdf'
  • modifiedTime > '2024-01-01'
  • 'folderId' in parents

docs

gdcli <email> docs get <documentId> [--format text|md|json]
gdcli <email> docs create <title>
gdcli <email> docs append <documentId> --text <text>
gdcli <email> docs replace <documentId> --find <text> --replace <text>
gdcli <email> docs url <documentIds...>

sheets

gdcli <email> sheets get <spreadsheetId>
gdcli <email> sheets read <spreadsheetId> <range>
gdcli <email> sheets create <title>
gdcli <email> sheets write <spreadsheetId> <range> --values <csv>
gdcli <email> sheets append <spreadsheetId> <range> --values <csv>
gdcli <email> sheets clear <spreadsheetId> <range>
gdcli <email> sheets add-sheet <spreadsheetId> <name>
gdcli <email> sheets url <spreadsheetIds...>

Range notation (A1):

  • Sheet1!A1:B10 - Specific range
  • Sheet1!A:A - Entire column
  • Sheet1 - Entire sheet

slides

gdcli <email> slides get <presentationId>
gdcli <email> slides create <title>
gdcli <email> slides add-slide <presentationId> [--layout LAYOUT]
gdcli <email> slides delete-slide <presentationId> <pageId>
gdcli <email> slides replace <presentationId> --find <text> --replace <text>
gdcli <email> slides thumbnail <presentationId> <pageId> [--out PATH]
gdcli <email> slides url <presentationIds...>

Layout options: BLANK, TITLE, TITLE_AND_BODY, TITLE_AND_TWO_COLUMNS, TITLE_ONLY, SECTION_HEADER

Examples

# List all documents
gdcli [email protected] drive list --type document

# Search for files
gdcli [email protected] drive search "name contains 'Q4 Report'"

# Download a file
gdcli [email protected] drive download 1abc123xyz --out ./report.pdf

# Upload a file to a folder
gdcli [email protected] drive upload ./data.csv --parent 1folderid123

# Get document as markdown
gdcli [email protected] docs get 1docid123 --format md

# Read spreadsheet range
gdcli [email protected] sheets read 1sheetid123 "Sheet1!A1:D10"

# Write to spreadsheet
gdcli [email protected] sheets write 1sheetid123 "A1:B2" --values "Name,Age
Alice,30"

# Create a presentation
gdcli [email protected] slides create "Q4 Review"

# Add a slide
gdcli [email protected] slides add-slide 1presid123 --layout TITLE_AND_BODY

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
npm test

Acknowledgements

Inspired by:

  • gmcli - Gmail CLI by badlogic
  • gdcli - Google Drive CLI by badlogic

License

MIT