Back to list
dev_to 2026年3月14日

'磁気的'な QR コードによるファイル共有 CLI ツールを構築しました

I built a 'magnetic' file sharing CLI tool via QR Codes

Translated: 2026/3/14 13:01:51
clifile-sharingqr-codesmagshareopen-source

Japanese Translation

🚀 Magshare ローカルネットワーク上で、CLI を使用して直感的で障害の少ないファイル共有と受信を実現します。 Magshare は、同一ローカルネットワークにあるデバイ間でファイルを転送する際の摩擦を除去するために設計された、爆速のターミナルベースのユーティリティです。 ephemeral(一時性)のローカル Web サーバーを起動し、ターミナル画面に直接 QR コードを表示させることで、あらゆるモバイルデバイスや PC が秒単位でファイルを安全にダウンロードまたはアップロードできます。ケーブルもクラウドストレージも、クライアントサイドアプリのインストールも不要です。 📱 直感的な QR コード生成:ローカル IP アドレスを自動的に検出し、スキャン可能な QR コードとしてアクセス URL をターミナルウィンドウ内に直接表示します。 ⚡ インタラクティブな TUI モード:コマンドフラグの記憶が不要ですか?ガイドされたプロンプトベースの UI を起動し、共有セッションを容易に設定できます。 🪶 メモリ効率的なストリーミング:10GB を超える超大型ファイルを処理するように設計されており、ディスクから直接ストリーミングすることで、RAM 消費量を 20MB を安全に下げています。 🛡️ 保護モード:ダウンロードまたはアップロードが開始される前に、動的に生成された 4 桁の PIN を要求することで、機密情報のネットワーク転送を保護します。 🌐 Web ドロップゾーン:"受信"モードでは、軽量化されたレスポンシブ HTML5 ドロップゾーンをクライアントデバイスに提供し、スムーズなドラッグ&ドロップアップロードを可能にします。 現時点では Windows でのみ利用可能です 最新バージョンを直接コンパイルするための開発者向け: go install github.com/DanaAus/magshare@latest Releases ページから最新版をダウンロードし、ダウンロードしたファイルをフォルダに配置します。 ターミナルで magshare プロンプトを入力してプログラムを起動します。 --> プログラムのパスを検出してからプロンプトに入力してください。 --- Magshare は完全に直感的に設計されており、ガイドされた TUI を使用するか、コマンドを直接実行できます。 何も引数を与えずにコマンドを実行するだけで、インタラクティブなターミナルインターフェースが起動します: magshare 特定のファイルを共有します。クエリーコードをスキャンすると、クライアントのブラウザが自動的に直結ダウンロードのプロンプトを表示します。 magshare send ./my-file.txt ヒント:転送に使用するワンタイム PIN を生成するために --secure フラグを追加してください。 ネットワーク上の誰もが現在のターミナルディレクトリにファイルを直接アップロードできるようにする一時的な Web サーバーを起動します。 magshare receive Magshare はオープンソースソフトウェアであり、貢献は常に歓迎されます!コードベースを改善したり、新しい機能を追加したり、バグを報告したい場合は: リポジトリをフォークします。 機能ブランチを作成します (git checkout -b feature/AmazingFeature)。 変更をコミットします (git commit -m 'Add some AmazingFeature')。 ブランチにプッシュします (git push origin feature/AmazingFeature)。 プルリクエストを開きます。 このプロジェクトは Apache 2.0 ライセンスに基づいて配布されています。お好みのまま使用、修正、配布していただけます。

Original Content

🚀 Magshare Instant, frictionless file sharing and receiving across your local network via CLI. 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. 📱 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. Only available on Windows for now For developers who want to compile the latest version directly: go install github.com/DanaAus/magshare@latest Download the latest version from the Releases page Put the downloaded file in a folder Launch the program by prompting magshare in your Terminal --> Make sure to locate the path of the program before prompting. --- magshare is designed to be completely intuitive. You can use the guided TUI, or pass commands directly. Simply run the command with no arguments to launch the interactive terminal interface: magshare Share a specific file. The client's browser will automatically prompt a direct download upon scanning the QR code. magshare send ./my-file.txt Tip: Add the --secure flag to generate a one-time PIN for the transfer. Spin up a temporary web server that allows anyone on the network to upload files directly to your current terminal directory. magshare receive 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: 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 distributed under the Apache 2.0 License. Feel free to use, modify, and distribute it as you see fit. repository!