# PhoneBridge (CLI prototype) PhoneBridge is a working local-network HTTP file bridge: point it at a file or folder and it starts a small HTTP server on your computer that your phone's browser can open over the same Wi-Fi to download it (or, in reverse, open a page on your phone and upload a file straight back to your computer) — no cable, no companion app, no pairing, no cloud account required. This is a genuine, dependency-free technique for quick phone-computer hand-offs. Real iPhone/Android device-protocol transfer (MTP for Android, AFC/iTunes protocol for iOS), messages/photos/music export, and full device-to-device migration from the original product concept all require platform-specific device libraries/drivers that cannot be implemented as a portable, stdlib-only Go CLI — those remain on the roadmap. See ../plan.md for the full product plan. ## Build from source Requires Go 1.24+, no external dependencies. go build -o phonebridge . Cross-compile for another platform: GOOS=windows GOARCH=amd64 go build -o phonebridge.exe . GOOS=darwin GOARCH=arm64 go build -o phonebridge . ## Usage phonebridge send [--port 0] [--once] [--host ] Serves a file or a directory over HTTP so your phone can download it. A single file is served directly at "/" (and "/") using http.ServeFile, which correctly supports HTTP Range requests (resumable downloads) and sets the right Content-Type. A directory is served with an auto-generated HTML index page listing every file with a download link, using http.FileServer, which also supports Range/resume for each file. --port 0 (the default) lets the OS pick a free port; the actual bound port is detected and printed. --once shuts the server down automatically right after the first successful full download completes (handy for a single one-off hand-off); without it, the server runs until you press Ctrl+C, printing a line for every request as it completes. --host overrides the auto-detected LAN address printed in the URL (see below). phonebridge receive [--port 0] [--once] [--host ] Starts a server with a minimal upload form at "/" (a plain HTML file input posting multipart/form-data to "/upload"). Files POSTed to "/upload" are saved into (created automatically if it doesn't exist), and a confirmation page is returned. --once shuts the server down after the first successful upload; otherwise it runs until interrupted, printing each received file's name and size as it lands. --port and --host behave the same as for "send". An upload never replaces a file that is already in . Phones reuse filenames constantly (IMG_0001.JPG, image.jpg), so when the name is taken the file is saved under the next free variation of it — "photo.jpg", then "photo (2).jpg" — and the name actually used is printed along with the reason. Files are opened O_EXCL, so replacing an existing file is not something this command can do, with or without a flag. phonebridge help LAN address detection: PhoneBridge picks the first non-loopback IPv4 address from net.InterfaceAddrs() as a best-effort guess at your LAN IP. On machines with multiple network interfaces (VPNs, virtual adapters, multiple NICs) this heuristic can pick the wrong one — pass --host with your phone-reachable IP to override it. If no non-loopback address is found at all, PhoneBridge falls back to 127.0.0.1 and prints a clear warning rather than crashing (that fallback is only reachable from the same machine, not from a phone). Security note: this opens an unauthenticated HTTP server on your LAN for as long as it runs — anyone on the same network can reach the URL while it's up. That's fine for a quick hand-off on a trusted home network; use --once or stop the server with Ctrl+C promptly, and don't leave it running on a shared or untrusted network. ## Prebuilt binaries See ../downloads/ for prebuilt binaries (Windows/macOS/Linux) and CHECKSUMS.txt for their SHA-256 hashes. These are unsigned indie builds — Windows SmartScreen and macOS Gatekeeper will warn on first run, which is expected until a code-signing certificate is in place.