ito_core/harness/
opencode.rs1use super::streaming_cli::CliHarness;
2use super::types::{HarnessName, HarnessRunConfig};
3
4#[derive(Debug, Default)]
18pub struct OpencodeHarness;
19
20impl CliHarness for OpencodeHarness {
21 fn harness_name(&self) -> HarnessName {
22 HarnessName::Opencode
23 }
24
25 fn binary(&self) -> &str {
26 "opencode"
27 }
28
29 fn build_args(&self, config: &HarnessRunConfig) -> Vec<String> {
30 let mut args = vec!["run".to_string()];
31 if let Some(model) = config.model.as_deref() {
32 args.push("-m".to_string());
33 args.push(model.to_string());
34 }
35 args.push(config.prompt.clone());
36 args
37 }
38}
39
40#[cfg(test)]
41#[path = "opencode_tests.rs"]
42mod opencode_tests;