Skip to main content

Crate oy

Crate oy 

Source
Expand description

§oy

oy adds one focused coding agent and repeatable repository audit/review workflows to OpenCode 2. File-backed CLI preparation and finalization provide deterministic repository collection, ordered chunks, target-diff input, and normalized Markdown/SARIF reports. OpenCode remains responsible for model execution, providers, authenticated sessions, permissions, and general coding tools. oy does not store provider credentials. The native CLI supports Linux and macOS; Windows users should run it in WSL2.

§Start with the CLI

The command-line interface is the supported automation surface:

oy setup --dry-run       # preview package/config migration
oy setup                 # register the version-matched OpenCode package
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 and OpenCode 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()])?;
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.