key-to-drive
v1.2.0
Published
Upload clipboard content to Google Drive with hotkey shortcuts
Maintainers
Readme
Key-to-Drive
A CLI tool that uploads clipboard content to Google Drive using keyboard shortcuts. Perfect for quickly sharing clipboard content via Google Drive links.
⚡ Quick Start
Install and Run
# Run directly with bunx (recommended)
bunx kdr
# Or with npx
npx key-to-drive
# Or install globally
npm install -g key-to-drive
kdrFirst Time Setup
Get Google Drive API Credentials:
- Go to Google Cloud Console
- Create a project and enable Google Drive API
- Create OAuth 2.0 credentials (Desktop application)
- Download the credentials JSON file
Setup Credentials:
# Copy your downloaded credentials to the working directory cp ~/Downloads/credentials_xxx.json ./credentials.json # Or use the template cp credentials.template.json credentials.json # Then edit credentials.json with your actual valuesRun and Authenticate:
kdr- First run will open your browser for Google authentication
- Grant permissions to access Google Drive
- Authentication token is saved to
~/.keytodrive/token.json
🎯 Usage
Commands
kdr # Start the key listener
kdr --help # Show help
kdr --version # Show versionKeyboard Shortcuts
Ctrl+Shift+U- Upload clipboard content to Google DriveCtrl+Shift+A- Retry authenticationCtrl+C- Exit application
Workflow
- Copy content to clipboard:
- 📝 Text content
- 📁 File paths (drag files to Explorer/Finder, copy path)
- 🔗 URLs and web content
- Press
Ctrl+Shift+U - 🎉 Content uploads to Google Drive
- 📋 Google Drive share URL is copied to clipboard
- 🔔 Success notification with sound
- Paste the URL anywhere to share!
✨ Features
- ⌨️ Global Hotkeys - Works from any application
- 🔄 Smart Authentication - Remembers login, retries on failure
- 📋 Multi-Format Clipboard - Text, URLs, and file paths
- 📁 File Upload - Supports all file types via path detection
- 🔔 Cross-Platform Notifications - Visual + sound feedback
- 📊 File Info - Shows size, type, and upload progress
- 🛡️ Secure - Credentials stored safely in
~/.keytodrive/ - 🚀 Fast - Direct upload, instant sharing
- 🌍 Stable - Pure Node.js, no shell command dependencies
📂 File Organization
Local Files
~/.keytodrive/token.json- Authentication token (auto-created)./credentials.json- Google API credentials (you provide)
Google Drive
- Creates "KeyToDrive Uploads" folder automatically
- Files named with timestamp:
clipboard_2024-01-15T10-30-00-000Z.txt
🔧 Advanced Usage
Running from Source
git clone https://github.com/aronbraun/key-to-drive.git
cd key-to-drive
npm install
npm startDevelopment
npm run dev # Watch mode🔒 Security & Privacy
- Credentials: Never committed to git (
.gitignore) - Tokens: Stored locally in
~/.keytodrive/ - Permissions: Only requests Google Drive file creation access
- Data: Your clipboard content goes directly to your Google Drive
🐛 Troubleshooting
Authentication Issues
# Force re-authentication
kdr
# Then press Ctrl+Shift+APermission Errors
- Run as administrator on Windows (for global hotkeys)
- Ensure Google Drive API is enabled in Cloud Console
Credentials Problems
- Check
credentials.jsonexists and has valid JSON - Verify client_id and client_secret are correct
- Ensure redirect URI is set to
http://localhost
🤝 Contributing
- Fork the repository
- Create your feature branch:
git checkout -b my-feature - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin my-feature - Submit a pull request
📄 License
MIT License - see LICENSE file for details.
🔗 Links
- GitHub: https://github.com/aronbraun/key-to-drive
- npm: https://www.npmjs.com/package/key-to-drive
- Issues: https://github.com/aronbraun/key-to-drive/issues
Made with ❤️ by Aron Braun
