Read-only mirror of github.com/ondeinference/ed.
Mirrored from https://github.com/ondeinference/ed.git
Synced Nov 23, 01:00 UTC
| 1 | # ed-claude |
| 2 | |
| 3 | Claude as an [ACP](https://agentclientprotocol.com) coding agent that runs inside your app. |
| 4 | |
| 5 | It is an [`ed-acp`](https://crates.io/crates/ed-acp) `Profile`: Claude's name, prompt, workspace |
| 6 | tools and an Anthropic API-key sign-in. It talks to the Anthropic API with the user's own key, |
| 7 | so you ship no key and pay for no inference. Every session gets ed-acp's tool approvals, `fs/*` |
| 8 | routed through the client, MCP servers and durable sessions. |
| 9 | |
| 10 | ```rust |
| 11 | use std::sync::Arc; |
| 12 | use agent_client_protocol::Channel; |
| 13 | use ed_acp::ServeOptions; |
| 14 | use ed_claude::{credentials, Claude}; |
| 15 | |
| 16 | // Once, at startup. In a sandboxed app, a dir inside the container. |
| 17 | credentials::set_dir(app_config_dir.join("edclaude")); |
| 18 | |
| 19 | // The key the user pasted into your settings screen. |
| 20 | credentials::store_api_key(&api_key, None)?; |
| 21 | |
| 22 | // Serve the agent in process. Run your ACP client on `client_end`. |
| 23 | let (agent_end, client_end) = Channel::duplex(); |
| 24 | tokio::spawn(ed_acp::serve( |
| 25 | Arc::new(Claude::new()), |
| 26 | ServeOptions { yolo: false, surface: "app" }, |
| 27 | agent_end, |
| 28 | )); |
| 29 | ``` |
| 30 | |
| 31 | - `Claude::new()` has `read_file`, `write_file`, `edit_file`, `list_directory` and `run_command`. |
| 32 | `Claude::without_shell()` drops `run_command` and tells the model so, for hosts that can't |
| 33 | start processes (iOS, Mac App Store builds). |
| 34 | - Models: `claude-sonnet-5-5` (default), `claude-opus-5-5` and `claude-haiku-5-5`, offered |
| 35 | in the ACP model picker. |
| 36 | - The key lives in one file at mode 0600 in the dir you set. The crate never reads the process |
| 37 | environment, so `OPENAI_*`, `ONDE_*` and `ED_CLAUDE_*` variables don't leak in. |
| 38 | - Without a stored key, `authenticate` fails with `API_KEY_NEEDED`. Show your key prompt when |
| 39 | you see it. `logout` deletes the stored key. |
| 40 | - `ClaudeAuth::with_base_url` points the agent at a proxy or a test server. Test with |
| 41 | [`ed-acp-testkit`](https://crates.io/crates/ed-acp-testkit)'s mock endpoint. |
| 42 | |
| 43 | This crate uses API keys only. For a Claude subscription, run Anthropic's `claude` CLI as an |
| 44 | external agent instead, for example through [`ed-acp-tauri`](https://crates.io/crates/ed-acp-tauri). |
| 45 | |
| 46 | Used in production by [siGit](https://sigit.si). |
| 47 | |
| 48 | Claude and Anthropic are trademarks of Anthropic, PBC. This crate is not made or endorsed by |
| 49 | Anthropic. Use of the Anthropic API follows Anthropic's terms. |
| 50 | |
| 51 | ## Copyright |
| 52 | |
| 53 | © 2026 Seto Elkahfi ([Onde Inference](https://ondeinference.com)). |
| 54 | Licensed under MIT or Apache-2.0. |