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

@asfand0007/pi-build-upload

v1.0.2

Published

Pi extension for building npm projects and uploading files or ZIP archives to Google Drive

Readme

Pi Build & Google Drive Upload Extension

Build npm projects, archive arbitrary local files/folders, or upload individual files directly to Google Drive and return private Drive links from Pi.

Features

  • /build-upload command for React, Angular, Next.js, and other npm projects
  • upload_to_drive model-callable tool for arbitrary files and folders
  • Optional direct file upload without ZIP compression
  • Versioned, readable ZIP names
  • Google Drive upload through rclone
  • Private Drive links that preserve existing Drive permissions
  • Confirmation before uploads
  • Per-user rclone remote and Drive-folder configuration
  • Drive-folder selection with Pi extension as default
  • Animated build progress above Pi input field
  • Temporary ZIP cleanup after successful uploads
  • Failed ZIPs retained locally for troubleshooting

Requirements

  • Windows 10 or Windows 11
  • Pi coding agent
  • Node.js and npm
  • npm run build script for /build-upload
  • rclone
  • Google account with Drive access

This extension currently uses Windows PowerShell and .NET ZIP APIs. Other operating systems require small command-runner changes.

Install

Install package globally through Pi:

pi install npm:@asfand0007/pi-build-upload

Restart Pi, then run one-time per-user setup:

/build-upload-setup

To test local checkout without installing it:

pi --no-extensions -e .

Pi extensions run with full local user permissions. Review extension source before installing it.

Install rclone

Open PowerShell:

winget install --id Rclone.Rclone --exact

Close and reopen terminal, then verify:

rclone version

Create Google OAuth client

Do not rely on rclone's shared Google client ID. It is being retired during 2026.

  1. Open Google Cloud Console.
  2. Create or select a project, such as rclone.
  3. Enable Google Drive API.
  4. Open Google Auth Platform and configure consent screen.
  5. Choose External for personal Gmail, or Internal for same-organization Google Workspace usage.
  6. Add these scopes under Data Access:
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.metadata.readonly
  1. For External audience, add your Google account as test user.
  2. Create OAuth client with application type Desktop app.
  3. Save client ID and client secret privately.

Official guide: https://rclone.org/drive/#making-your-own-client-id

Configure rclone

Run:

rclone config

Create remote using these choices:

New remote: n
Name: gdrive
Storage: drive
Client ID: your private OAuth client ID
Client secret: your private OAuth client secret
Scope: full Drive access (normally option 1)
Service account file: leave blank
Advanced config: n
Browser authentication: y
Shared Drive: n (unless intentionally using a Google Shared Drive)
Save remote: y

Verify:

rclone lsd gdrive:

Never share or commit rclone configuration. Find its location with:

rclone config file

Configure extension

Run inside Pi:

/build-upload-setup

Setup asks for:

  • rclone remote name, defaulting to gdrive
  • default Drive folder, defaulting to Pi extension

It verifies remote exists, creates folder when needed, then saves per-user configuration at:

%USERPROFILE%\.pi\agent\build-upload.json

Example:

{
  "remote": "gdrive",
  "defaultFolder": "Pi extension"
}

When PI_CODING_AGENT_DIR is configured, settings file is stored there instead. File contains no OAuth credentials or tokens and should not be included in npm package.

Equivalent folder creation command:

rclone mkdir "gdrive:Pi extension"

Do not make folder public unless public access is intentional. Share it only with intended recipients. Returned links preserve Drive permissions.

/build-upload command

Start Pi from npm project root:

cd C:\path\to\project
pi

Run:

/build-upload

Workflow:

  1. Validate package.json and scripts.build.
  2. Ask for confirmation.
  3. Run npm run build.
  4. Detect first existing output directory in this order:
    • dist
    • out
    • .next
  5. ZIP output directory contents.
  6. Upload ZIP to configured destination, defaulting to gdrive:Pi extension.
  7. Retrieve Google Drive file ID and display private link.
  8. Delete temporary local ZIP after success.

ZIP naming

When package.json contains:

{
  "name": "customer-dashboard",
  "version": "1.4.2"
}

Generated filename resembles:

