Expand description
acpx is a thin Rust client for launching ACP-compatible agent servers and
talking to them through the official Agent Client Protocol (ACP) Rust SDK.
The crate stays close to upstream ACP types and lifecycle rules. Its main pieces are:
Connectionfor subprocess-backed ACP sessions over stdio,AgentServer,CommandAgentServer, andCommandSpecfor launchable agent definitions,agent_serversfor the generated ACP registry catalog, andRuntimeContextfor the upstream SDK’s local!Sendtask model.
The current scope is local subprocess agents over stdio. Registry entries
backed by npx or uvx are directly connectable. Binary-only registry
entries remain discoverable but are not launchable in v0.
use acpx::{
AgentServer, AgentServerMetadata, CommandAgentServer, CommandSpec, RuntimeContext,
};
use agent_client_protocol as acp;
use futures::executor::block_on;
let runtime = RuntimeContext::new(|task| {
block_on(task);
});
let server = CommandAgentServer::new(
AgentServerMetadata::new("codex-acp", "Codex CLI", "0.10.0")
.description("ACP adapter for OpenAI's coding assistant"),
CommandSpec::new("npx")
.arg("--yes")
.arg("@zed-industries/codex-acp@0.10.0"),
);
block_on(async {
let connection = server.connect(&runtime).await?;
let _initialize = connection
.initialize(
acp::InitializeRequest::new(acp::ProtocolVersion::V1).client_info(
acp::Implementation::new("acpx-docs", "0.1.0").title("acpx Docs"),
),
)
.await?;
connection.close().await
})?;Re-exports§
pub use crate::acpx::Connection;pub use crate::agent_server::AgentServer;pub use crate::agent_server::AgentServerMetadata;pub use crate::agent_server::CommandAgentServer;pub use crate::agent_server::CommandSpec;pub use crate::agent_servers::Error as AgentServerError;pub use crate::agent_servers::HostPlatform;pub use crate::error::Error;pub use crate::error::Result;pub use crate::error::UnsupportedLaunch;pub use crate::runtime::LocalTask;pub use crate::runtime::RuntimeContext;pub use crate::runtime::Task;