croc — Send Files and Folders Securely Between Any Two Computers
croc is a simple CLI for sending files between computers. Run `croc send file.zip` on one side; croc prints a code; run `croc <code>` on the other side — end-to-end encrypted, NAT-traversing, zero setup.
先审查再安装
这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。
npx -y tokrepo@latest install 06be4236-3859-11f1-9bc6-00163e2b0d79 --target codex先 dry-run,确认写入项后再运行此命令。
What it is
croc is a simple CLI tool for sending files and folders between any two computers. Run croc send file.zip on one side, croc prints a code phrase, and run croc <code> on the other side. The transfer is end-to-end encrypted, traverses NATs and firewalls automatically, and requires zero configuration or account setup.
croc targets developers, sysadmins, and anyone who needs to transfer files between machines without setting up SSH, configuring cloud storage, or using email attachments. It works across operating systems and network configurations.
Why it saves time or tokens
File transfer between computers usually involves SCP (requires SSH setup), cloud storage (requires accounts), or USB drives (requires physical access). croc eliminates all of this with a single command. The relay server handles NAT traversal, so it works even when both machines are behind firewalls. For AI-assisted workflows where generated files need to move between environments, croc provides the simplest transfer method.
How to use
- Install croc:
brew install crocorcurl https://getcroc.schollz.com | bash - Send a file:
croc send myfile.zip - On the receiving machine:
croc <code-phrase>using the code shown by the sender
Example
# Sender
$ croc send presentation.pdf
Sending 'presentation.pdf' (2.4 MB)
Code is: castle-gamma-piano
On the other computer run:
croc castle-gamma-piano
# Receiver
$ croc castle-gamma-piano
Accept 'presentation.pdf' (2.4 MB)? (y/n) y
Receiving...
presentation.pdf 100% |████████████| (2.4/2.4 MB, 8.2 MB/s)
| Feature | Description |
|---|---|
| E2E encryption | PAKE-based key exchange |
| NAT traversal | Works behind firewalls |
| Cross-platform | macOS, Linux, Windows |
| Resume | Continue interrupted transfers |
| Folders | Send entire directories |
Related on TokRepo
- AI tools for devops — developer and sysadmin utilities on TokRepo
- AI tools for self-hosted — self-hosted tools and infrastructure
Common pitfalls
- The default relay server is public; for sensitive files, self-host your own relay with
croc relay - Very large transfers (multi-GB) may be slow through the public relay; direct transfers or self-hosted relays improve speed
- The code phrase expires after a configurable timeout; the receiver must enter it before the sender's session times out
常见问题
Yes. croc uses PAKE (Password Authenticated Key Exchange) to establish an encrypted channel using the code phrase as the shared secret. The relay server cannot read the file contents. End-to-end encryption ensures only the sender and receiver with the correct code can access the data.
Yes. Run croc relay on any server with a public IP. Configure clients to use your relay with the --relay flag. Self-hosting gives you control over the relay infrastructure and avoids sending data through the public relay server.
Yes. croc runs on macOS, Linux, Windows, FreeBSD, and Android (via Termux). You can send files from a Mac to a Windows machine or between any combination of supported platforms. The protocol is OS-agnostic.
Yes. Use croc send myfolder/ to send an entire directory. croc compresses the folder, transfers it, and decompresses it on the receiving end. The directory structure is preserved.
croc supports resumable transfers. If the connection drops during a large file transfer, re-run the same croc command with the same code and it resumes from where it left off rather than starting over.
引用来源 (3)
- croc GitHub— croc is a CLI for secure file transfer
- croc Security— PAKE-based key exchange for end-to-end encryption
- croc Relay— NAT traversal techniques for peer-to-peer connections
讨论
相关资产
magic-wormhole — Get Things from One Computer to Another, Safely
magic-wormhole sends files and text between computers using short human-readable codes like "7-crossover-clockwork". End-to-end encrypted via PAKE, relay-free when possible, and the original inspiration for croc and friends.
React Email — Build and Send Emails Using React
React Email lets developers create beautiful HTML emails with React components, preview in browser, and send via Resend, Nodemailer, or any ESP.
entr — Run Arbitrary Commands When Files Change
entr is a tiny, dependency-free event notify-based tool for running commands when any file in a list changes, perfect for live-reload workflows with tests, linters, and builds.
q — Run SQL Directly on CSV, TSV, and Log Files
q (harelba/q) runs full SQLite-compatible SQL queries against CSVs, TSVs, and any delimited text file on disk — turning ad-hoc log digging into a one-line SQL statement.