Universal Rust wrapper for CLI AI agents (Claude Code, Codex, Gemini). PTY mirror and pipe/NDJSON modes with tokio broadcast fan-out.
Universal Rust transport library for CLI AI agents. Spawn, stream, resume — for four different CLI agents through one unified API.
Not a harness. Not a sandbox. gate4agent is the thin wiring layer between your Rust app and the CLI agent's subprocess: spawn the binary, write the prompt, read structured events, resume by session id. That's it.
| Tool | Transport | Pipe mode | ACP | Resume | Notes |
|---|---|---|---|---|---|
| Claude Code | Pipe + PTY + ACP | ✓ stream-json | ✓ via gemini-agent-acp | ✓ --resume <id> | Prompt via stdin |
| Codex | Pipe + PTY + ACP | ✓ --json | ✓ via codex-acp | ✓ exec resume <id> | Uses --full-auto for non-interactive |
| Gemini | Pipe + PTY + ACP | ✓ stream-json | ✓ native --experimental-acp | ✓ --resume <id> | Prompt via -p flag |
OpenCode (sst/opencode) | Pipe + ACP | ✓ --format json | ✓ native opencode acp | ✓ --session ses_XXX | 5-event NDJSON schema |
Transport classes:
use gate4agent::{CliTool, SessionConfig, AgentEvent, PipeSession, PipeProcessOptions};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = SessionConfig {
tool: CliTool::ClaudeCode,
working_dir: std::env::current_dir()?,
env_vars: vec![],
name: None,
};
let session = PipeSession::spawn(config, "Say hello in 3 words", PipeProcessOptions::default()).await?;
let mut rx = session.subscribe();
while let Ok(event) = rx.recv().await {
match event {
AgentEvent::Text { text, .. } => p
Google's AI-powered research notebook that ingests your documents and becomes an expert on your content. Generates audio overviews, study guides, FAQs, and interactive discussions from uploaded sources.
Google DeepMind's experimental AI agent that can navigate websites, fill forms, and complete multi-step browser tasks autonomously. Uses Gemini's multimodal understanding to interact with web interfaces.
Google DeepMind's universal AI assistant prototype that can see, hear, and respond in real-time through your device camera and microphone. Demonstrates the future of multimodal AI interaction.
Google Cloud's enterprise platform for building, deploying, and managing AI agents powered by Gemini. Supports multi-agent orchestration, tool integration, and enterprise governance.
Gemini's agentic research capability that autonomously browses the web, synthesizes information from dozens of sources, and produces comprehensive research reports on any topic.
Interactive coding and content creation agent that generates, previews, and iterates on code, documents, and interactive applications in a side panel. Supports HTML/CSS/JS, Python, and more.
Workflows from the Neura Market marketplace related to this Gemini resource