customer-dashboard-v1.4.2_2026-09-12_03-00.zip

Name sources:

  • Project: package.json name, falling back to project directory name
  • Version: package.json version, omitted when missing
  • Timestamp: local computer time in yyyy-MM-dd_HH-mm format

Running same project/version twice within same minute uses same filename and overwrites previous remote file.

Framework notes

  • React/Vite commonly outputs dist.
  • Angular commonly outputs dist or nested content beneath dist.
  • Next.js static export commonly outputs out.
  • Standard Next.js build outputs .next.
  • A raw .next ZIP is not always a complete standalone deployment. For self-hosting, consider Next.js output: "standalone" and required static/public files.

General upload_to_drive tool

This tool is available to Pi's model. Ask naturally:

Zip dist and upload it to Google Drive.
Zip C:\Users\me\Desktop\Client Files and upload it to Pi extension/Client A.
Upload reports to Google Drive and name the archive monthly-reports.
Upload report.pdf to Google Drive.

Parameters understood by tool:

  • sourcePath: local file or folder, absolute or relative to Pi working directory
  • driveFolder: optional Drive path
  • archiveName: optional ZIP base name, used only when compression is enabled
  • compress: optional boolean; files upload directly when omitted/false, while true creates a ZIP; folders are always zipped

Before uploading, tool always asks user to confirm Drive folder.

When no folder was specified:

Confirm Google Drive folder
> Pi extension (default)
  Enter another folder…

When folder was specified:

Confirm Google Drive folder
> Pi extension/Client A (requested)
  Pi extension (default)
  Enter another folder…

Tool then shows final source-to-destination confirmation.

Drive folder formats:

Pi extension
Pi extension/Client A
gdrive:Pi extension/Client A

Browser URLs such as https://drive.google.com/... are not accepted as rclone destination paths.

General archive names resemble:

Client-Files_2026-09-12_03-00.zip
monthly-reports_2026-09-12_03-00.zip

Direct file upload

Files upload directly by default:

Upload report.pdf to Pi extension.

Ask explicitly when a file should be zipped:

Zip report.pdf and upload it to Pi extension.

Direct upload behavior:

  • Preserves original filename and extension
  • Skips temporary ZIP creation
  • Returns same private Google Drive link
  • Never deletes or modifies original local file
  • Supports individual files only

Folders are always compressed into versioned ZIPs, even if compress: false is supplied. They are never uploaded recursively as loose files.

Command versus tool

/build-upload is Pi slash command. It runs only when user types exact command:

/build-upload

upload_to_drive is model-callable tool. Natural-language requests can use it. For example:

Upload build of this project to Google Drive.

Model may run npm run build, then call upload_to_drive for generated output. This is expected because extension slash commands are not directly callable by model.

Change per-user destination

Run setup again at any time:

/build-upload-setup

This avoids editing installed npm package source. Settings survive package updates because they live separately in user Pi configuration directory.

Troubleshooting

rclone not found

Restart terminal and Pi after installing rclone:

rclone version

Remote gdrive: not found

List configured remotes:

rclone listremotes

Expected:

gdrive:

If missing, rerun:

rclone config

Google authentication expired

Reconnect:

rclone config reconnect gdrive:

Build fails

Run build directly from project root:

npm run build

Extension stops before ZIP/upload when build exits unsuccessfully.

No output directory found

Extension expects dist, out, or .next. If project uses another output directory, add it to:

const ARTIFACT_DIRECTORIES = ["dist", "out", ".next"] as const;

Link opens Access Denied

Uploaded file remains private. Share configured folder or individual file with recipient in Google Drive.

Upload fails after ZIP creation

Extension keeps ZIP under Windows temporary directory:

%TEMP%\pi-build-upload

Error message includes exact retained file path.

Extension does not appear

Check file location:

%USERPROFILE%\.pi\agent\extensions\build-upload.ts

Then run:

/reload

Security notes

  • Extension can read and archive arbitrary local paths selected by user.
  • Every general upload requires interactive folder and final upload confirmation.
  • OAuth tokens stay in local rclone configuration.
  • Do not commit rclone config, OAuth client secrets, or access tokens.
  • Review extension source before sharing or installing.