{"id":20481389,"url":"https://github.com/newtoallofthis123/ynk","last_synced_at":"2025-06-30T19:04:54.809Z","repository":{"id":217368940,"uuid":"743675194","full_name":"newtoallofthis123/ynk","owner":"newtoallofthis123","description":"A Better copy and paste for the terminal i.e cp and mv on steriods","archived":false,"fork":false,"pushed_at":"2025-04-11T16:08:07.000Z","size":324,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-21T23:03:18.492Z","etag":null,"topics":["cli","copy-paste","cp","hacktoberfest","hacktoberfest2024","rust-cli","rust-tool"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/ynk","language":"Rust","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/newtoallofthis123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2024-01-15T18:39:00.000Z","updated_at":"2025-04-11T16:08:10.000Z","dependencies_parsed_at":"2025-04-13T14:11:07.658Z","dependency_job_id":null,"html_url":"https://github.com/newtoallofthis123/ynk","commit_stats":null,"previous_names":["newtoallofthis123/ynk"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/newtoallofthis123/ynk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newtoallofthis123%2Fynk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newtoallofthis123%2Fynk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newtoallofthis123%2Fynk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newtoallofthis123%2Fynk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newtoallofthis123","download_url":"https://codeload.github.com/newtoallofthis123/ynk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newtoallofthis123%2Fynk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262834787,"owners_count":23371849,"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","copy-paste","cp","hacktoberfest","hacktoberfest2024","rust-cli","rust-tool"],"created_at":"2024-11-15T16:08:05.289Z","updated_at":"2025-06-30T19:04:54.784Z","avatar_url":"https://github.com/newtoallofthis123.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Y(a)NK\n\nYank is the superior way to copy and paste files and large directories in the command line.\n\nIt allows you to have a workflow similar to copy and pasting muliple files and folders in GUI file managers in the terminal.\nIt does this by maintaining a persistant store that records file metadata when you add to it to create entries.\nThese entries can then be pasted at will using [queries](#queries), [ranges](#ranges) or just file names.\n\nMoreover, ynk has the ability to exclude [hidden files](#hiddenfiles) and also respect the [.gitignore](#gitignore) file.\nThis combined with ynk's use of several parallel threads for the paste operation makes it ideal for pasting multiple large directories\ntogether.\n\nNot to mention ynk is *BLAZINGLY FAST*, like pasting 30,000 files in 1.4 seconds fast.\n\n![Pasting Files](./assets/paste.png)\n\nA video is worth a thousand pictures and about 10^6 words so, click on the screenshot above to watch the video for more details.\n\n## Installing\n\nYnk is written in rust and is fully portable across Windows, MacOs and Linux.\nHowever, ynk is only tested on Linux.\nMoreover ynk comes prebuilt with libsqlite which is the database used for the store.\n\n### Using Rust: Recommended\n\nThe minimium version of rust you would need for this is `v.1.71`.\nYnk is listed on cargo and you can install it on your system by the following command:\n\n```bash\ncargo install ynk --locked\n```\n\nThis installs ynk prebuilt with libsqlite to the system.\n\n### Using Git\n\nYou can also build ynk yourself on your machine.\nTo do this you can use the following commands:\n\n```bash\ngit clone https://github.com/newtoallofthis123/ynk\ncd ynk\ncargo install --path .\n```\n\nThis installs ynk using rust. \n\n### Binaries coming soon!\n\n## Shell Completions\n\nYnk supports shell completions for bash, zsh, fish and powershell.\nYou can generate the respective completion files using the `ynk completions SHELL` command.\nThis can be them redirected to the `source` command.\n\n```bash\nynk completions SHELL | source\n```\n\nExample for fish:\n\n```bash\n# In your fish config file\nynk completions fish | source\n```\n\n## Config\n\nYnk writes the config to the `XDG_CONFIG_HOME/ynk/config.toml`. The default config is as follows:\n\n```bash\nstrict = false\nignore = true\nall = false\noverwrite = false\ndelete = false\nprompt = true\nshow_splash = true\ncalculate_size = true\npreserve_structure = false\n```\n\nFor more information refer to the [Config Options](Usuage.md#config-options)\n\n## Usuage\n\nA shorter version of this can be viewed by using the `ynk --help` command and indivisual commands can be viewed by using `ynk help [COMMAND]`.\n\nPrimarily, ynk can be thought of as a clipboard that stores file metadata to later paste.\n\nThis means that unless you use either the `paste` or the `pop` option, no change whatsoever is made to the file system. Moreover, ynk does not ever modify the original file. It merely copies it.\n\nThe store files metadata in a format similar to below\n\n| id  | name      | path                 | accessed_at         |\n| --- | --------- | -------------------- | ------------------- |\n| 1   | README.md | /home/user/README.md | 2020-01-01 00:00:00 |\n| 2   | portfolio | /home/user/portfolio | 2020-03-01 00:00:00 |\n\nA mini version of this is as below:\n\n```bash\nCopy paste files in the terminal\n\nUsage: ynk [OPTIONS] [COMMAND]\n\nCommands:\n  list         List the entires in the store\n  add          Add entries to the store\n  delete       Delete entries from the ynk store\n  pop          Pop the last entry in the ynk store\n  clear        Clear all entries from the ynk store\n  paste        Paste entries from the ynk store\n  completions  Generate and write completions\n  help         Print this message or the help of the given subcommand(s)\n\nOptions:\n  -n, --noignore  Don't respect the .gitignore\n  -y, --yes       Prompt yes to all prompts\n  -a, --all       Also include hidden files in discovery\n  -h, --help      Print help\n  -V, --version   Print version\n```\n\nFor more information on each command and their respective flag, refer [Usuage](Usuage.md)\n\n## How it works\n\nWhen you `add` an entry to ynk, it stores it's metadata, absolute path in `~/.ynk/store.db`.\nThis is a sqlite3 database that ynk then uses to query information from.\nWhen you `paste` or `pop`, ynk merely reads the file metadata from the store and uses an optimized\ndirectory walking algorithm to discover files and uses multiple `tokio` threads for the copy and pasting operation.\nThis makes ynk very fast. Moreover, it also shows you a clean progress bar while it is actually copy pasting the files and folders. \n\n\u003e 29,000 files in about 1.5 seconds.\n\n## Stuff Ynk can do that `cp` can't\n\n- It can respect your `.gitignore` file. So if you have a file or directory that is ignored by git, it won't be copied over.\n- Have a consistent store of files and directories that you copy over. You can list them, delete them, and paste them whenever you want.\n- Essentially, it's a clipboard for your files and directories.\n- It's fast. It uses multiple threads to do IO operations, so it's very fast.\n- Especially useful for handling very large projects with dependencies, think `node_modules` or `target` directories.\n- You can essentially combine multiple `cp` commands into one. You can copy over multiple files and directories, and then paste them all at once, in fact this is the recommended way to use ynk.\n- Hey, it's Rust. So it's fast and safe.\n- Essentially, it's a GUI like feature in the terminal.\n\n## What about the pasting?\n\nPasting is at the core of this tool. The indexed files and directories are stored in a database. So when you paste, it will read the file's exact path from the database, and then read the file, and then write it to the current directory.\nIf the path it is reading from is invalid, it will throw an error.\n\nThe IO operation itself is powered by multiple threads, almost like a thread pool. So it's very fast. Every file IO is done in a separate thread. So it's very fast.\nThe Reading and writing of the files is done in chunks powered by `tokio`'s fs module, maintaining safety and speed.\n\nThe file tree is walked using `walkdir`, while making sure that it respects the `.gitignore` file. All of this is done parallely in a thread pool with a in memory static cache.\n\n## License\n\nYnk is licensed under the [MIT LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewtoallofthis123%2Fynk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewtoallofthis123%2Fynk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewtoallofthis123%2Fynk/lists"}