agent-tools
Small Rust helpers for running local commands and Codex-powered tools.
Features
- Run commands with args, cwd, env, stdin, timeout, and output capture.
- Run shell commands when shell syntax is needed.
- Call the local
codexCLI from Rust. - Use Codex web search with a simple
web_search(query)function.
Install
[]
= "0.1"
Run a Command
use ;
let output = run?;
assert_eq!;
# Ok::
Web Search
use web_search;
let answer = web_search?;
println!;
# Ok::
Web search uses the local codex CLI with --search. It does not call a separate search API directly. Make sure codex is installed and logged in before using it.
For advanced configuration, use WebSearchRequest and WebSearchTool.
Notes
run_shellpasses the command string to the system shell. Do not use it with untrusted input.- Command output is collected into memory.
- Timeout kills the direct child process only; shell child processes may need stronger process-group handling in production.