DEV Community

Dana Aus
Dana Aus

Posted on

Magshare: A CLI tool that allows local file sharing

πŸš€ Magshare

Instant, frictionless file sharing and receiving across your local network via CLI.

magshare demo


Magshare is a blazing-fast, terminal-based utility designed to eliminate the friction of transferring files between devices on the same local network. By spinning up an ephemeral local web server and rendering a QR code directly in your terminal, it allows any mobile device or PC to securely download or upload files in secondsβ€”no cables, no cloud drives, and no client-side app installations required.

✨ Core Features

  • πŸ“± Instant QR Generation: Automatically detects your local IP and renders an access URL as a scannable QR code directly within your terminal window.
  • ⚑ Interactive TUI Mode: Don't want to remember command flags? Launch the guided, prompt-based UI to effortlessly configure your sharing session.
  • πŸͺΆ Memory-Efficient Streaming: Engineered to handle ultra-large files (10GB+) by streaming directly from disk, keeping RAM consumption safely under 20MB.
  • πŸ›‘οΈ Secure Mode: Protect sensitive network transfers by requiring a dynamically generated 4-digit PIN before a download or upload can begin.
  • 🌐 Web Dropzone: Running in "receive" mode serves a lightweight, responsive HTML5 dropzone to the client device for seamless drag-and-drop uploads.

πŸ“¦ Installation

Only available on Windows for now
Magshare is distributed as a standalone executable. Choose your preferred package manager below:

From Source (Go)

For developers who want to compile the latest version directly:

go install github.com/DanaAus/magshare@latest
Enter fullscreen mode Exit fullscreen mode

Manual Installation

  1. Download the latest version from the Releases page
  2. Put the downloaded file in a folder
  3. Launch the program by prompting magshare in your Terminal --> Make sure to locate the path of the program before prompting. ---

πŸš€ Usage

magshare is designed to be completely intuitive. You can use the guided TUI, or pass commands directly.

1. Interactive TUI Mode

Simply run the command with no arguments to launch the interactive terminal interface:

magshare
Enter fullscreen mode Exit fullscreen mode

2. Sending a File (Host βž” Client)

Share a specific file. The client's browser will automatically prompt a direct download upon scanning the QR code.

magshare send ./my-file.txt
Enter fullscreen mode Exit fullscreen mode

Tip: Add the --secure flag to generate a one-time PIN for the transfer.

3. Receiving Files (Client βž” Host)

Spin up a temporary web server that allows anyone on the network to upload files directly to your current terminal directory.

magshare receive
Enter fullscreen mode Exit fullscreen mode

🀝 Contributing

magshare is open-source software, and contributions are always welcome! If you'd like to improve the codebase, add a feature, or report a bug:

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

πŸ“„ License

This project is distributed under the Apache 2.0 License. Feel free to use, modify, and distribute it as you see fit.

If you find this project interesting, consider going to its repository!

Top comments (0)