I'm siGit, running on siGit Code & Deploy platform, browsing siGit Code coding agent repo.
Add a README for sigit-agent
The crate had no readme, so its crates.io page was empty. This one covers what the crate exports, how to serve SiGitCode in process, where the session is stored and which environment variables it reads. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Seto Elkahfi committed
Oct 15, 2026 at 15:39 UTC
3123b0b14a2cd43f47bf847ec14c055bd458ec21
2 files changed
+68
crates/sigit-agent/Cargo.toml
+1
@@ -7,6 +7,7 @@ documentation.workspace = true
7
license.workspace = true
8
repository.workspace = true
9
homepage.workspace = true
10
+readme = "README.md"
11
keywords = ["sigit", "acp", "agent", "llm", "coding-agent"]
12
categories = ["development-tools"]
13
authors.workspace = true
crates/sigit-agent/README.md
new
+67
@@ -0,0 +1,67 @@
1
+# sigit-agent
2
+
3
+siGit Code as a library, for apps that embed the agent instead of launching the
4
+[`sigit`](https://crates.io/crates/sigit) binary.
5
+
6
+It is an [`ed-acp`](https://crates.io/crates/ed-acp) agent profile. A host serves it in
7
+process over an in-memory channel and talks to it with an
8
+[Agent Client Protocol](https://agentclientprotocol.com) client on the other end. That is
9
+what lets a sandboxed app (a Mac App Store build, an iOS app) run the agent without spawning
10
+a subprocess.
11
+
12
+## What is in the crate
13
+
14
+- `SiGitCode`, the `ed_acp::Profile`: the system prompt, the workspace tools, the `/init`
15
+ command and the sign-in. `SiGitCode::new()` includes `run_command`.
16
+ `SiGitCode::without_shell()` is for a host that cannot start processes. It drops
17
+ `run_command` and tells the model so.
18
+- `SiGitAuth`, the profile's `AuthProvider`. It runs the browser sign-in (a public OAuth
19
+ client with PKCE) and keeps the resulting session in the `credentials` module.
20
+- `official_mcp_servers()`, the official siGit MCP server as a session server for the
21
+ signed-in user. It is empty when signed out. Pass it in `mcpServers` when you open a
22
+ session, so a sign-out does not leave a stale bearer behind in a shared server.
23
+- `prompt`, which holds `SYSTEM_PROMPT` and `INIT_PROMPT`. The `sigit` binary uses the same
24
+ ones.
25
+
26
+Inference goes to siGit Code Cloud (`https://sigit.si/api/v1`, or `SIGIT_CLOUD_URL`) with the
27
+stored session token as the bearer.
28
+
29
+## Serving it
30
+
31
+```rust
32
+use std::sync::Arc;
33
+
34
+use agent_client_protocol::Channel;
35
+use ed_acp::ServeOptions;
36
+use sigit_agent::SiGitCode;
37
+
38
+let (agent_end, client_end) = Channel::duplex();
39
+let opts = ServeOptions { yolo: false, surface: "app" };
40
+
41
+tokio::spawn(ed_acp::serve(Arc::new(SiGitCode::without_shell()), opts, agent_end));
42
+// Connect an ACP client to `client_end`, then initialize, authenticate and open a session.
43
+```
44
+
45
+`crates/sigit-agent/tests/embedded.rs` is a complete version of this against a mock
46
+endpoint: it checks that the sign-in method is advertised, that a signed-out session is
47
+refused, that a stored session reaches the endpoint as the bearer, and that signing out takes
48
+it away again.
49
+
50
+## Where the session lives
51
+
52
+Call `credentials::use_config_dir` with your app's own data directory before anything else.
53
+In a sandboxed app that directory is inside the container, so the app and the `sigit` CLI
54
+never share or overwrite each other's session.
55
+
56
+## Environment
57
+
58
+| Variable | Effect |
59
+| --- | --- |
60
+| `SIGIT_CLOUD_URL` | Inference endpoint. Defaults to `https://sigit.si/api/v1`. |
61
+| `SIGIT_CONFIG_DIR` | Where the session is stored. |
62
+| `SIGIT_MCP_OFFICIAL` | `off` makes `official_mcp_servers()` return nothing. |
63
+| `SIGIT_MCP_URL` | Overrides the official MCP server URL. |
64
+
65
+## License
66
+
67
+Apache-2.0.