@setoelkahfi / sigit / commits / 4b58743

Update README and docs for platform support and terminal mode

Clarify siGit's two modes, platform compatibility, and how terminal mode works on Unix vs Windows. Improve documentation comments and error handling for interactive mode.

paydii committed Apr 24, 2026 at 12:34 UTC 4b587436f48fd2ca68a240f472a49e00fdab91f5
2 files changed +45 -21
README.md
+15 -4
index 68810d7..b791a33 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,16 @@ A coding agent for [smbCloud](https://smbcloud.xyz/) that runs entirely on your machine. No API keys. No cloud round-trips. The model lives in your local HuggingFace cache. -Two modes: an ACP agent that Zed (and other ACP-compatible editors) spawns over stdio, or an interactive terminal chat when you run it directly. +siGit has two modes: + +- ACP mode, where Zed or another ACP-compatible editor starts it over stdio +- an interactive terminal chat when you run `sigit` yourself + +Current platform support: + +- macOS: ACP mode and interactive terminal mode +- Linux: ACP mode and interactive terminal mode +- Windows: ACP mode only for now ## Install @@ -16,7 +25,7 @@ cargo install sigit The first time siGit starts, it downloads a GGUF model (~1–2 GB) from HuggingFace. Subsequent starts load from disk in a few seconds. -On macOS, siGit shares the model cache with the siGit desktop app via an App Group container — if you've already downloaded it there, the CLI picks it up automatically. +On macOS, siGit shares its model cache with the siGit desktop app through an App Group container. If the desktop app already downloaded the model, the CLI will reuse it. ## Zed setup @@ -33,11 +42,13 @@ Add to `~/.config/zed/settings.json`: } ``` -Use the absolute path — `~` expansion won't work here. +Use the full absolute path. `~` will not be expanded here. ## Terminal mode -Running `sigit` directly in a terminal opens an interactive chat UI. Same model, same system prompt — handy for quick questions without opening an editor. +If you run `sigit` directly in a terminal, it opens an interactive chat UI. It uses the same model and system prompt as the editor integration, so it is useful for quick questions when you do not want to open Zed first. + +That terminal mode currently depends on Unix terminal behavior, so it works on macOS and Linux. On Windows, siGit supports ACP/editor mode only right now. ## Copyright
src/main.rs
+30 -17
index b197283..fcd11aa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,17 +1,27 @@ -//! siGit Code — an ACP coding agent that runs a local LLM via Onde Inference platform. +//! siGit Code is a local coding agent built on Onde Inference. //! -//! In interactive (TTY) mode **all** process output — `log::` crate events, -//! `tracing` events from mistralrs_core, and even raw `println!` calls buried -//! inside third-party crates — is redirected to `$TMPDIR/sigit.log` by -//! rewiring the stdout/stderr file descriptors with `dup2(2)` before any -//! library code runs. Ratatui receives a private copy of the original -//! terminal fd so its rendering is unaffected. +//! When you run it in an interactive terminal, all process output goes to +//! `$TMPDIR/sigit.log` first. That includes `log::` events, `tracing` output +//! from mistralrs_core, and even stray `println!` calls from dependencies. +//! Ratatui gets its own copy of the real terminal handle, so the UI can keep +//! drawing normally while the noisy stuff goes to the log file. //! -//! Two modes of operation: +//! siGit has two modes: +//! - ACP mode over stdio for editors like Zed +//! - interactive terminal mode when you run it directly in a TTY //! -//! The model loads before the ACP `LocalSet` starts. This matters because -//! `mistralrs` calls `block_in_place` internally, which panics inside -//! `spawn_local` tasks. Loading on a normal multi-thread worker avoids that. +//! Current platform support: +//! - macOS: ACP mode and interactive terminal mode +//! - Linux: ACP mode and interactive terminal mode +//! - Windows: ACP mode only for now +//! +//! The interactive terminal path is still Unix-only because it relies on +//! Unix file-descriptor redirection to keep logs away from the TUI. +//! +//! The model loads before the ACP `LocalSet` starts. That is important because +//! `mistralrs` calls `block_in_place` internally, and that blows up inside +//! `spawn_local` tasks. Loading it on a normal multi-thread worker avoids the +//! problem. //! //! On macOS, the HF cache points at the App Group container shared with the //! siGit desktop app. See [`setup`]. @@ -493,13 +503,16 @@ async fn main() -> anyhow::Result<()> { // Redirect stdout/stderr to $TMPDIR/sigit.log *first* — before any // library code can println!/eprintln!/log to the real terminal. #[cfg(unix)] - let (tty, cleanup_tty) = redirect_output_to_log()?; + { + let (tty, cleanup_tty) = redirect_output_to_log()?; + init_logging(true); + setup::setup_shared_model_cache(); + run_interactive(tty, cleanup_tty).await + } #[cfg(not(unix))] - anyhow::bail!("interactive mode requires Unix (macOS / Linux)"); - - init_logging(true); - setup::setup_shared_model_cache(); - run_interactive(tty, cleanup_tty).await + { + anyhow::bail!("interactive mode requires Unix (macOS / Linux)"); + } } else { // ACP mode: no redirect needed, logs go to stderr. init_logging(false);