Google Drive Upload
Srcpack can automatically upload bundles to Google Drive, making them accessible from any device or shareable with your team.
Setup
1. Create OAuth Credentials
- Go to Google Cloud Console
- Create a project (or select existing)
- Enable the Google Drive API
- Go to Credentials → Create Credentials → OAuth client ID
- Select Desktop app
- Copy the Client ID and Client Secret
2. Configure Srcpack
Add the upload config to srcpack.config.ts:
import { defineConfig } from "srcpack";
export default defineConfig({
bundles: {
web: "apps/web/**/*",
api: "apps/api/**/*",
},
upload: {
provider: "gdrive",
folderId: "1ABC...", // From Drive folder URL
clientId: "...",
clientSecret: "...",
},
});Finding your folder ID:
Open the target folder in Google Drive. The URL looks like:
https://drive.google.com/drive/folders/1ABCxyz123...
└─────────┘
folder ID3. Authenticate
Run the login command:
npx srcpack loginbunx srcpack loginpnpm dlx srcpack loginyarn dlx srcpack loginThis opens a browser window to authorize access. Tokens are stored locally and refreshed automatically.
Usage
Once configured, npx srcpack uploads bundles after bundling:
✓ web → .srcpack/web.txt (24 files, 8.2 KB)
✓ api → .srcpack/api.txt (18 files, 5.1 KB)
↑ Uploaded to Google DriveSkip Upload
To bundle without uploading:
npx srcpack --no-uploadbunx srcpack --no-uploadpnpm dlx srcpack --no-uploadyarn dlx srcpack --no-uploadUpload Specific Bundles
npx srcpack webbunx srcpack webpnpm dlx srcpack webyarn dlx srcpack webEnvironment Variables
WARNING
Never commit clientId and clientSecret directly in your config file. Use environment variables for shared or public repositories.
For CI/CD or shared configs, use environment variables:
export default defineConfig({
bundles: {
/* ... */
},
upload: {
provider: "gdrive",
folderId: process.env.GDRIVE_FOLDER_ID,
clientId: process.env.GDRIVE_CLIENT_ID,
clientSecret: process.env.GDRIVE_CLIENT_SECRET,
},
});Sharing with Your Team
Once uploaded, bundles appear in your Google Drive folder. You can:
- Share the folder with team members
- Open in ChatGPT/Claude — use the Google Drive integration
- Download — grab the latest bundle from any device
Troubleshooting
"Access denied" error
Re-run the login command to refresh authentication.
"Folder not found" error
Verify the folder ID is correct and you have write access to the folder.
Tokens expired
Srcpack automatically refreshes tokens. If issues persist, delete ~/.config/srcpack/credentials.json and run the login command again.