MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / execute

Method execute

crates/opencode-command/src/lib.rs:173–180  ·  view source on GitHub ↗

Execute a command and return the rendered template

(&self, name: &str, ctx: CommandContext)

Source from the content-addressed store, hash-verified

171
172 /// Execute a command and return the rendered template
173 pub fn execute(&self, name: &str, ctx: CommandContext) -> anyhow::Result<String> {
174 let command = self
175 .commands
176 .get(name)
177 .ok_or_else(|| anyhow::anyhow!("Command not found: {}", name))?;
178
179 Ok(self.render_template(&command.template, ctx))
180 }
181
182 /// Execute a command with plugin hooks (async version)
183 pub async fn execute_with_hooks(

Callers 2

run_non_interactiveFunction · 0.45
handle_debug_commandFunction · 0.45

Calls 2

render_templateMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected