Skip to main content

Crate oy

Crate oy 

Source
Expand description

§oy

oy adds one concise autonomous agent and repeatable repository audit/review workflows to OpenCode 2. Its current local MCP adapter provides deterministic repository collection, ordered chunks, target-diff input, and normalized Markdown/SARIF reports while the project moves toward file-backed CLI evidence. OpenCode remains responsible for model execution, providers, authenticated sessions, permissions, and general coding tools. oy does not store provider credentials.

§Start with the CLI

The command-line interface is the supported automation surface:

oy setup --dry-run       # preview the generated agent/skill integration
oy setup                 # install the current OpenCode 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.