{"id":50308088,"url":"https://github.com/albersonmiranda/rpkg-rs","last_synced_at":"2026-07-02T10:32:10.270Z","repository":{"id":311090939,"uuid":"1041817914","full_name":"albersonmiranda/rpkg-rs","owner":"albersonmiranda","description":"A lightweight CLI tool to effortlessly install R packages through the terminal.","archived":false,"fork":false,"pushed_at":"2026-05-17T15:21:20.000Z","size":37,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-28T18:24:51.771Z","etag":null,"topics":["cli","r","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/rpkg","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/albersonmiranda.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-21T04:03:34.000Z","updated_at":"2026-05-20T03:26:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"3cc6c3b5-a6e8-439f-9e7c-52f2bccd355a","html_url":"https://github.com/albersonmiranda/rpkg-rs","commit_stats":null,"previous_names":["albersonmiranda/rip","albersonmiranda/rpkg-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/albersonmiranda/rpkg-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albersonmiranda%2Frpkg-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albersonmiranda%2Frpkg-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albersonmiranda%2Frpkg-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albersonmiranda%2Frpkg-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albersonmiranda","download_url":"https://codeload.github.com/albersonmiranda/rpkg-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albersonmiranda%2Frpkg-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35043933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","r","rust"],"created_at":"2026-05-28T18:01:49.101Z","updated_at":"2026-07-02T10:32:10.243Z","avatar_url":"https://github.com/albersonmiranda.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rpkg\n\n`rpkg` (R Package) is a lightweight CLI wrapper around `Rscript` written in [Rust](https://www.rust-lang.org/) that simplifies installing R packages through terminal commands.\n\n## Features\n\n- Install single or multiple packages in one command\n- Default CRAN mirror set to `https://cloud.r-project.org/`\n- Optionally select CRAN mirrors by country with fuzzy matching\n- Optionally set custom URLs that takes precedence over CRAN url (e.g., R-Universe)\n- Interactive numbered repository selection when there are multiple country matches\n- Auto-selection of the best match when stdin is not a terminal (e.g. CI/scripts)\n- Install from explicit git source flags (Github, Gitlab, Codeberg, Bitbucket)\n- Optionally install to a library path with `-l` / `--library`\n- Automatic fallback to personal library when the system library is not writable\n\n## Prerequisites\n\n- Rust toolchain (e.g., via [rustup](https://rustup.rs/))\n- R with `Rscript` available on your `PATH`\n\n## Installation\n\n```bash\ncargo install rpkg\n```\n\n## Usage\n\n```text\nrpkg [OPTIONS] \u003cPACKAGE\u003e [\u003cPACKAGE\u003e ...]\n```\n\nExamples:\n\n```bash\n# Install a single package from CRAN\nrpkg ggplot2\n\n# Install multiple CRAN packages at once\nrpkg ggplot2 fio mlr3\n\n# Select a CRAN mirror by country (fuzzy matched), then select one between matches\nrpkg ggplot2 --country brazil\n\n# Set custom URL (e.g., R-Universe)\nrpkg fio --url https://albersonmiranda.r-universe.dev -c brazil\n\n# Install into a specific library path\nrpkg ggplot2 -l /path/to/R/library\n\n# Update all installed packages before installing new ones\n# (this updates all installed packages THEN installs ggplot)\nrpkg ggplot2 --update\n\n# Update + install with specific country mirror\nrpkg ggplot2 --country brazil --update\n\n# Update + install using custom library path\nrpkg ggplot2 --library /path/to/R/library --update\n\n# Only update all installed packages\nrpkg --update\n```\n\n\u003e [!IMPORTANT]\n\u003e  **Mirror resolution precedence**\n\u003e\n\u003e 1. If `--country` is set, `rpkg` retrieves CRAN mirrors through R and asks for selection when needed.\n\u003e 2. Else `rpkg` falls back to `https://cloud.r-project.org/`.\n\u003e 3. If one or many `--url \u003cURL\u003e` is set, then they are appended before CRAN's (`repos = c(\u003cURL\u003e, \u003cURL\u003e, ..., \u003cCRAN mirror\u003e)`)\n\n```bash\n# Install from GitHub source flag\nrpkg --github=albersonmiranda/fio\n\n# Mix multiple explicit git sources in one command (no flag means CRAN)\n# Here, ggplot2 and dplyr are installing from CRAN (using a brazilian mirror),\n# while emo is installing from Github and raven from Gitlab\nrpkg ggplot2 dplyr -c brazil --github=hadley/emo --gitlab=r-packages/raven\n```\n\n\u003e [!IMPORTANT]\n\u003e **Git source behavior**\n\u003e 1. Positional packages are always installed from CRAN.\n\u003e 2. Git installs happen only through explicit source flags (`--github`, `--gitlab`, `--bitbucket`, `--codeberg`).\n\u003e 3. Source flag values must be in `OWNER/REPO` format.\n\u003e 4. Each source flag can be repeated to install multiple repositories.\n\nOptions:\n\n```text\n-c, --country \u003cCOUNTRY\u003e         Country query used for CRAN mirror fuzzy matching\n-l, --library \u003cLIBRARY\u003e         Path to install package library (optional)\n--url \u003cURL\u003e                     Additional custom repository URL (repeatable)\n--update                        Update all installed packages before installing\n--github \u003cOWNER/REPO\u003e           Install from GitHub (repeatable)\n--gitlab \u003cOWNER/REPO\u003e           Install from GitLab (repeatable)\n--bitbucket \u003cOWNER/REPO\u003e        Install from Bitbucket (repeatable)\n--codeberg \u003cOWNER/REPO\u003e         Install from Codeberg (repeatable)\n-h, --help                      Print help information\n-V, --version                   Print version information\n```\n\n## Library path behavior\n\nWhen no `--library` is specified, `rpkg` checks if the default R library (`.libPaths()[1]`) is writable. If it isn't — which is common on Linux/macOS where the system library is owned by root — `rpkg` automatically:\n\n1. Reads the `R_LIBS_USER` environment variable (set by R, typically `~/R/\u003carch\u003e/\u003cversion\u003e/`)\n2. Creates the directory if it doesn't exist\n3. Prepends it to `.libPaths()` so packages install there and passes it to `update.packages()` when `--update` is used\n\nThis mirrors what R does in an interactive session when it prompts _\"Would you like to use a personal library instead?\"_.\n\n## Uninstall\nIf installed via Cargo:\n\n```bash\ncargo uninstall rpkg\n```\n\n## Contributing\n\nContributions, issues, and feature requests are welcome! Feel free to open a PR or issue.\n\n## Changelog\n\nSee [NEWS.md](NEWS.md) for a detailed changelog.\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbersonmiranda%2Frpkg-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbersonmiranda%2Frpkg-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbersonmiranda%2Frpkg-rs/lists"}