1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! # oy
//!
//! `oy` adds one concise autonomous agent and repeatable repository audit/review workflows to
//! [OpenCode 2](https://opencode.ai/). 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.
//! 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:
//!
//! ```text
//! 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](https://oy.adonm.dev/getting-started.html),
//! [workflow guide](https://oy.adonm.dev/workflows.html), and
//! [CLI/MCP reference](https://oy.adonm.dev/reference.html) 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.
//!
//! ```no_run
//! # async fn example() -> anyhow::Result<()> {
//! // 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);
//! # Ok(())
//! # }
//! ```
pub use ;
pub
pub
/// Runs the `oy` command dispatcher with arguments that exclude the executable name.
///
/// Normal command and delegated opencode exit statuses are returned as `Ok(code)`. Setup,
/// filesystem, process-launch, and protocol failures are returned as errors. This function may
/// update opencode integration config or launch child processes depending on the arguments.
///
/// Prefer invoking the `oy` executable when process isolation or concurrent invocations matter;
/// CLI output configuration is process-global.
pub async
/// Writes a formatted diagnostic line to standard error.
///
/// This is primarily exposed for the binary entrypoint.
///
/// ```
/// oy::err_line(format_args!("error: {}", "example"));
/// ```