A powerful GitHub-based file hosting system that uploads files to GitHub repositories and returns markdown/HTML links. Perfect for hosting media files, scripts, documents, and more with automatic organization and smart naming.
# 1. Clone repository
git clone https://github.com/YOUR_USERNAME/Gupload.git
cd Gupload
# 2. Make scripts executable
chmod +x ghu scripts/*.sh
# 3. Authenticate with GitHub
gh auth login
# 4. Configure (edit with your GitHub username and repo)
mkdir -p ~/.config/ghuploader
cp data/config.example.json ~/.config/ghuploader/config.json
# Edit config.json with your settings
# 5. Upload a file
./ghu ~/example.pngβ File uploaded to GitHub
β Markdown/URL copied to clipboard
β No server, no config sprawl
- π Automatic Categorization - Files organized by type (Audio, Images, Video, Scripts, Documents, Docs, Data, Archives, Other)
- π¦ Script Language Organization - Scripts organized by language (Python, Go, Ruby, AppleScript, Shell, JavaScript, TypeScript, etc.)
- ποΈ Package Structure Preservation - Detects package/module structures (Python packages, Go modules, Ruby gems) and preserves folder hierarchy
- π΅ Smart Naming - Automatically extracts artist/album names from file paths for audio files and images
- π¨ Artist Organization - Optional organization of all artist files (audio, covers, logos) in artist folders
- π Image Subfolders - Organizes covers, logos, and artist images into separate subfolders
- π Size Handling - Small files (<95MB) via Contents API, large files (95MB-2GB) via Releases API
- ποΈ Interactive Menu - Full-featured terminal menu with fzf search, repo browsing, custom naming, and more
- π Clipboard Integration - Automatically copies markdown/URL links to clipboard (macOS)
- π Secure Authentication - Supports multiple authentication methods (environment variables, GitHub CLI, macOS Keychain)
- π Batch URL Upload - Upload multiple files from URLs at once with smart naming
- π Duplicate Detection - Check if files already uploaded before re-uploading
- π Upload Templates - Save and reuse upload configurations for common workflows
- π Clipboard Monitor - Auto-detect and upload files/URLs copied to clipboard
- ποΈ File Preview - View detailed file information before uploading
- π Search & Filter - Search upload history by filename, category, or date range
- π Export History - Export upload history to CSV, JSON, or Markdown formats
- π¨ Gallery Generation - Auto-generate image galleries and audio playlists
- β Favorites System - Quick access to frequently-used paths
- π Upload Statistics - Track and analyze upload patterns
See ADVANCED_FEATURES.md for complete guide.
- Installation
- Configuration
- Authentication
- Usage
- File Organization
- Features in Detail
- Scripts
- Security
- Troubleshooting
- Contributing
π¦ Installation (Click to expand)
- Python 3.7+ (comes pre-installed on macOS)
- GitHub account with a repository for file hosting
- macOS (for Keychain integration and Finder selection)
-
Clone or download this repository:
# Standard clone (includes Uploads/ folder with all uploads) git clone https://github.com/YOUR_USERNAME/Gupload.git cd Gupload # Or clone without Uploads/ folder (recommended, keeps repo smaller) git clone --filter=blob:none --sparse https://github.com/YOUR_USERNAME/Gupload.git cd Gupload git sparse-checkout set --no-cone '/*' '!Uploads'
Note: The
Uploads/folder contains all uploaded files. If you clone without it, uploaded files will still be accessible via GitHub URLs (raw.githubusercontent.com), but won't be in your local repository. -
Make scripts executable:
chmod +x ghu scripts/*.sh -
Install optional dependencies:
pip3 install mutagen # Optional: for audio metadata extraction -
Configure:
mkdir -p ~/.config/ghuploader cp data/config.example.json ~/.config/ghuploader/config.json # Edit config.json with your settings (see Configuration section)
βοΈ Configuration (Click to expand)
Edit ~/.config/ghuploader/config.json with your settings:
{
"owner": "your-github-username",
"repo": "your-repo-name",
"branch": "main",
"use_path_for_generic_names": true,
"use_path_for_audio_names": true,
"organize_by_artist": false,
"use_image_subfolders": true,
"output_mode": "markdown",
"also_audio_html": true,
"contents_max_mb": 95,
"release_tag": "gupload-uploads"
}See data/config.example.json for all available configuration options.
owner- Your GitHub username (required)repo- Repository name for hosting files (required)branch- Branch to upload files to (default: "main")organize_by_artist- Iftrue, organizes all artist files (audio, images) intoAudio/{Artist}/foldersuse_image_subfolders- Iftrue, organizes images intoImages/Covers/,Images/Logos/,Images/Artists/output_mode- Output format:"markdown","url", or"both"contents_max_mb- Maximum file size for Contents API (default: 95MB). Larger files use Releases API.
π Authentication (Click to expand)
Gupload supports multiple secure authentication methods (in order of priority):
export GITHUB_TOKEN="your_token_here"
# or
export GH_TOKEN="your_token_here"gh auth loginGupload will automatically use your GitHub CLI authentication token.
security add-generic-password -s "GuploadGitHubToken" -w "YOUR_TOKEN" -a "$USER"- Go to GitHub Settings > Developer settings > Personal access tokens
- Click "Generate new token (classic)"
- Select scopes:
repo(full control of private repositories) - Copy the token immediately (you won't see it again)
- Use one of the authentication methods above
# Upload single file
./ghu /path/to/file.mp3
# Upload multiple files
./ghu file1.jpg file2.pdf file3.mp4
# Upload from URL with custom name
./ghu --name "Deteriorate - 1993 - Rotting in Hell.jpg" https://f4.bcbits.com/img/a1454706092_5.jpg
# Upload multiple URLs with custom names
./ghu --names "Cover 1.jpg" "Cover 2.jpg" https://example.com/cover1.jpg https://example.com/cover2.jpg
# Helper script for album covers (auto-formats name)
./scripts/upload-cover.sh https://f4.bcbits.com/img/a1454706092_5.jpg "Deteriorate" "1993" "Rotting in Hell"
# Via stdin (paths, one per line)
echo -e "/path/to/file1.mp3\n/path/to/file2.jpg" | ./ghu
# Via Finder (macOS) - run without args, select files in Finder
./ghu./scripts/gupload-menu.shThe interactive menu provides:
- π File Upload - Single file (fzf search or manual), multiple files, Finder selection, folder/archive
- π Browse Repo - List existing artists/files in repository, add files to existing paths
- π΅ Audio Tools - Browse artists, upload artist assets (covers, logos), upload audio files
- βοΈ Configure - Change clipboard output mode (markdown, URL, both)
- π View Logs - View recent uploads or live log tail
# Upload an album cover
./ghu "/Volumes/Audio/Metal/C/Cold Steel/2023 - Deeper Into Greater Pain/cover.jpg"
# Output: 
# Upload a script
./ghu ~/Scripts/my-script.py
# Output: [my-script.py](https://raw.githubusercontent.com/.../Uploads/Scripts/Python/my-script.py)
# Upload multiple artist assets
./scripts/upload-artist-assets.sh "/Volumes/Audio/Metal/C/Cold Steel"
# Uploads all cover.jpg, logo.png, and artist.jpg files for the artistπ File Organization (Click to expand)
Files are automatically organized into categories:
- Audio -
.mp3,.flac,.wav,.m4a, etc. - Images -
.png,.jpg,.svg,.webp, etc. - Video -
.mp4,.mov,.mkv,.webm, etc. - Scripts - Organized by language:
Scripts/Python/- Python scripts (.py)Scripts/Go/- Go modules (.go, preserves module structure)Scripts/Ruby/- Ruby scripts/gems (.rb, preserves gem structure)Scripts/Applescript/- AppleScript files (.applescript,.scpt)Scripts/Shell/- Shell scripts (.sh,.bash,.zsh)Scripts/JavaScript/- JavaScript files (.js)Scripts/TypeScript/- TypeScript files (.ts)- And more...
- Documents - Text files (
.txt,.md,.markdown) - Docs - Office documents (
.pdf,.doc,.docx,.xlsx) - Data - Data files (
.json,.yaml,.csv,.xml) - Archives - Archive files (
.zip,.tar.gz,.7z) - Other - Everything else
Uploads/
βββ Audio/
βββ Images/
β βββ Covers/
β βββ Logos/
β βββ Artists/
βββ Video/
βββ Scripts/
β βββ Python/
β βββ Go/
β βββ Ruby/
β βββ ...
βββ Documents/
βββ Docs/
βββ Data/
βββ Archives/
βββ Other/
Note: The Uploads/ folder is excluded from git (via .gitignore) so users can clone the repository without personal uploads.
Enable organize_by_artist: true in config:
Uploads/
βββ Audio/
βββ Cold Steel/
βββ Cold Steel - Rotting Off.mp3
βββ Cold Steel - 2023 - Deeper Into Greater Pain.jpg
βββ coldsteel-logo.png
βββ coldsteel-artist.jpg
β¨ Features in Detail (Click to expand)
Generic Image Files:
logo.pngβcarnifex-logo.png(extracts artist from path)artist.jpgβFat Joe artist.jpg(with spaced format option)cover.jpgβCold Steel - 2023 - Deeper Into Greater Pain.jpg(includes album)
Audio Files:
02. Livin' Fat.mp3βFat Joe - Livin' Fat.mp3(removes track numbers, adds artist)
Package Structure:
- Python packages with
__init__.pypreserve structure:Uploads/Scripts/Python/mypackage/subpackage/module.py - Go modules with
go.modpreserve structure:Uploads/Scripts/Go/gomodule/subdir/handler.go - Ruby gems with
Gemfilepreserve structure:Uploads/Scripts/Ruby/mygem/lib/mygem.rb
- Small files (<95MB): Uploaded via GitHub Contents API β stored directly in repository
- Large files (95MB-2GB): Uploaded via GitHub Releases API β attached to release (default tag:
gupload-uploads)
Markdown (default):
[Cold Steel - Front to Enemy.mp3](https://raw.githubusercontent.com/...)
<audio controls src="https://raw.githubusercontent.com/..."></audio>
URL only:
https://raw.githubusercontent.com/...
Both: Includes both markdown and URL.
Output is automatically copied to clipboard (macOS).
All utility scripts are located in scripts/:
gupload-menu.sh- Interactive menu for all upload operationsupload-artist-assets.sh- Batch upload artist assets (covers, logos, artist images)list-repo-artists.py- List artists already in the repository (used by menu)
π Security Audit & Best Practices (Click to expand)
This repository has been audited for security issues:
β No exposed tokens or secrets found
- No hardcoded GitHub tokens (ghp_* or github_pat_*)
- No API keys or passwords in code
- Configuration files excluded from git (
.gitignore) - Only documentation references to authentication
β Secure Configuration
.gitignoreproperly configured to exclude sensitive filesconfig.jsonexcluded from version control- Log files excluded from git
- Uploads folder excluded from git
-
GitHub CLI (Recommended for local use)
gh auth login
-
Environment Variables (Recommended for CI/CD)
export GITHUB_TOKEN="your_token_here" # or export GH_TOKEN="your_token_here"
-
macOS Keychain (For persistent local storage)
security add-generic-password -s "GuploadGitHubToken" -w "YOUR_TOKEN" -a "$USER"
- β Never commit tokens to version control
- β Never hardcode tokens in scripts or config files
- β Never share tokens via insecure channels (email, chat, etc.)
- β Never commit
config.jsonwith actual tokens - β Use environment variables or GitHub CLI (preferred)
- β
Limit token scopes - Only grant necessary permissions (
reposcope for private repos) - β Rotate tokens regularly - Especially if exposed or shared
- β Use repository secrets in CI/CD environments (GitHub Actions secrets, etc.)
- β Review uploaded files before making repository public
- Public Repositories: All uploaded files are publicly accessible via GitHub URLs
- Private Repositories: Files are only accessible with proper authentication
- Large Files: Files >95MB are uploaded as release assets (check release visibility settings)
- Go to GitHub Settings > Developer settings > Personal access tokens
- Click "Generate new token (classic)"
- Select scopes:
repo(full control of private repositories) - minimum required - Copy the token immediately (you won't see it again)
- Use one of the authentication methods above - never commit it
- Revoke the token immediately in GitHub settings
- Create a new token with the same permissions
- Update your authentication method with the new token
- If the token was pushed to a public repo, consider it compromised and create a new one
- Uploaded files are committed to the repository via GitHub API
- Files in
Uploads/folder are excluded from git (via.gitignore) - Review file contents before uploading (especially scripts or configs)
π οΈ Troubleshooting (Click to expand)
- Verify your token is valid and has correct permissions
- Try re-authenticating:
gh auth login - Check if token expired (tokens can expire if set to expire)
- Large files (>95MB) are automatically handled via Releases API
- Very large files (>2GB) are not supported (GitHub limit)
- Ensure scripts are executable:
chmod +x ghu scripts/*.sh - Check that you're in the correct directory or scripts are in PATH
- Check repository permissions (you need write access)
- Verify branch name in config matches your repository
- Check network connectivity
- Review logs:
/tmp/gupload.log
- Ensure package indicators exist (
__init__.py,go.mod,Gemfile, etc.) - Upload all related files together for best results
π€ Contributing (Click to expand)
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.
π Repository Structure (Click to expand)
Gupload/
βββ ghu # Main wrapper script (macOS integration)
β
βββ scripts/ # All scripts
β βββ ghuploader.py # Core Python upload logic
β βββ gupload-menu.sh # Interactive menu tool
β βββ upload-artist-assets.sh # Batch upload artist assets
β βββ list-repo-artists.py # List artists from repo
β
βββ data/ # Data and documentation
β βββ config.example.json # Example configuration file
β βββ docs/ # Documentation files
β βββ logs/ # Log files (if using local logging)
β
βββ Uploads/ # All uploads go here (git ignored, personal files)
βββ [category]/ # Category folders (Audio, Images, Scripts, etc.)
- π ADVANCED_FEATURES.md - Complete guide to all advanced features (batch upload, templates, search, export, etc.)
- π QUICK_REFERENCE.md - Fast reference for common tasks and workflows
- π MENU_IMPROVEMENTS.md - Detailed changelog of menu system improvements
- π
data/docs/USAGE.md- Detailed usage guide - ποΈ
data/docs/STRUCTURE.md- Repository structure documentation - π§
CLAUDE.md- Development documentation
Made with β€οΈ for easy file hosting on GitHub