{"id":13540923,"url":"https://github.com/tom-james-watson/dat-cp","last_synced_at":"2025-04-02T08:30:54.326Z","repository":{"id":33428757,"uuid":"155865162","full_name":"tom-james-watson/dat-cp","owner":"tom-james-watson","description":"dcp | Dat Copy - remote file copy, powered by the Dat protocol","archived":true,"fork":false,"pushed_at":"2023-11-29T07:23:32.000Z","size":4815,"stargazers_count":317,"open_issues_count":10,"forks_count":21,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-07T16:17:08.054Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/tom-james-watson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-11-02T12:48:47.000Z","updated_at":"2024-12-11T12:37:24.000Z","dependencies_parsed_at":"2023-10-17T01:36:07.066Z","dependency_job_id":"d409c391-a642-4463-b1dd-b097c3019cb9","html_url":"https://github.com/tom-james-watson/dat-cp","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-james-watson%2Fdat-cp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-james-watson%2Fdat-cp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-james-watson%2Fdat-cp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-james-watson%2Fdat-cp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tom-james-watson","download_url":"https://codeload.github.com/tom-james-watson/dat-cp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246781876,"owners_count":20832924,"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":[],"created_at":"2024-08-01T10:00:36.063Z","updated_at":"2025-04-02T08:30:53.210Z","avatar_url":"https://github.com/tom-james-watson.png","language":"JavaScript","funding_links":[],"categories":["File Management and Sharing","JavaScript","Dat Applications","others"],"sub_categories":["OS Encryption","Community Applications"],"readme":"`dcp` - Dat Copy\n========\n\n\u003e Remote file copy, powered by the Dat protocol.\n\n[![CircleCI branch](https://img.shields.io/circleci/project/github/tom-james-watson/dat-cp/master.svg)](https://circleci.com/gh/tom-james-watson/workflows/dat-cp/tree/master)\n[![npm](https://img.shields.io/npm/v/dat-cp.svg)](https://www.npmjs.com/package/dat-cp)\n[![npm](https://img.shields.io/node/v/dat-cp.svg)](https://www.npmjs.com/package/dat-cp)\n[![NpmLicense](https://img.shields.io/npm/l/dat-cp.svg)](https://www.npmjs.com/package/dat-cp)\n\n`dcp` copies files between hosts on a network using the peer-to-peer [Dat network](https://datproject.org/). `dcp` can be seen as an alternative to tools like `scp`, removing the need to configure SSH access between hosts. This lets you transfer files between two remote hosts, without you needing to worry about the specifics of how said hosts reach each other and regardless of whether hosts are behind NATs.\n\n`dcp` requires zero configuration and is secure, [fast](#Performance), and peer-to-peer.\n\n**WARNING - this is not production-ready software. Use at your own risk**\n\n### Contents\n\n- [How dcp works](#how-dcp-works)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Development](#development)\n\n### Example\n\n![dcp example](./images/example.gif)\n\n### Use cases\n\n* Send files to multiple colleagues - just send the generated public key via chat and they can receive the files on their machine.\n* Sync files between two physical computers on your local network, without needing to set up SSH access.\n* Easily send files to a friend without needing to create a zip and upload it the cloud.\n* Copy files to a remote server when you have shell access but not SSH, for example on a kubernetes pod.\n* Share files between linux/macOS and Windows, which isn't exactly known for great SSH support.\n\n## How `dcp` works\n\n`dcp` will create a dat archive for a specified set of files or directories and, using the generated public key, lets you download said archive from other hosts. Any data shared over the network is encrypted using the public key of the archive, meaning data access is limited to those who have access to said key. For more information on how Dat works, you can browse [the docs](https://docs.datproject.org/) or [read their whitepaper](https://github.com/datproject/docs/blob/master/papers/dat-paper.pdf).\n\n### Advantages over plain [dat](https://github.com/datproject/dat)\n\n`dcp` is designed to have an API that is more reminiscent of `scp` and `rsync`. The standard cli `dat` program requires the additional mental overhead of understanding how the underlying Dat protocol works. `dat` forces you to share a single whole folder, whilst with `dcp` you can copy an arbitrary set of paths. `dat` also pollutes the filesystem with metadata files, whereas with `dcp` these are kept in-memory instead.\n\n### Performance\n\nYou can expect `dcp` to transfer at a similar speed to both `rsync` and `scp`.\n\nHere's a benchmark for moving a 396.12MB file from my personal computer to a remote server over my 50mpbs connection.\n\n| Method | Time  |\n|--------|-------|\n| rsync  | 1m07s |\n| scp    | 1m07s |\n| dcp    | 1m10s |\n\n## Installation\n\n```\nnpm i -g dat-cp\n```\n\n### Installing without npm\n\nAlternatively, packaged binaries are available on [the releases page](https://github.com/tom-james-watson/dat-cp/releases). These bundle all dependencies into a single standalone binary.\n\nSimply extract the zip and move the `dcp[.exe]` binary to a folder in your path, e.g. `/usr/local/bin`.\n\n## Usage\n\n```\nUsage: dcp [options] {files ... | key}\n\nDat Copy - remote file copy, powered by the dat protocol.\n\nOptions:\n  -V, --version    output the version number\n  -r, --recursive  recursively copy directories\n  -n, --dry-run    show what files would have been copied\n  --skip-prompt    automatically download without a prompt\n  -v, --verbose    verbose mode - prints extra debugging messages\n  -h, --help       output usage information\n\nExample:\n\n    Send files from host A:\n\n        \u003e dcp foo.txt bar.txt\n\n    Receive files on host B:\n\n        \u003e dcp \u003cgenerated public key\u003e\n```\n\n### Sending files\n\nPass an arbitrary set of files or directories to `dcp` to be copied. Copy the generated public key and use it to receive the files on a different host.\n\n```bash\n\u003e dcp [-r] [-n] [-v] files ...\n```\n\n* Use `-n`/`--dry-run` to see what files will be sent\n* Use `-r`/`--recursive` to recursively copy files within directories\n* Use `-v`/`--verbose` to print extra debugging information\n\n### Receiving files\n\nInvoke `dcp` with the generated public key to receive the copied files.\n\n```bash\n\u003e dcp [-n] [-v] [--skip-prompt] \u003cgenerated public key\u003e\n```\n\n* Use `-n`/`--dry-run` to see what files will be received\n* Use `-v`/`--verbose` to print extra debugging information\n* Use `--skip-prompt` to skip the download prompt\n\n## Development\n\nInstall dependencies:\n\n```\nnpm i\n```\n\nRun the tests:\n\n```\nnpm t\n```\n\nTest the CLI executable\n\n```\nnpm run cli -- foo.txt -v\n```\n\n*Note the `--` preceding the arguments.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-james-watson%2Fdat-cp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftom-james-watson%2Fdat-cp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-james-watson%2Fdat-cp/lists"}