2fm.dev - TwoFullMoons

Magic Wormhole

In our connected world, transferring files between computers should be simple, but it often isn't. Email has size limits, cloud services require accounts, and USB drives aren't always practical. Enter Magic Wormhole - a brilliantly simple tool that makes secure file transfers feel like, well, magic.

What is Magic Wormhole?

Magic Wormhole is a command-line tool that makes it possible to get arbitrary-sized files and directories (or short pieces of text) from one computer to another safely. What sets it apart is its ingenious approach: the two endpoints are identified by using identical "wormhole codes" that are short and human-pronounceable, using a phonetically-distinct wordlist.

How It Works

The process is refreshingly straightforward:

  1. Sender: Run wormhole send filename and get a unique code
  2. Receiver: Run wormhole receive and enter the code
  3. Magic happens: Files transfer securely between the machines

Wormhole codes are single-use and do not need to be memorized, making the process both secure and user-friendly.

Key Features

Installation

# Using pip
pip install magic-wormhole

# Ubuntu/Debian
sudo apt install magic-wormhole

# macOS with Homebrew
brew install magic-wormhole

# Arch Linux
sudo pacman -S magic-wormhole

Basic Usage

Sending a file:

wormhole send document.pdf
# Outputs: "wormhole receive 7-guitarist-revenge"

Receiving a file:

wormhole receive 7-guitarist-revenge

Sending text:

echo "Hello, world!" | wormhole send --text

Why Magic Wormhole Excels

Magic Wormhole solves the file transfer problem elegantly by removing common friction points. There's no need to configure firewall rules, set up accounts, or worry about file size limits. The human-readable codes eliminate the error-prone process of sharing long URLs or complex connection details.

The tool strikes an ideal balance between security and usability. Files are encrypted end-to-end, codes are single-use, and the transfer happens directly between machines when possible, bypassing third-party storage.

Perfect Use Cases

Magic Wormhole proves that the best tools often have the simplest interfaces. This library is compatible with Python 3.8 and higher and is released under the MIT license, making it both accessible and open source.

Next time you need to transfer a file securely and quickly, remember that sometimes the most magical solution is also the most practical one. Give Magic Wormhole a try - you might find yourself wondering how you ever managed file transfers without it!