Skip to content

knife-fish/CopyAnywhere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CopyAnywhere

LAN clipboard sync for Windows, macOS, and Linux.

Current scope

  • Text clipboard sync only.
  • Manual file sending is available through the CLI, and the tray UI can send a selected file to an online trusted device.
  • Automatic peer discovery over UDP broadcast on the local network.
  • Encrypted transport with self-signed TLS certificates.
  • Pairing trust persisted locally after confirmation.
  • Local control plane for status, pause, resume, and stop.

Run

copyanywhere run

Start the tray app instead of the plain CLI service:

copyanywhere tray

On Windows, the default build already includes tray support. On Linux and macOS, build with --features desktop-ui when you want tray/dialog support.

Useful flags:

copyanywhere run --pairing prompt
copyanywhere run --pairing auto-accept

Query the running service:

copyanywhere status
copyanywhere config

Pause or resume sync without stopping the process:

copyanywhere pause
copyanywhere resume

Ask the running service to exit:

copyanywhere stop

Manually test file transfer to an already paired peer:

copyanywhere send-file t480 ./example.txt
copyanywhere send-file dd7b1e4a-2bd9-4a4c-a7d7-92f134863ef1 ./example.txt
copyanywhere send-file 192.168.1.10:37848 ./example.txt
copyanywhere send-files t480 ./a.txt ./b.txt
copyanywhere received-files
copyanywhere copy-received
copyanywhere copy-received 1
copyanywhere copy-received example.txt
copyanywhere open-received
copyanywhere open-received 1
copyanywhere reveal-received
copyanywhere reveal-received example.txt
copyanywhere open-inbox
copyanywhere prune-received-history
copyanywhere clear-received-history
copyanywhere transfers
copyanywhere retry-failed-transfer
copyanywhere retry-failed-transfer 1
copyanywhere clear-transfer-history

List trusted peers:

copyanywhere trust

Remove one trusted peer:

copyanywhere unpair <device-id>

Clear all trusted peers:

copyanywhere reset-trust
copyanywhere set-device-name my-laptop
copyanywhere set-pairing prompt
copyanywhere set-pairing auto-accept
copyanywhere autostart
copyanywhere enable-autostart
copyanywhere disable-autostart
copyanywhere set-listen-port 37848
copyanywhere set-discovery-port 37847
copyanywhere set-control-port 37849
copyanywhere reload-config
copyanywhere doctor
copyanywhere self-test
copyanywhere regression-test
copyanywhere export-diagnostics

Build release artifacts:

pwsh ./packaging/package-windows.ps1
sh ./packaging/package-macos.sh
sh ./packaging/package-linux.sh

Windows packaging details:

  • build.rs embeds Windows version metadata into copyanywhere.exe.
  • packaging/package-windows.ps1 produces:
    • dist/windows/portable/
    • dist/windows/copyanywhere-windows-portable.zip
    • dist/windows/installer/copyanywhere-setup.exe when Inno Setup iscc is installed
  • packaging/copyanywhere.iss is the Inno Setup script used for the installer build.
  • When you bump the app version, update both Cargo.toml and packaging/copyanywhere.iss.

