Skip to main content

Crate oy

Crate oy 

Source
Expand description

§oy

oy adds repeatable repository audit and review workflows to opencode. Its local MCP server provides deterministic repository collection, ordered chunks, target-diff input, and normalized Markdown/SARIF reports. opencode remains responsible for model execution, providers, sessions, permissions, and general coding tools.

§Start with the CLI

The command-line interface is the supported automation surface:

oy setup --dry-run       # preview generated opencode integration
oy setup                 # install the global integration
oy audit                 # write ISSUES.md
oy review main           # write REVIEW.md for git diff main
oy enhance <finding-id>  # remediate one reported finding

See the getting-started guide, workflow guide, and CLI/MCP reference for the user-facing contract.

§Determinism boundary

Input collection, ordering, limits, and report rendering are deterministic. Findings are produced by the model selected in opencode and are not deterministic. The collector also has documented exclusions; “all chunks” does not mean every byte in a repository.

§Rust API

This crate exists primarily to keep the oy binary entrypoint small. run and err_line are public for that entrypoint and lightweight embedding, but spawning the oy executable is preferred for automation. Other modules and implementation details are private and may change without a semver-stable library API commitment.

// Arguments exclude the executable name, just like std::env::args().skip(1).
let exit_code = oy::run(vec!["doctor".into(), "--json".into()]).await?;
assert_eq!(exit_code, 0);

Functions§

err_line
Writes a formatted diagnostic line to standard error.
run
Runs the oy command dispatcher with arguments that exclude the executable name.