Upload files to GitHub Gists with a single right-click!
RightClick2Gist is a Windows PowerShell application that adds "Upload as GitHub Gist" to your Windows Explorer context menu. Simply right-click any file, select the option, and instantly create a GitHub Gist with the URL automatically copied to your clipboard.
- π±οΈ One-Click Upload: Right-click any file in Windows Explorer to upload it as a Gist
- π Secure OAuth: Uses GitHub OAuth Device Flow (no personal access tokens needed)
- π Auto-Copy: Gist URL automatically copied to clipboard
- π All File Types: Works with any file type
- πͺ Windows Integration: Native Windows Explorer context menu integration
- π§ Easy Setup: Simple installation wizard
- π Logging: Activity logs for troubleshooting
- Windows 10 or later
- PowerShell 5.1 or PowerShell 7+
- Administrator privileges (for installation only)
- GitHub account
- GitHub OAuth App (instructions below)
Before installing RightClick2Gist, you need to create a GitHub OAuth App:
- Go to GitHub Developer Settings
- Click "New OAuth App" or "Register a new application"
- Fill in the application details:
- Application name:
RightClick2Gist(or any name you prefer) - Homepage URL:
https://github.com/lmichaelwar/RightClick2Gist - Authorization callback URL:
https://github.com(not used for Device Flow, but required)
- Application name:
- Click "Register application"
- Copy the Client ID (looks like:
Iv1.abc123def456...)β οΈ Note: You do NOT need the Client Secret for OAuth Device Flow
# Clone the repository
git clone https://github.com/lmichaelwar/RightClick2Gist.git
cd RightClick2GistOr download and extract the ZIP file from GitHub.
- Open PowerShell as Administrator (right-click PowerShell β "Run as Administrator")
- Navigate to the repository directory:
cd C:\path\to\RightClick2Gist
- Run the installation script:
.\src\Install-RightClick2Gist.ps1 - Follow the setup wizard:
- Enter your GitHub OAuth App Client ID
- Open the provided URL in your browser
- Enter the displayed code to authorize the app
- Wait for authentication to complete
The installer will:
- β Verify administrator privileges
- β Authenticate with GitHub using OAuth Device Flow
- β Store your access token securely
- β Add the context menu entry to Windows Registry
- Right-click any file in Windows Explorer
- Select "Upload as GitHub Gist" from the context menu
- Wait a moment for the upload to complete
- A success message will appear, and the Gist URL will be copied to your clipboard
- Paste the URL anywhere to share your Gist!
You can also upload files manually from PowerShell:
# Upload a public gist
.\src\Upload-Gist.ps1 -FilePath "C:\path\to\file.txt"
# Upload a private gist
.\src\Upload-Gist.ps1 -FilePath "C:\path\to\file.txt" -Public $false
# Upload with custom description
.\src\Upload-Gist.ps1 -FilePath "C:\path\to\file.txt" -Description "My custom description"RightClick2Gist stores configuration in your user profile:
- Config Directory:
%USERPROFILE%\.rightclick2gist\ - Config File:
%USERPROFILE%\.rightclick2gist\config.json - Log File:
%USERPROFILE%\.rightclick2gist\rightclick2gist.log
{
"client_id": "Iv1.abc123def456",
"access_token": "gho_abc123...",
"created_at": "2025-01-15 10:30:00",
"version": "1.0.0"
}config.json file secure! It contains your GitHub access token.
Problem: "This script must be run as Administrator"
- Solution: Right-click PowerShell and select "Run as Administrator"
Problem: "Execution of scripts is disabled on this system"
- Solution: Run
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Problem: Authentication timeout
- Solution: The device code expires after 15 minutes. Restart the installation and complete authorization more quickly.
Problem: "Authentication required. Please run Install-RightClick2Gist.ps1 first"
- Solution: Your access token may be missing or invalid. Re-run the installation script.
Problem: "Access forbidden. You may have exceeded the GitHub API rate limit"
- Solution: Wait an hour and try again. GitHub has rate limits for API usage.
Problem: Context menu option doesn't appear
- Solution:
- Restart Windows Explorer (Task Manager β Windows Explorer β Restart)
- Verify installation with:
Test-RightClick2GistSetupin PowerShell
# View the log file
Get-Content "$env:USERPROFILE\.rightclick2gist\rightclick2gist.log" -Tail 50To completely remove RightClick2Gist:
- Open PowerShell as Administrator
- Load the utilities module:
Import-Module "C:\path\to\RightClick2Gist\src\Utilities.ps1"
- Run the uninstall command:
Remove-RightClick2GistInstallation
This will:
- β Remove registry entries (context menu)
- β Delete configuration directory and files
- β Clean up log files
- OAuth Device Flow: More secure than personal access tokens
- Scoped Permissions: Only requests
gistscope (minimal permissions) - Local Storage: Token stored locally in your user profile
- No Telemetry: No usage data collected
- Open Source: Full source code available for audit
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub for the Gist API and OAuth Device Flow
- PowerShell community for excellent documentation
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Support for uploading multiple files as a single Gist
- GUI configuration tool
- Gist update functionality
- Gist deletion from context menu
- Support for folder uploads
- Customizable context menu text
- Cross-platform support (macOS, Linux)
Made with β€οΈ for the GitHub community