okr
Reproducible R source context for coding agents.
Installed R packages are poor context for coding agents. R code is packed into
binary lazy load databases (.rdb/.rdx), while compiled package src/ trees
are stripped at installation time. okr vendors exact source trees into a
greppable synthetic monorepo with recorded integrity digests.
Install
With Homebrew:
brew install nanxstats/tap/okr
Or with Cargo:
cargo install okr
Quickstart
okr init
okr add ggsci
okr sync
# Point your coding agent at deps-src/
okr init selects and writes the latest available exact dated CRAN snapshot,
so a bare CRAN package can be added immediately. It checks from the current UTC
date backward and keeps the successful package index in the download cache.
okr sync writes okr.lock, deps-src/_manifest.json, and
deps-src/_manifest.md. Repeating it with an intact tree is a no-op.
Evaluation workflow
Build the source context online, then use the integrity gate in an evaluation sandbox:
okr sync
okr verify --strict --json
verify always treats vendor-tree drift as an exit-4 failure. --strict also
requires the read-only installed-library coherence check when R is available.
Use okr sync --offline to rebuild entirely from the local content-addressed
cache. The compact lock records an acquisition-artifact digest and one aggregate
digest for each post-pruning source tree; verification recomputes the latter
from every vendored file.
GitHub authentication
okr uses the gh CLI when present and authenticated; otherwise it uses
GITHUB_TOKEN; otherwise it uses anonymous GitHub API access with low rate
limits. Private GitHub repositories use the same tiers before falling back to
git. GitHub Enterprise and self-hosted GitLab, Codeberg, SSH, and other
git:: remotes use your existing git credential helpers and SSH configuration;
okr never stores credentials.
Scope
okr focuses on composable source context artifacts and verification.
okr installs nothing: rig, pak, renv, and rv do that.
It also does not infer OS packages or generate Dockerfiles.
Use renv::sysreqs() or pak::pkg_sysreqs() for system requirements and
renv's Docker workflow for container construction.
License
MIT