{"id":13393080,"url":"https://github.com/schollz/croc","last_synced_at":"2025-05-12T16:17:57.132Z","repository":{"id":37334529,"uuid":"107286889","full_name":"schollz/croc","owner":"schollz","description":"Easily and securely send things from one computer to another :crocodile: :package:","archived":false,"fork":false,"pushed_at":"2025-05-06T08:19:22.000Z","size":24957,"stargazers_count":30158,"open_issues_count":7,"forks_count":1207,"subscribers_count":253,"default_branch":"main","last_synced_at":"2025-05-12T16:17:52.441Z","etag":null,"topics":["data-transfer","file-sharing","golang","pake","peer-to-peer","tcp","transfer"],"latest_commit_sha":null,"homepage":"https://schollz.com/software/croc6","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/schollz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"schollz"}},"created_at":"2017-10-17T15:20:18.000Z","updated_at":"2025-05-12T13:48:19.000Z","dependencies_parsed_at":"2022-07-14T04:00:33.464Z","dependency_job_id":"3d231762-bad6-4148-b1e0-968f59569f9b","html_url":"https://github.com/schollz/croc","commit_stats":{"total_commits":1554,"total_committers":91,"mean_commits":"17.076923076923077","dds":0.1576576576576577,"last_synced_commit":"23a89041934a3110c183cc2e3be382940985ec3b"},"previous_names":[],"tags_count":176,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schollz%2Fcroc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schollz%2Fcroc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schollz%2Fcroc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schollz%2Fcroc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schollz","download_url":"https://codeload.github.com/schollz/croc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253774591,"owners_count":21962199,"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":["data-transfer","file-sharing","golang","pake","peer-to-peer","tcp","transfer"],"created_at":"2024-07-30T17:00:42.489Z","updated_at":"2025-05-12T16:17:57.087Z","avatar_url":"https://github.com/schollz.png","language":"Go","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/6550035/46709024-9b23ad00-cbf6-11e8-9fb2-ca8b20b7dbec.jpg\" width=\"408px\" border=\"0\" alt=\"croc\"\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/schollz/croc/releases/latest\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/release/schollz/croc\" alt=\"Version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/schollz/croc/actions/workflows/ci.yml\"\u003e\n    \u003cimg src=\"https://github.com/schollz/croc/actions/workflows/ci.yml/badge.svg\" alt=\"Build Status\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  This project is supported by \u003ca href=\"https://github.com/sponsors/schollz\"\u003eGitHub sponsors\u003c/a\u003e.\n\u003c/p\u003e\n\n## About\n\n`croc` is a tool that allows any two computers to simply and securely transfer files and folders. AFAIK, *croc* is the only CLI file-transfer tool that does **all** of the following:\n\n- Allows **any two computers** to transfer data (using a relay)\n- Provides **end-to-end encryption** (using PAKE)\n- Enables easy **cross-platform** transfers (Windows, Linux, Mac)\n- Allows **multiple file** transfers\n- Allows **resuming transfers** that are interrupted\n- No need for local server or port-forwarding\n- **IPv6-first** with IPv4 fallback\n- Can **use a proxy**, like Tor\n\nFor more information about `croc`, see [my blog post](https://schollz.com/tinker/croc6/) or read a [recent interview I did](https://console.substack.com/p/console-91).\n\n![Example](src/install/customization.gif)\n\n## Install\n\nYou can download [the latest release for your system](https://github.com/schollz/croc/releases/latest), or install a release from the command-line:\n\n```bash\ncurl https://getcroc.schollz.com | bash\n```\n\n### On macOS\n\nUsing [Homebrew](https://brew.sh/):\n\n```bash\nbrew install croc\n```\n\nUsing [MacPorts](https://www.macports.org/):\n\n```bash\nsudo port selfupdate\nsudo port install croc\n```\n\n### On Windows\n\nYou can install the latest release with [Scoop](https://scoop.sh/), [Chocolatey](https://chocolatey.org/), or [Winget](https://learn.microsoft.com/windows/package-manager/):\n\n```bash\nscoop install croc\n```\n\n```bash\nchoco install croc\n```\n\n```bash\nwinget install schollz.croc\n```\n\n### On Unix\n\nYou can install the latest release with [Nix](https://nixos.org/):\n\n```bash\nnix-env -i croc\n```\n\n### On Alpine Linux\n\nFirst, install dependencies:\n\n```bash\napk add bash coreutils\nwget -qO- https://getcroc.schollz.com | bash\n```\n\n### On Arch Linux\n\nInstall with `pacman`:\n\n```bash\npacman -S croc\n```\n\n### On Fedora\n\nInstall with `dnf`:\n\n```bash\ndnf install croc\n```\n\n### On Gentoo\n\nInstall with `portage`:\n\n```bash\nemerge net-misc/croc\n```\n\n### On Termux\n\nInstall with `pkg`:\n\n```bash\npkg install croc\n```\n\n### On FreeBSD\n\nInstall with `pkg`:\n\n```bash\npkg install croc\n```\n\n### On Linux, macOS, and Windows via Conda\n\nYou can install from [conda-forge](https://github.com/conda-forge/croc-feedstock) globally with [`pixi`](https://pixi.sh/):\n\n```bash\npixi global install croc\n```\n\nOr install into a particular environment with [`conda`](https://docs.conda.io/projects/conda/):\n\n```bash\nconda install --channel conda-forge croc\n```\n\n### Build from Source\n\nIf you prefer, you can [install Go](https://go.dev/dl/) and build from source (requires Go 1.22+):\n\n```bash\ngo install github.com/schollz/croc/v10@latest\n```\n\n### On Android\n\nThere is a 3rd-party F-Droid app [available to download](https://f-droid.org/packages/com.github.howeyc.crocgui/).\n\n## Usage\n\nTo send a file, simply do:\n\n```bash\n$ croc send [file(s)-or-folder]\nSending 'file-or-folder' (X MB)\nCode is: code-phrase\n```\n\nThen, to receive the file (or folder) on another computer, run:\n\n```bash\ncroc code-phrase\n```\n\nThe code phrase is used to establish password-authenticated key agreement ([PAKE](https://en.wikipedia.org/wiki/Password-authenticated_key_agreement)) which generates a secret key for the sender and recipient to use for end-to-end encryption.\n\n### Customizations \u0026 Options\n\n#### Using `croc` on Linux or macOS\n\nOn Linux and macOS, the sending and receiving process is slightly different to avoid [leaking the secret via the process name](https://nvd.nist.gov/vuln/detail/CVE-2023-43621). You will need to run `croc` with the secret as an environment variable. For example, to receive with the secret `***`:\n\n```bash\nCROC_SECRET=*** croc\n```\n\nFor single-user systems, the default behavior can be permanently enabled by running:\n\n```bash\ncroc --classic\n```\n\n#### Custom Code Phrase\n\nYou can send with your own code phrase (must be more than 6 characters):\n\n```bash\ncroc send --code [code-phrase] [file(s)-or-folder]\n```\n\n#### Allow Overwriting Without Prompt\n\nTo automatically overwrite files without prompting, use the `--overwrite` flag:\n\n```bash\ncroc --yes --overwrite \u003ccode\u003e\n```\n\n#### Excluding Folders\n\nTo exclude folders from being sent, use the `--exclude` flag with comma-delimited exclusions:\n\n```bash\ncroc send --exclude \"node_modules,.venv\" [folder]\n```\n\n#### Use Pipes - stdin and stdout\n\nYou can pipe to `croc`:\n\n```bash\ncat [filename] | croc send\n```\n\nTo receive the file to `stdout`, you can use:\n\n```bash\ncroc --yes [code-phrase] \u003e out\n```\n\n#### Send Text\n\nTo send URLs or short text, use:\n\n```bash\ncroc send --text \"hello world\"\n```\n\n#### Use a Proxy\n\nYou can send files via a proxy by adding `--socks5`:\n\n```bash\ncroc --socks5 \"127.0.0.1:9050\" send SOMEFILE\n```\n\n#### Change Encryption Curve\n\nTo choose a different elliptic curve for encryption, use the `--curve` flag:\n\n```bash\ncroc --curve p521 \u003ccodephrase\u003e\n```\n\n#### Change Hash Algorithm\n\nFor faster hashing, use the `imohash` algorithm:\n\n```bash\ncroc send --hash imohash SOMEFILE\n```\n\n#### Self-host Relay\n\nYou can run your own relay:\n\n```bash\ncroc relay\n```\n\nBy default, it uses TCP ports 9009-9013. You can customize the ports (e.g., `croc relay --ports 1111,1112`), but at least **2** ports are required.\n\nTo send files using your relay:\n\n```bash\ncroc --relay \"myrelay.example.com:9009\" send [filename]\n```\n\n#### Self-host Relay with Docker\n\nYou can also run a relay with Docker:\n\n```bash\ndocker run -d -p 9009-9013:9009-9013 -e CROC_PASS='YOURPASSWORD' schollz/croc\n```\n\nTo send files using your custom relay:\n\n```bash\ncroc --pass YOURPASSWORD --relay \"myreal.example.com:9009\" send [filename]\n```\n\n## Acknowledgements\n\n`croc` has evolved through many iterations, and I am thankful for the contributions! Special thanks to:\n\n- [@warner](https://github.com/warner) for the [idea](https://github.com/magic-wormhole/magic-wormhole)\n- [@tscholl2](https://github.com/tscholl2) for the [encryption gists](https://gist.github.com/tscholl2/dc7dc15dc132ea70a98e8542fefffa28)\n- [@skorokithakis](https://github.com/skorokithakis) for [proxying two connections](https://www.stavros.io/posts/proxying-two-connections-go/)\n\nAnd many more!\n","funding_links":["https://github.com/sponsors/schollz"],"categories":["Go","Popular","HarmonyOS","开源类库","Misc","软件包","Software Packages","File Sharing and Synchronization","File Management and Sharing","Applications","Uncategorized","golang","Open source library","Linux生态圈用户工具","Productivity Tools","Go (531)","网络服务","Tools","CLI 项目","Other Software","Other","Programming Languages","Files and Directories","Go Tools","\u003ca name=\"transfer\"\u003e\u003c/a\u003eData transfer","Projects","工具集","File Sharing","Command line - Linux","Go 工具","File Transfer \u0026 Sync"],"sub_categories":["Windows Manager","网络","其他软件库和软件包","Other Software","Snippets Manager","OS Encryption","Sharing Files","Uncategorized","The Internet","File Transfer","网络服务_其他","Go","其他软件","File Sync/Sharing","Data Storage and Sharing","小工具集","Security","Learning resources"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschollz%2Fcroc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschollz%2Fcroc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschollz%2Fcroc/lists"}