{"id":13416689,"url":"https://github.com/claudiodangelis/qrcp","last_synced_at":"2025-05-14T02:04:09.761Z","repository":{"id":37902090,"uuid":"117472496","full_name":"claudiodangelis/qrcp","owner":"claudiodangelis","description":":zap: Transfer files over wifi from your computer to your mobile device by scanning a QR code without leaving the terminal.","archived":false,"fork":false,"pushed_at":"2024-09-01T14:34:10.000Z","size":26653,"stargazers_count":9977,"open_issues_count":22,"forks_count":530,"subscribers_count":110,"default_branch":"main","last_synced_at":"2024-10-29T15:02:30.846Z","etag":null,"topics":["cli","command-line","golang","qrcode","utility"],"latest_commit_sha":null,"homepage":"https://qrcp.sh","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/claudiodangelis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["claudiodangelis"],"custom":["https://www.paypal.me/claudiodangelis","https://www.buymeacoffee.com/claudiodangelis"]}},"created_at":"2018-01-14T22:35:55.000Z","updated_at":"2024-10-28T22:04:49.000Z","dependencies_parsed_at":"2024-06-18T15:13:15.641Z","dependency_job_id":"73279829-7b98-4e69-916e-aa5d0a7aabd2","html_url":"https://github.com/claudiodangelis/qrcp","commit_stats":null,"previous_names":["claudiodangelis/qr-filetransfer"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claudiodangelis%2Fqrcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claudiodangelis%2Fqrcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claudiodangelis%2Fqrcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claudiodangelis%2Fqrcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/claudiodangelis","download_url":"https://codeload.github.com/claudiodangelis/qrcp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052667,"owners_count":22006716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","golang","qrcode","utility"],"created_at":"2024-07-30T22:00:19.953Z","updated_at":"2025-05-14T02:04:09.720Z","avatar_url":"https://github.com/claudiodangelis.png","language":"Go","funding_links":["https://github.com/sponsors/claudiodangelis","https://www.paypal.me/claudiodangelis","https://www.buymeacoffee.com/claudiodangelis"],"categories":["Popular","Go","Misc","File Management and Sharing","golang","Go (531)","终端","Tools","cli","Apps","Command-line"],"sub_categories":["OS Encryption","网络服务_其他","Go","File Transfer"],"readme":"![Logo](docs/img/logo.svg)\n\n# $ qrcp\n\nTransfer files over Wi-Fi from your computer to a mobile device by scanning a QR code without leaving the terminal.\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/claudiodangelis/qrcp)](https://goreportcard.com/report/github.com/claudiodangelis/qrcp)\n\nYou can support development by donating with  [![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/claudiodangelis).\n\nJoin the **Telegram channel** [qrcp_dev](https://t.me/qrcp_dev) or the [@qrcp_dev](https://twitter.com/qrcp_dev) **Twitter account** for news about the development.\n\n\n## How does it work?\n![Screenshot](docs/img/screenshot.png)\n\n`qrcp` binds a web server to the address of your Wi-Fi network interface on a random port and creates a handler for it. The default handler serves the content and exits the program when the transfer is complete. When used to receive files, `qrcp` serves an upload page and handles the transfer.\n\nThe tool prints a QR code that encodes the text:\n\n```\nhttp://{address}:{port}/{random_path}\n```\n\n\nMost QR apps can detect URLs in decoded text and act accordingly (i.e. open the decoded URL with the default browser), so when the QR code is scanned the content will begin downloading by the mobile browser.\n\nSend files to mobile:\n\n![screenshot](docs/img/demo.gif)\n\nReceive files from mobile:\n\n![Screenshot](docs/img/mobile-demo.gif)\n\n## Tutorials\n\n- [Secure transfers with mkcert](https://qrcp.sh/tutorials/secure-transfers-with-mkcert)\n\n# Installation\n\n## Install the latest development version with Go\n\n_Note: it requires go 1.18_\n\n    go install github.com/claudiodangelis/qrcp@latest\n\n## Linux\n\nDownload the latest Linux .tar.gz archive from the [Releases](https://github.com/claudiodangelis/qrcp/releases) page, extract it, move the binary to the proper directory, then set execution permissions.\n\n```sh\n# Extract the archive\ntar xf qrcp_0.5.0_linux_x86_64.tar.gz\n# Copy the binary\nsudo mv qrcp /usr/local/bin\n# Set execution permissions\nsudo chmod +x /usr/local/bin/qrcp\n```\n\n### Raspberry Pi\n\nThe following ARM releases are available in the [Releases](https://github.com/claudiodangelis/qrcp/releases) page:\n\n- `armv7`\n- `arm64`\n\n\n### Using a package manager\n\n#### ArchLinux\n\nPackages available on AUR:\n-  [qrcp-bin](https://aur.archlinux.org/packages/qrcp-bin)\n-  [qrcp](https://aur.archlinux.org/packages/qrcp)\n\n#### Deb packages (Ubuntu, Debian, etc)\n\nDownload the latest .deb package from the [Releases page](https://github.com/claudiodangelis/qrcp/releases), then run `dpkg`:\n\n```sh\nsudo dpkg -i qrcp_0.5.0_linux_x86_64.deb\n# Confirm it's working:\nqrcp version\n```\n\n#### RPM packages (CentOS, Fedora, etc)\n\nDownload the latest .rpm package from the [Releases page](https://github.com/claudiodangelis/qrcp/releases), then run `rpm`:\n\n```sh\nsudo rpm -i qrcp_0.5.0_linux_x86_64.rpm\n# Confirm it's working:\nqrcp --help\n```\n\n## Windows\n\nDownload the latest Windows .tar.gz archive from the [Releases page](https://github.com/claudiodangelis/qrcp/releases) and extract the EXE file.\n\n### Scoop\n\nIf you use [Scoop](https://scoop.sh/) for package management on Windows, you can install qrcp with the following one-liner:\n\n```\nscoop install qrcp\n```\n### Chocolatey\n\nIf you use [Chocolatey](https://community.chocolatey.org/packages/qrcp) for package management on Windows, you can install qrcp with the following one-liner:\n\n```\nchoco install qrcp\n```\n\n## MacOS\n\nDownload the latest macOS .tar.gz archive from the [Releases page](https://github.com/claudiodangelis/qrcp/releases), extract it, move the binary to the proper directory, then set execution permissions.\n\n```sh\n# Extract the archive\ntar xf qrcp_0.5.0_macOS_x86_64.tar.gz\n# Copy the binary\nsudo mv qrcp /usr/local/bin\n# Set execution permissions\nsudo chmod +x /usr/local/bin/qrcp\n# Confirm it's working:\nqrcp --help\n```\n\n### Homebrew\n\nIf you use [Homebrew](https://brew.sh) for package management on macOS, you can install qrcp with the following one-liner:\n\n```\nbrew install qrcp\n```\n\n# Usage\n\n## Send files\n\n### Send a file\n\n```sh\nqrcp MyDocument.pdf\n```\n\n### Send multiple files at once\n\nWhen sending multiple files at once, `qrcp` creates a zip archive of the files or folders you want to transfer, and deletes the zip archive once the transfer is complete.\n\n```sh\n# Multiple files\nqrcp MyDocument.pdf IMG0001.jpg\n```\n\n```sh\n# A whole folder\nqrcp Documents/\n```\n\n\n### Zip a file before transferring it\nYou can choose to zip a file before transferring it.\n\n```sh\nqrcp --zip LongVideo.avi\n```\n\n\n## Receive files\n\nWhen receiving files, `qrcp` serves an \"upload page\" through which you can choose files from your mobile.\n\n### Receive files to the current directory\n\n```\nqrcp receive\n```\n\n### Receive files to a specific directory\n\n```sh\n# Note: the folder must exist\nqrcp receive --output=/tmp/dir\n```\n\n\n## Configuration\n\n`qrcp` works without any prior configuration, however, you can choose to configure to use specific values.\n\nTo configure `qrcp` you can create a configuration file inside `$XDG_CONFIG_HOME/qrcp`.\n\n\u003e Note: On Linux, the `$XDG_CONFIG_HOME` is `.config` under user home directory.\n\u003e So, for example, on Linux the configuration file will be `$HOME/.config/qrcp/config.yml`.\n\u003e On MacOS, it defaults to `$HOME/Library/Application Support/qrcp/config.yml``\n\n\u003e Note: Starting from version 0.10.0, qrcp uses a YAML configuration file instead of the old JSON one. You can automatically migrate the legacy JSON format to the new YAML format by running `qrcp config migrate`.\n\n| Key         | Type    | Notes                                                                                                                                                                                  |\n|-------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `interface` | String  | This value is automatically discovered during the first launch of `qrcp`, you can set it to override the default. You can use the `any` interface to bind the web server to `0.0.0.0`. |\n| `bind`      | String  | This value is used by qrcp to bind the web server to. Note: if this value is set, the `interface` parameter is ignored.                                                                |\n| `port`      | Integer | When this value is not set, `qrcp` will pick a random port at any launch.                                                                                                              |\n| `path`      | String  | When this value is not set, `qrcp` will add a random string at the end of URL.                                                                                                         |\n| `output`    | String  | Default directory to receive files to. If empty, the current working directory is used.                                                                                                |\n| `fqdn`      | String  | When this value is set, `qrcp` will use it to replace the IP address in the generated URL.                                                                                             |\n| `keepAlive` | Bool    | Controls whether `qrcp` should quit after transferring the file. Defaults to `false`.                                                                                                  |\n| `secure`    | Bool    | Controls whether `qrcp` should use HTTPS instead of HTTP. Defaults to `false`                                                                                                          |\n| `tls-cert`  | String  | Path to the TLS certificate. It's only used when `secure: true`.                                                                                                                       |\n| `tls-key`   | String  | Path to the TLS key. It's only used when `secure: true`.                                                                                                                               |\n| `reversed`  | Bool    | Reverse QR code (black text on white background)?\" true`.                                                                                                                               |\n\n\nAll the configuration parameters can be controlled via environment variables prefixed with `QRCP_`, for example:\n- `$QRCP_INTERFACE`\n- `$QRCP_PORT`\n- `$QRCP_KEEPALIVE`\n- _etc_\n\n### Config Wizard\n\nThe `config` command launches a wizard that lets you configure parameters like interface, port, fully-qualified domain name and keep alive.\n\n```sh\nqrcp config\n```\n\nNote: if some network interfaces are not showing up, use the `--list-all-interfaces` flag to suppress the interfaces' filter.\n\n```sh\nqrcp --list-all-interfaces config\n```\n\n\n### Configuration File\n\nThe default configuration file is stored in $XDG_CONFIG_HOME/qrcp/config.yml, however, you can specify the location of the config file by passing the `--config` flag:\n\n```sh\nqrcp --config /tmp/qrcp.yml MyDocument.pdf\n```\n\n### Port\n\nBy default `qrcp` listens on a random port. Set the `QRCP_PORT` environment variable or pass the `--port` (or `-p`) flag to choose a specific one:\n\n```sh\nexport QRCP_PORT=8080\nqrcp MyDocument\n```\n\nOr:\n\n```sh\nqrcp --port 8080 MyDocument.pdf\n```\n\n### Network Interface\n\n`qrcp` will try to automatically find the suitable network interface to use for the transfers. If more than one suitable interface is found, it asks you to choose one.\n\nIf you want to use a specific interface, pass the `--interface` (or `-i`) flag:\n\n\n\n```sh\n# The webserver will be visible by\n# all computers on the tun0's interface network\nqrcp -i tun0 MyDocument.dpf\n```\n\n\nYou can also use a special interface name, `any`, which binds the web server to `0.0.0.0`, making the web server visible by everyone on any network, even from an external network.\n\nThis is useful when you want to transfer files from your Amazon EC2, Digital Ocean Droplet, Google Cloud Platform Compute Instance or any other VPS.\n\n```sh\nqrcp -i any MyDocument.pdf\n```\n\n### Bind\n\nAlternatively to choosing the interface, you can directly specify the address you want `qrcp` to bind the webserver to.\n\n```sh\nqrcp --bind 10.20.30.40 MyDocument.pdf\n```\n\n### URL\n\n`qrcp` uses two patterns for the URLs:\n\n- send: `http://{ip address}:{port}/send/{random path}`\n- receive: `http://{ip address}:{port}/receive/{random path}`\n\nA few options are available that override these patterns.\n\n\nPass the `--path` flag to use a specific path for URLs, for example:\n\n```sh\n# The resulting URL will be\n# http://{ip address}:{port}/send/x\nqrcp --path=x MyDocument.pdf\n```\n\nPass the `--fqdn` (or `-d`) to use a fully qualified domain name instead of the IP. This is useful in combination with `-i any` you are using it from a remote location:\n\n```sh\n# The resulting URL will be\n# http://example.com:8080/send/xYz9\nqrcp --fqdn example.com -i any -p 8080 MyRemoteDocument.pdf\n```\n\n### HTTPS\n\n**qrcp** supports secure file transfers with HTTPS. To enable secure transfers you need a TLS certificate and the associated key.\n\nYou can choose the path to the TLS certificate and keys from the `qrcp config` wizard, or, if you want, you can pass the `--tls-cert` and `--tls-key`:\n\n```sh\nqrcp --tls-cert /path/to/cert.pem --tls-key /path/to/cert.key MyDocument\n```\n\nA `--secure` flag is available too, you can use it to override the default value.\n\n### Default output directory\n\n### Open in browser\n\nIf you need a QR to be printed outside your terminal, you can pass the `--browser` flag. With this flag, `qrcp` will still print the QR code to the terminal, but it will also open a new window of your default browser to show the QR code.\n\n```\nqrcp --browser MyDocument.pdf\n```\n\n### Keep the server alive\n\nIt can be useful to keep the server alive after transferring the file, for example, when you want to transfer the same file to multiple devices. You can use the `--keep-alive` flag for that:\n\n```sh\n# The server will not shutdown automatically\n# after the first transfer\nqrcp --keep-alive MyDocument.pdf\n```\n\n## Shell completion scripts\n\n`qrcp` comes with a built-in `completion` command that generates shell completion scripts.\n\n### Bash:\n\n    $ source \u003c(qrcp completion bash)\n\nTo load completions for each session, execute once:\n\nLinux:\n\n    $ qrcp completion bash \u003e /etc/bash_completion.d/qrcp\n\n_Note: if you don't want to install completion scripts system-wide, refer to [Bash Completion FAQ](https://github.com/scop/bash-completion/blob/master/README.md)_.\n\nMacOS:\n\n    $ qrcp completion bash \u003e /usr/local/etc/bash_completion.d/qrcp\n\n### Zsh:\n\nIf shell completion is not already enabled in your environment you will need to enable it.  You can execute the following once:\n\n    $ echo \"autoload -U compinit; compinit\" \u003e\u003e ~/.zshrc\n\nTo load completions for each session, execute once:\n\n    $ qrcp completion zsh \u003e \"${fpath[1]}/_qrcp\"\n\nYou will need to start a new shell for this setup to take effect.\n\n### Fish:\n\n    $ qrcp completion fish | source\n\nTo load completions for each session, execute once:\n\n    $ qrcp completion fish \u003e ~/.config/fish/completions/qrcp.fish\n\n\n## Authors\n\n**qrcp**, originally called **qr-filetransfer**, started from an idea of [Claudio d'Angelis](claudiodangelis@gmail.com) ([@claudiodangelis](https://t.me/claudiodangelis) on Telegram), the current maintainer, and it's [developed by the community](https://github.com/claudiodangelis/qrcp/graphs/contributors).\n\n\n[Join us!](https://github.com/claudiodangelis/qrcp/fork)\n\n## Credits\n\nLogo is provided by [@arasatasaygin](https://github.com/arasatasaygin) as part of the [openlogos](https://github.com/arasatasaygin/openlogos) initiative, a collection of free logos for open source projects.\n\nCheck out the rules to claim one: [rules of openlogos](https://github.com/arasatasaygin/openlogos#rules).\n\nReleases are handled with [goreleaser](https://goreleaser.com).\n\n## Clones and Similar Projects\n\n- [qr-fileshare](https://github.com/shivensinha4/qr-fileshare) - A similar idea executed in NodeJS with a React interface.\n- [instant-file-transfer](https://github.com/maximumdata/instant-file-transfer) _(Uncredited)_ - Node.js project similar to this\n- [qr-filetransfer](https://github.com/sdushantha/qr-filetransfer) - Python clone of this project\n- [qr-filetransfer](https://github.com/svenkatreddy/qr-filetransfer) - Another Node.js clone of this project\n- [qr-transfer-node](https://github.com/codezoned/qr-transfer-node) - Another Node.js clone of this project\n- [QRDELIVER](https://github.com/realdennis/qrdeliver) - Node.js project similar to this\n- [qrfile](https://github.com/sgbj/qrfile) - Transfer files by scanning a QR code\n- [quick-transfer](https://github.com/CodeMan99/quick-transfer) - Node.js clone of this project\n- [share-file-qr](https://github.com/pwalch/share-file-qr) - Python re-implementation of this project\n- [share-files](https://github.com/antoaravinth/share-files) _(Uncredited)_  - Yet another Node.js clone of this project\n- [ezshare](https://github.com/mifi/ezshare) - Another Node.js two way file sharing tool supporting folders and multiple files\n- [local_file_share](https://github.com/woshimanong1990/local_file_share)  - _\"share local file to other people, OR smartphone download files which is in pc\"_\n- [qrcp](https://github.com/pearl2201/qrcp) - a desktop app clone of `qrcp`, writing with C# and .NET Core, work for Windows.\n- [swift_file](https://github.com/mateoradman/swift_file) - Rust project inspired by `qrcp`.\n- [qrcp-android](https://github.com/ianfixes/qrcp-android) - Android app inspired by `qrcp`.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaudiodangelis%2Fqrcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclaudiodangelis%2Fqrcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaudiodangelis%2Fqrcp/lists"}