Notes

  • Each machine must run CopyAnywhere in the foreground or as a background process.
  • Pairing confirmation now prefers a desktop dialog; terminal input is only used as a fallback when no GUI dialog is available.
  • Clipboard sync uses the system clipboard, so users still paste with the native Ctrl+V or platform equivalent.
  • The default config directory is ~/.config/copyanywhere/ unless --config-dir is provided.
  • run also starts a local control socket on 127.0.0.1:37849 by default; status, pause, resume, and stop talk to that control plane.
  • config prints the persisted device settings, config directory, and autostart entry path.
  • set-device-name updates the stored device name. Restart the service afterward so discovery broadcasts and TLS identity metadata reflect the new name everywhere.
  • set-pairing switches between prompt and auto-accept. This takes effect immediately when the service is already running.
  • autostart, enable-autostart, and disable-autostart manage per-user startup entries:
    • Windows: %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\copyanywhere-tray.cmd
    • macOS: ~/Library/LaunchAgents/org.knifefish.copyanywhere.plist
    • Linux: ~/.config/autostart/copyanywhere.desktop
  • reload-config reloads mutable settings from config.json into the running service. Port changes still require a restart because listeners are already bound.
  • set-listen-port and set-discovery-port update the stored ports. If the service is running, the change is saved immediately but takes effect only after a restart.
  • set-control-port updates the stored control port for the next launch. Change it while the service is stopped, or restart immediately after changing it.
  • doctor prints a diagnostic summary including config, runtime status, active transfers, recent warnings/errors, and Linux clipboard environment variables.
  • self-test performs executable local checks for config/inbox writability, clipboard availability, autostart entry resolution, and control-plane reachability.
  • regression-test creates a temporary isolated config, starts a local copyanywhere service instance, verifies control-plane operations, config reload, history read/write, file chunking, diagnostics export, and graceful shutdown, then removes the temp workspace.
  • export-diagnostics writes a JSON report under the active config directory's diagnostics/ subdirectory.
  • tray shows online devices and trusted devices in submenus, can forget trusted peers, exposes a Settings submenu for device name, listen/discovery ports, pairing policy, autostart, Open Config File, and Reload Config, and uses desktop dialogs for pair requests plus key runtime errors and pause/resume feedback.
  • send-file and send-files accept a device name, device id, or raw ip:port. In tray mode, Send File shows online trusted devices and opens a native multi-file picker before sending.
  • Batch sends now report per-file progress in the CLI and show start/completion notifications in tray mode.
  • The tray now shows live Active Transfers with progress percentages and a Recent Diagnostics submenu with the latest warnings/errors.
  • The tray also shows a compact top-level health summary derived from runtime failure counters.
  • regression-test is intentionally single-machine. It does not prove LAN discovery, cross-machine pairing, or real remote clipboard/file transfer.
  • In tray mode, incoming file transfers ask for confirmation first and let the user choose a save location. In plain CLI mode, incoming files continue to land in the default inbox automatically.
  • Received files are tracked in an inbox manifest with file name, size, source device, timestamp, and stored path metadata.
  • On macOS, a newly received file is also published to the local file clipboard automatically, so the user can paste it into Finder or another file target immediately after receipt.
  • On Linux, file clipboard publishing now works as a best-effort bridge through wl-copy or xclip when one of those tools is available in the desktop session.
  • On Windows, file clipboard publishing now works through a PowerShell/STA clipboard bridge, so received files can be pasted into Explorer or another file target in a normal desktop session.
  • copy-received publishes a received file back to the local file clipboard by latest item, 1-based index, transfer id, file name, or stored path.
  • open-received opens a received file locally by latest item, 1-based index, transfer id, file name, or stored path.
  • reveal-received reveals a received file in the local file manager.
  • open-inbox opens the local inbox directory.
  • prune-received-history removes manifest entries whose files no longer exist on disk.
  • clear-received-history clears the received-file manifest history without deleting the files themselves.
  • transfers lists recent send/receive outcomes from the transfer history.
  • retry-failed-transfer retries a recent failed send by latest item, 1-based index, transfer id, file name, peer id, peer name, or source path.
  • clear-transfer-history clears the transfer-history log.
  • The tray can also prune missing history entries, clear received history, and open, reveal, or copy recent received files directly.
  • The tray also shows a recent transfer summary submenu, can clear transfer history, and offers Retry ... for recent failed sends.
  • The tray can open the active config directory directly. Device-name editing is still CLI-driven because the current desktop dependency set does not include a cross-platform text-input dialog.
  • From the tray, changing the device name is immediate in config but still requires a service restart before other peers see the new identity everywhere.
  • From the tray, changing the listen or discovery port saves the new value and reminds you to restart the service. The control port remains a CLI/config-file setting because the live control socket cannot move transparently.
  • Local file clipboard publishing is implemented on macOS, as a best-effort bridge on Linux, and through PowerShell on Windows.
  • Desktop UI is enabled by default on Windows builds. On Linux and macOS, default builds stay CLI-only; use --features desktop-ui when you want tray dialogs and are willing to satisfy the platform GUI dependencies.
  • The packaging scripts create simple dist/<platform>/ folders with the built binary and README.md; they do not yet perform code signing or produce native installers.
  • Windows packaging now includes a native Inno Setup installer script, but code signing is still not configured.

About

LAN clipboard sync for Windows, macOS, and Linux.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages