| 196 | } |
| 197 | |
| 198 | pub fn acp_help_text(command: &str) -> String { |
| 199 | format!( |
| 200 | "\ |
| 201 | Agent Client Protocol (ACP)\n\ |
| 202 | ─────────────────────────────────\n\ |
| 203 | BitFun exposes its agent runtime as an ACP server over stdio.\n\ |
| 204 | BitFun CLI can also launch external ACP agents such as opencode, Claude Code, and Codex.\n\ |
| 205 | \n\ |
| 206 | Use this from an ACP-compatible editor or host:\n\ |
| 207 | {command} acp\n\ |
| 208 | \n\ |
| 209 | Human-facing helper commands:\n\ |
| 210 | {command} acp status\n\ |
| 211 | {command} acp doctor\n\ |
| 212 | {command} acp config --client zed\n\ |
| 213 | {command} acp clients list\n\ |
| 214 | {command} acp clients doctor\n\ |
| 215 | {command} acp clients enable opencode\n\ |
| 216 | {command} acp run opencode \"review this repository\"\n\ |
| 217 | \n\ |
| 218 | Notes:\n\ |
| 219 | - The plain `acp` command reserves stdout for JSON-RPC protocol traffic.\n\ |
| 220 | - Logs for the ACP server are written to stderr.\n\ |
| 221 | - Run the command from the project directory you want BitFun to operate on.", |
| 222 | command = command |
| 223 | ) |
| 224 | } |
| 225 | |
| 226 | pub async fn list_external_clients() -> Result<()> { |
| 227 | let service = create_client_service().await?; |