{"id":25650031,"url":"https://github.com/itsjunetime/cargo-restore","last_synced_at":"2025-04-15T18:32:37.525Z","repository":{"id":224583285,"uuid":"743736598","full_name":"itsjunetime/cargo-restore","owner":"itsjunetime","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-04T19:32:14.000Z","size":222,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T23:34:29.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itsjunetime.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-01-15T21:54:07.000Z","updated_at":"2024-12-04T19:32:18.000Z","dependencies_parsed_at":"2024-02-26T18:48:24.089Z","dependency_job_id":"2baa7c58-348e-4305-80ee-fe7a7a46e3c4","html_url":"https://github.com/itsjunetime/cargo-restore","commit_stats":null,"previous_names":["itsjunetime/cargo-restore"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsjunetime%2Fcargo-restore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsjunetime%2Fcargo-restore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsjunetime%2Fcargo-restore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsjunetime%2Fcargo-restore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsjunetime","download_url":"https://codeload.github.com/itsjunetime/cargo-restore/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249129006,"owners_count":21217266,"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":"2025-02-23T14:37:30.386Z","updated_at":"2025-04-15T18:32:37.508Z","avatar_url":"https://github.com/itsjunetime.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `cargo-restore`\n\nA cargo subcommand to automatically install all packages listed in a `.crates2.json` file (normally located in `~/.cargo`)\n\n## Usage\n\n```\nUsage: cargo-restore [OPTIONS] [COMMAND]\n\nCommands:\n  restore\n  help     Print this message or the help of the given subcommand(s)\n\nOptions:\n  -c, --crate-file \u003cCRATES_FILE\u003e  The file to parse as the .crates2.json if you don't want to use the default one\n  -t, --fix-target                Change the target of all to-be-installed packges to match this device's target if it's\n                                  different\n  -i, --install-latest            Whether to install the latest version available (true) or install the version in the\n                                  lockfile (false, default)\n  -f, --force-all                 Whether to force (re)installation of al packages listed in .crates2.json, even if we can\n                                  detect that all their binaries are already correctly installed\n  -v, --verbose                   Whether to enable verbose output\n  -q, --quick-fail                If true, `cargo-restore` will exit with an error code as soon as any package fails to\n                                  install\n  -h, --help                      Print help\n  -V, --version                   Print version\n```\n\nWhen invoked without arguments, `cargo-restore` will automatically read all packages from `~/.cargo/.crates2.json` (or wherever else your cargo config defines to be root) and attempt to install them all. If any fail to install, it will print an error message and continue with the next on the list.\n\n## Installation\n```bash\ncargo install --git https://github.com/itsjunetime/cargo-restore.git\n```\n\n## Caveats\nThis is designed to be used with another dotfile-managing system, such as yadm, so that you could simply run `cargo install cargo-restore \u0026\u0026 cargo restore` to install all packages you want from cargo on your system. This requires reading from `~/.cargo/.crates2.json` by default, but that can lead to some confusion due to the fact that `cargo-restore` will, as a side-effect of using cargo to invoke installs, overwrite this file after each install.\n\nThis means that if you invoke `cargo restore`, then a crate fails to build, invoking `cargo restore` again may inform you that all crates are installed correctly, since `~/.cargo/.crates2.json` was overwritten by the installation failure to not include that crate.\n\nDue to this issue, `cargo-restore` supports reading from a different file from `~/.cargo/.crates2.json` (but which must still be in the same format) to generate the package list to install. One can then use other tools at their disposal to keep this other file in-sync with cargo's `.crates2.json` upon successful installations so that dotfile syncing of cargo packages doesn't need to incur extra overhead.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsjunetime%2Fcargo-restore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsjunetime%2Fcargo-restore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsjunetime%2Fcargo-restore/lists"}