GoShare CLI is a modern, lightweight command-line tool that transforms file sharing over Wi-Fi networks. Built with Go backend and React frontend, it provides an elegant, responsive web interface for browsing, navigating, and downloading files from any device on your network—no cloud storage required.
- 🚀 One Command Setup - Get both React frontend and Go backend running instantly
- ⚛️ Modern React UI - Beautiful, responsive interface with TypeScript
- 🌓 Dark Mode by Default - Elegant theme with user preference persistence
- 📤 Drag & Drop Uploads - Intuitive file uploads with progress feedback
- 🔍 Real-time Search - Instant file and folder filtering
- 📱 Mobile Responsive - Perfect experience on all devices
- 🔒 Secure by Design - Session-based auth with HTTP-only cookies
- 🎯 Zero Config - Works immediately with sensible defaults
Get GoShare running with React frontend and Go backend in one command:
# Clone the repository
git clone https://github.com/sudo-init-do/goshare.git
cd goshare
# Start everything with one command!
./start.sh --password demo123
# Or use make for even easier commands
make start-with-password
That's it! 🎉 The script automatically:
- ✅ Checks dependencies (Node.js, Go)
- ✅ Builds Go backend
- ✅ Installs React dependencies
- ✅ Starts React dev server (
localhost:3000
) - ✅ Starts Go API server (
localhost:8081
) - ✅ Shows clear access URLs
- ✅ Handles cleanup on exit (Ctrl+C)
Command | Description |
---|---|
./start.sh |
Start without password |
./start.sh --password mypass |
Start with password protection |
./start.sh --port 9000 |
Use custom port |
./start.sh ~/Documents |
Share specific directory |
make start |
No password (using make) |
make start-with-password |
Demo password (using make) |
make help |
Show all available commands |
- 🌐 React Frontend: Modern UI at
http://localhost:3000
- 🔧 Go Backend: RESTful API at
http://localhost:8081
- 🌓 Dark Mode: Beautiful interface that's easy on the eyes
- 📤 File Uploads: Drag files directly into the browser
- 🔍 Live Search: Find files and folders instantly
- 📱 Mobile Ready: Works perfectly on phones and tablets
./start.sh # Start without password
./start.sh --password mypass # Start with password
./start.sh --port 9000 # Custom port
./start.sh ~/Documents # Share specific folder
# Or use make shortcuts
make start # No password
make start-with-password # With demo password
make start-port # Port 9000
make help # Show all options
Frontend (React SPA)
- ⚛️ React 18 with TypeScript for type safety
- 🎨 Tailwind CSS for beautiful, responsive design
- ✨ Framer Motion for smooth animations
- 📤 React Dropzone for drag & drop uploads
- 🔔 React Hot Toast for user notifications
- 🎯 Heroicons for consistent iconography
Backend (Go API)
- 🚀 Go 1.21+ for high-performance file serving
- 🔒 Session-based authentication with HTTP-only cookies
- 🌐 RESTful JSON API for frontend communication
- 📁 Efficient file streaming for large files
- 🛡️ CORS-enabled for secure cross-origin requests
Architecture
React Frontend (3000) ──proxy──► Go Backend (8081) ──► File System
│ │
├─ Dark/Light Theme ├─ JWT Auth
├─ Drag & Drop Upload ├─ File Upload/Download
├─ Real-time Search ├─ Directory Listing
└─ Mobile Responsive └─ QR Code Generation
Dark Mode Login (Default)
🌓 Elegant dark theme with smooth animations
🔒 Secure password authentication
📱 Mobile-responsive design
Modern File Browser
📁 Intuitive folder navigation with breadcrumbs
🔍 Real-time search as you type
📤 Drag & drop files directly into browser
🎨 Beautiful file type icons and hover effects
⚡ Fast loading and smooth transitions
🌓 Toggle between dark/light themes
Key UI Features
- ✨ Framer Motion animations for smooth transitions
- 🎯 Instant search filtering across files and folders
- 📱 Touch-friendly interface for mobile devices
- 🎨 Modern gradients and professional styling
- 🔔 Toast notifications for user feedback
- ⚡ Hot reload during development
Three ways to get up and running:
git clone https://github.com/yourusername/goshare.git
cd goshare
chmod +x start.sh
./start.sh
✅ That's it! Opens automatically at http://localhost:3000
make start # Start both servers
make start-with-password # Start with custom password
make build # Build production version
# Terminal 1 - Backend
go run main.go
# Terminal 2 - Frontend
cd frontend
npm install && npm start
All methods include:
- ✅ Automatic dependency installation
- ✅ Both React dev server + Go backend
- ✅ Hot reload for development
- ✅ Opens browser automatically
- ✅ Graceful shutdown on Ctrl+C
goshare/
├── 🚀 start.sh # One-command startup script
├── 📋 Makefile # Development shortcuts
├── 🔧 go.mod & go.sum # Go dependencies
├── 🏠 main.go # Go backend entry point
├── 📂 cmd/
│ └── root.go # CLI configuration
├── 🔒 internal/
│ └── server/
│ └── share.go # Core server logic & APIs
├── 🎨 frontend/ # React TypeScript app
│ ├── 📦 package.json # Node dependencies
│ ├── ⚙️ vite.config.ts # Vite configuration
│ ├── 🎨 tailwind.config.js # Styling configuration
│ └── 📁 src/
│ ├── 🏠 App.tsx # Main React component
│ ├── 🔐 Login.tsx # Authentication UI
│ ├── 📂 FileExplorer.tsx # File browser UI
│ ├── 🎨 index.css # Global styles
│ └── 🚀 main.tsx # React entry point
└── 📖 docs/ # Documentation
├── README.md # This file
├── CODEBASE.md # Technical details
└── QUICK_START.md # Demo guide
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Start development:
./start.sh
(one command setup!) - Make your changes (React frontend auto-reloads)
- Test thoroughly on both desktop and mobile
- Submit a pull request
Development Tips:
- 🔥 Hot reload is enabled for both React and Go (with
air
or manual restart) - 🎨 Tailwind classes rebuild automatically
- 🧪 Test on multiple devices using the LAN access feature
- 📱 Check mobile responsiveness using browser dev tools
This project is open source and available under the MIT License.
If GoShare helped you, please consider:
- ⭐ Starring this repository
- 🐛 Reporting bugs or suggesting features
- 🔀 Contributing improvements
- 📤 Sharing with others who need a simple file server
Made with ❤️ using React + TypeScript + Go
Experience the power of modern web development with the simplicity of one command.
go install github.com/sudo-init-do/goshare@latest
# Share current directory
goshare
# Share with password protection
goshare --password mysecret
# Share specific folder
goshare -d ~/Documents
# Share to the internet
goshare --ngrok
- Scan the QR code displayed in your terminal
- Or visit the URL shown (e.g.,
http://192.168.1.100:8080
) - Browse and download files through the beautiful web interface
- Modern React UI: Built with React 18, TypeScript, and Tailwind CSS
- Dark/Light Mode: Elegant theme switching with user preference persistence
- Drag & Drop Upload: Intuitive file upload with progress feedback
- Real-time Search: Instant file and folder search functionality
- File Icons: Visual indicators for documents, images, videos, code files
- Smart Navigation: Breadcrumb trails and intuitive folder browsing
- Mobile-First: Perfect experience on phones, tablets, and desktops
- One-Click Downloads: Download any file with a single click
- QR Code Generation: Automatic QR codes for instant device connection
- Local Network: Share files instantly across Wi-Fi networks
- No Setup Required: Works immediately without configuration
- Password Protection: Optional HTTP Basic Authentication
- Path Security: Bulletproof protection against directory traversal
- Controlled Access: Users can only access shared directories
- MIME Detection: Secure content type handling
- Internet Access: Expose files worldwide using ngrok integration
- Public URLs: Share with anyone, anywhere with secure tunneling
- Temporary Sharing: Perfect for one-time file distributions
# Install latest version directly
go install github.com/sudo-init-do/goshare@latest
# Verify installation
goshare --help
Visit Releases and download the binary for your platform.
git clone https://github.com/sudo-init-do/go_share_cli.git
cd go_share_cli
# Build React frontend
cd frontend && npm install && npm run build && cd ..
# Build Go binary
go build -o goshare .
- Go 1.24.4+ (for Option 1 & 3)
- Node.js 18+ and npm (for Option 3 - building React frontend)
- ngrok (optional, for internet sharing)
goshare
- Shares all files in your current working directory
- Server runs on
http://localhost:8080
- Displays QR code for instant mobile access
goshare -d /path/to/your/files
goshare -d ~/Documents
goshare -d "C:\Users\John\Pictures" # Windows
goshare -p 9000
goshare --password mysecretpassword
goshare --password "complex password 123" -d ~/Documents
- Adds HTTP Basic Authentication
- Users must enter the password to access files
- Password appears in username field (leave username empty)
goshare --ngrok
goshare --ngrok --password sharefiles -d ~/shared-files
- Exposes your files to the internet securely
- Generates public URL accessible from anywhere
- Combines with password protection for security
# Share vacation photos
goshare -d ~/Pictures/Vacation2024 --password family123
# Share presentation materials
goshare -d ~/Presentations --ngrok --password meeting2024
# Share build artifacts
goshare -d ./dist -p 3000
Command | Short | Description | Example |
---|---|---|---|
--dir |
-d |
Directory to share | goshare -d ~/Downloads |
--port |
-p |
Server port | goshare -p 9000 |
--password |
Access password | goshare --password secret123 |
|
--ngrok |
Internet sharing | goshare --ngrok |
|
--help |
-h |
Show help | goshare --help |
- Combine Options:
goshare -d ~/Files -p 8080 --password secure --ngrok
- Quick Access: After running, just scan the QR code with your phone
- Security: Always use passwords when sharing over the internet
- File Selection: Navigate to the specific folder you want to share before running
goshare
GoShare's React-powered web interface provides a premium file browsing experience:
- React 18 + TypeScript: Modern frontend framework with type safety
- Tailwind CSS: Professional styling with consistent, modern appearance
- Framer Motion: Smooth animations and transitions
- Responsive Layout: Automatically adapts to screen size
- Mobile Optimized: Touch-friendly buttons and navigation
- Dark/Light Mode: Elegant theme switching with persistence
- Drag & Drop Upload: Intuitive file upload with React Dropzone
- Real-time Search: Instant file and folder filtering
- File Type Icons: Instant visual recognition with Heroicons
- Size Information: Human-readable file sizes (KB, MB, GB)
- Modification Dates: See when files were last changed
- Folder Navigation: Click folders to explore, use breadcrumbs to go back
Category | File Types | Visual |
---|---|---|
Documents | PDF, Word, Excel, PowerPoint | Document icons |
Images | JPEG, PNG, GIF, SVG, WebP, BMP | Image icons |
Videos | MP4, AVI, MKV, MOV, WMV | Video icons |
Audio | MP3, WAV, FLAC, AAC, OGG | Audio icons |
Archives | ZIP, RAR, 7Z, TAR, GZ | Archive icons |
Code | Go, Python, JavaScript, C++, Java, PHP | Code icons |
Web | HTML, CSS, JSON, XML | Web icons |
- Direct Download: Click file names to view/download
- Force Download: Use download buttons to force file download
- Batch Access: Navigate freely between folders
- Secure Serving: Proper MIME types and headers
GoShare's web interface provides a premium file browsing experience:
- Responsive Layout: Automatically adapts to screen size
- Clean Typography: Easy-to-read fonts and proper spacing
- Professional Styling: Tailwind CSS for consistent, modern appearance
- Mobile Optimized: Touch-friendly buttons and navigation
- File Type Icons: Instant visual recognition of file types
- Size Information: Human-readable file sizes (KB, MB, GB)
- Modification Dates: See when files were last changed
- Folder Navigation: Click folders to explore, use breadcrumbs to go back
Category | File Types | Icon |
---|---|---|
Documents | PDF, Word, Excel, PowerPoint | 📄 |
Images | JPEG, PNG, GIF, SVG, WebP, BMP | 🖼️ |
Videos | MP4, AVI, MKV, MOV, WMV | 🎥 |
Audio | MP3, WAV, FLAC, AAC, OGG | 🎵 |
Archives | ZIP, RAR, 7Z, TAR, GZ | 📦 |
Code | Go, Python, JavaScript, C++, Java, PHP | 💻 |
Web | HTML, CSS, JSON, XML | 🌐 |
- Direct Download: Click file names to view/download
- Force Download: Use download buttons to force file download
- Batch Access: Navigate freely between folders
- Secure Serving: Proper MIME types and headers
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Client Device │────│ GoShare CLI │────│ File System │
│ (React UI) │ │ Go HTTP Server │ │ (Your Files) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ ◄─── QR Code ──────────┤ │
│ │ │
│ ◄─── React SPA ────────┤ ◄─── File Reading ─────┤
│ │ │
│ ◄─── REST API ─────────┤ │
- Path Sanitization: All file paths are cleaned and validated
- Root Containment: Users cannot access files outside the shared directory
- Authentication: Optional password protection with HTTP Basic Auth
- MIME Security: Proper content type detection prevents XSS attacks
- No Write Access: Read-only file sharing (no uploads or modifications)
- Server Start: GoShare binds to specified port and discovers local IP
- QR Generation: Creates QR code linking to
http://[LOCAL_IP]:[PORT]
- Request Handling: Custom HTTP handler processes all file requests
- Template Rendering: Dynamic HTML generation for directory listings
- File Serving: Secure file downloads with proper headers
- Efficient File Serving: Uses Go's optimized
http.ServeContent
- Concurrent Connections: Handles multiple users simultaneously
- Memory Efficient: Streams large files without loading into memory
- Fast Directory Listing: Optimized directory scanning and sorting
# Share meeting presentations
goshare -d ~/Presentations --password meeting2024
# Distribute project files to team
goshare -d ./project-assets --ngrok --password team123
# Share reports with clients
goshare -d ~/Reports -p 9000 --password client2024
# Share vacation photos
goshare -d ~/Pictures/Vacation2024
# Transfer files between devices
goshare -d ~/Downloads
# Share documents with family
goshare -d ~/Documents --password family
# Share build artifacts
goshare -d ./dist -p 3000
# Distribute test files
goshare -d ./test-data --password testing
# Quick static file serving
goshare -d ./public -p 8080
# Share course materials
goshare -d ~/Course-Materials --password students2024
# Distribute handouts during presentations
goshare -d ~/Handouts --ngrok
# Share resources in workshops
goshare -d ~/Workshop-Files
goshare/
├── cmd/
│ └── root.go # CLI commands and flags
├── internal/
│ └── server/
│ └── share.go # HTTP server & file handling
├── frontend/ # React application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API services
│ │ └── types/ # TypeScript types
│ ├── public/ # Static assets
│ └── package.json # Node.js dependencies
├── main.go # Application entry point
├── go.mod # Go module dependencies
├── go.sum # Dependency checksums
└── README.md # Documentation
# Clone repository
git clone https://github.com/sudo-init-do/go_share_cli.git
cd go_share_cli
# Install dependencies
go mod tidy
# Build React frontend
cd frontend && npm install && npm run build && cd ..
# Build for current platform
go build -o goshare .
# Build for multiple platforms
GOOS=windows GOARCH=amd64 go build -o goshare-windows.exe .
GOOS=darwin GOARCH=amd64 go build -o goshare-macos .
GOOS=linux GOARCH=amd64 go build -o goshare-linux .
# Run tests
go test ./...
# Test with coverage
go test -cover ./...
# Test specific functionality
go test ./internal/server -v
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Write tests for new functionality
- Follow Go best practices and
gofmt
standards - Update documentation for any changes
- Submit a pull request with clear description
# Install development tools
go install golang.org/x/tools/cmd/goimports@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
# Set up pre-commit hooks
go mod tidy
go fmt ./...
go vet ./...
staticcheck ./...
# Error: "bind: address already in use"
# Solution: Use a different port
goshare -p 8081
# Check firewall settings
# Ensure devices are on same Wi-Fi network
# Try different port: goshare -p 8080
# Install ngrok first
# macOS: brew install ngrok
# Windows: Download from ngrok.com
# Linux: Download binary from ngrok.com
- Ensure good lighting when scanning
- Try scanning from different angles
- Use the URL directly if QR doesn't work
- Large Files: GoShare streams files efficiently, no size limits
- Many Files: Directory listing is optimized for thousands of files
- Concurrent Users: Server handles multiple connections simultaneously
- Network Speed: Performance depends on your Wi-Fi network speed
This project is licensed under the MIT License. See LICENSE file for details.
- Cobra - MIT License
- go-qrcode - MIT License
- Tailwind CSS - MIT License (CDN)
- Font Awesome - Font Awesome Free License (CDN)
Special thanks to:
- Go Team for the excellent standard library
- Open Source Community for amazing libraries and tools
- Contributors who help improve GoShare
- Users who provide feedback and feature requests
- Check the FAQ
- Search existing Issues
- Create a new issue with:
- Operating system and version
- Go version (
go version
) - Command you ran
- Error message or unexpected behavior
- GitHub Discussions: Ask questions and share ideas
- Issues: Report bugs and request features
- Pull Requests: Contribute code improvements
- Platform Support: Windows, macOS, Linux
- Go Version: 1.24.4+
- Dependencies: Minimal (4 direct dependencies)
- Binary Size: ~10MB (statically compiled)