Skip to content

Add chat REPL, doctor diagnostic, and expanded editor support - #2

Merged
yipihey merged 5 commits into
mainfrom
claude/scix-client-install-accessibility-e8QAL
Oct 22, 2026
Merged

yipihey merged 5 commits into
mainfrom
claude/scix-client-install-accessibility-e8QAL

Conversation

@yipihey

@yipihey yipihey commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds three major features to scix-client:

  1. Chat REPL (scix chat) — a built-in interactive tool-use loop that drives any tool-use-capable LLM (Anthropic, OpenAI, Gemini, Ollama) against the SciX tool set without requiring an MCP host.

  2. Doctor diagnostic (scix doctor) — a health-check command that validates installation, API token, connectivity, and editor detection.

  3. Expanded editor support — adds Gemini CLI, Codex CLI, and Windsurf to the MCP setup flow, along with improved UX (browser-opening for token acquisition, TOML config support).

Key Changes

  • New module: src/chat.rs (626 lines)

    • Implements a canonical message format and provider-agnostic tool dispatch
    • Supports four LLM providers with schema translation (Anthropic, OpenAI, Gemini, Ollama)
    • Auto-detects provider from environment variables or accepts explicit --provider
    • Interactive REPL with tool-call loop and configurable max iterations
    • Reuses tool definitions and dispatch from the MCP server via dispatch_tool_call()
  • New module: src/doctor.rs (161 lines)

    • Checks binary location and version
    • Validates API token presence and connectivity
    • Detects installed MCP hosts
    • Verifies binary is on PATH
    • Exits with code 1 if any critical check fails
  • Enhanced src/setup.rs

    • Added EditorTarget variants: GeminiCli, CodexCli, Windsurf
    • Implemented TOML config writer for Codex CLI (update_toml_codex_config)
    • Added browser-opening prompt for token acquisition (via webbrowser crate)
    • Exposed detect_editors_public() for use by doctor
    • Added editor detection for Gemini CLI, Codex CLI, and Windsurf directories
  • Refactored src/mcp.rs

    • Extracted tool dispatch logic into public dispatch_tool_call() function
    • Allows both MCP server and chat REPL to use the same tool implementations
  • Updated src/bin/scix.rs

    • Added Doctor and Chat subcommands with appropriate flags
    • Integrated new commands into CLI dispatch
  • New installer script: install.sh

    • One-line curl installer for prebuilt binaries
    • Detects platform (Linux x86_64/aarch64, macOS x86_64/aarch64)
    • Resolves latest release from GitHub
    • Installs to ~/.local/bin (configurable via SCIX_INSTALL_DIR)
    • Friendly PATH warnings
  • New documentation: docs/chat.md

    • Quick start guide for the chat REPL
    • Provider configuration and model selection
    • Comparison with MCP mode
    • Troubleshooting tips
  • Updated README.md

    • Added chat REPL to the mode table
    • Documented three installation methods (shell, pip, cargo)
    • Highlighted scix doctor for setup verification
    • Reorganized quick-start sections
  • Updated Cargo.toml

    • Added toml and webbrowser to cli feature dependencies

Implementation Details

  • Message canonicalization: Chat uses an Anthropic-shaped message format internally, with provider-specific converters on the way out. This simplifies the tool-call loop logic.

  • Tool dispatch reuse: The dispatch_tool_call() function is now the single source of truth for tool execution, used by both MCP and chat modes.

  • Provider auto-detection: Checks environment variables in priority order (Anthropic → OpenAI → Gemini → Ollama) to select a provider without user input.

  • Error handling: Chat REPL gracefully handles API errors and tool execution failures, printing

https://claude.ai/code/session_01KzghpfcHbnhrBTftUNeo3o

claude added 5 commits May 26, 2026 06:13
… templates

- `install.sh` downloads the right prebuilt binary for the platform from the
  GitHub Release and drops it in ~/.local/bin. Lets users skip the Rust
  toolchain entirely.
- `Dockerfile` produces a minimal Debian image; release workflow now pushes
  multi-arch images to ghcr.io.
- `packaging/homebrew/scix-client.rb` is the formula template for a
  `yipihey/homebrew-scix` tap. Release workflow bumps it automatically if
  HOMEBREW_TAP_TOKEN is set.
- `packaging/conda-forge/meta.yaml` is the seed recipe for submission to
  conda-forge/staged-recipes.
- `packaging/README.md` documents the one-time setup for each channel.

https://claude.ai/code/session_01KzghpfcHbnhrBTftUNeo3o
…x doctor

- `scix setup` now detects three more MCP hosts:
  - Gemini CLI (Google) at ~/.gemini/settings.json
  - Codex CLI (OpenAI) at ~/.codex/config.toml — TOML, written via new helper
  - Windsurf (Codeium) at ~/.codeium/windsurf/mcp_config.json
- Interactive token prompt offers to open the SciX token page in the user's
  default browser via the `webbrowser` crate.
- New subcommand `scix doctor` prints a diagnostic checklist: binary
  location, PATH membership, token env, live API probe, and detected MCP
  hosts. Exits non-zero on any failed check.

Cargo additions (cli feature only): toml, webbrowser.

https://claude.ai/code/session_01KzghpfcHbnhrBTftUNeo3o
`scix chat` runs an interactive tool-use loop against Anthropic, OpenAI
(also Ollama via OpenAI-compatible /v1), or Gemini. Provider is
auto-detected from the environment (ANTHROPIC_API_KEY → OPENAI_API_KEY →
GEMINI_API_KEY → OLLAMA_HOST) or selected with --provider.

The tool set is the same one exposed by `scix serve` — `mcp::tool_definitions`
and the per-tool dispatch table are now exposed as public helpers
(`tool_definitions_value`, `dispatch_tool_call`) so the chat module reuses
them verbatim. No tool implementations were duplicated.

Tool schemas are translated to each provider's shape (Anthropic
`input_schema`, OpenAI `function.parameters`, Gemini `functionDeclarations`)
and the message history is converted from a single canonical
Anthropic-style representation. Tool-call results are fed back as the
next user turn, looping until the model produces a final answer or
--max-turns is reached.

This unlocks every model with an API key, with no MCP host required.

https://claude.ai/code/session_01KzghpfcHbnhrBTftUNeo3o
- README gains a top-level Install section showing curl one-liner, pip,
  cargo, binstall, and Docker side-by-side, plus a `scix doctor` mention.
- README adds a Chat REPL quick-start showing all four providers.
- README mentions the new editors detected by `scix setup` (Gemini CLI,
  Codex CLI, Windsurf).
- New docs/chat.md with provider matrix and troubleshooting.
- docs/mcp-server.md updated with the new install paths and editor list.

https://claude.ai/code/session_01KzghpfcHbnhrBTftUNeo3o
The curl installer + PyPI + crates.io paths cover almost all users without
the maintenance overhead of an external tap repo, a conda-forge feedstock,
or a Docker image.

Removes:
- Dockerfile + .dockerignore
- packaging/ (Homebrew formula template, conda-forge recipe, READMEs)
- `docker` and `homebrew` jobs from .github/workflows/release.yml
- `packages: write` permission added for the GHCR push
- Docker / Homebrew / conda mentions from README and docs/mcp-server.md

https://claude.ai/code/session_01KzghpfcHbnhrBTftUNeo3o
@yipihey
yipihey merged commit e5794bc into main Oct 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants