smithers-ctl, a CLI binary that the IDE installs and keeps on PATH. When both the binary and the right environment signals are present, workflows gain access to editor-native UI: file navigation, diff previews, terminal tabs, chat overlays, and webviews.
Supported IDEs
The IDE integration is backed bysmithers-ctl. Any IDE that ships smithers-ctl and sets the correct environment signals is supported. The environment detection checks five signals in order:
| Signal | Value |
|---|---|
SMITHERS_IDE | 1, true, or yes |
SMITHERS_CTL_ACTIVE | 1, true, or yes |
SMITHERS_SESSION_KIND | ide |
TERM_PROGRAM | smithers |
__CFBundleIdentifier | contains smithers (macOS app bundles) |
PATH (or at an absolute path if configured).
Import
Availability
isSmithersIdeAvailable
Quick boolean check. Resolvestrue only when the binary is found and at least one environment signal is active.
getSmithersIdeAvailability
Full availability report with the reason and which signals fired.SmithersIdeAvailability
reason distinguishes the two failure modes. binary-missing means smithers-ctl was not found on PATH. environment-inactive means the binary exists but none of the environment signals are set, which usually means the process is running outside the IDE.
Configuration
All service constructors accept an optionalSmithersIdeServiceConfig:
| Option | Default | Description |
|---|---|---|
command | "smithers-ctl" | Binary name or absolute path |
cwd | process.cwd() | Working directory for subprocess |
env | process.env | Environment for subprocess |
idleTimeoutMs | 2000 | Idle timeout in milliseconds |
maxOutputBytes | 200000 (200 KB) | Max captured stdout/stderr |
timeoutMs | 10000 | Hard timeout per command in milliseconds |
Service API
createSmithersIdeService
Returns aSmithersIdeServiceApi with all IDE operations as Effect-returning methods.
SmithersIdeServiceApi
API Reference
openFile
Open a file in the IDE, optionally jumping to a line and column.column requires line. Passing column without line fails with INVALID_INPUT.
smithers-ctl open <path> [+line[:col]]
openDiff
Open a unified diff preview in the IDE.smithers-ctl diff show --content <content>
showOverlay
Show an overlay in the IDE.smithers-ctl overlay --type <type> --message <message> [--title ...] [--position ...] [--duration ...] [--percent ...]
runTerminal
Run a command in a new IDE terminal tab.smithers-ctl terminal [--cwd <cwd>] run <command>
askUser
Prompt the user with a chat overlay and return when the overlay is shown. This is a shim — it displays the prompt viashowOverlay("chat", ...) and returns immediately with status: "prompted". The actual user response must be collected through the IDE’s chat interface.
openWebview
Open a URL in an IDE webview tab.smithers-ctl webview open <url>
Effect Layer
UsecreateSmithersIdeLayer to provide SmithersIdeService as an Effect Layer, then use the module-level Effect constructors (openFile, openDiff, etc.) that read from the service via Context.Tag.
openFile, openDiff, showOverlay, runTerminal, askUser, openWebview) each call Effect.flatMap(SmithersIdeService, ...) and require SmithersIdeService in the context.
SmithersIdeService Tag
MCP CLI Namespace
createSmithersIdeCli returns a CLI object with all six IDE tools registered under the smithers-ide namespace. This is the integration point for MCP tool servers.
Tool Names
Tool Schemas
| Tool | Required Args | Optional Args |
|---|---|---|
smithers_ide_open_file | path: string | line: number, col: number |
smithers_ide_open_diff | content: string | — |
smithers_ide_show_overlay | type: "chat"|"progress"|"panel", message: string | title, position, duration, percent |
smithers_ide_run_terminal | cmd: string | cwd: string |
smithers_ide_ask_user | prompt: string | — |
smithers_ide_open_webview | url: string (URL) | — |
IDE-Gated CLI Commands
createAvailableSmithersIdeCli is a convenience wrapper that returns the CLI only when the IDE is available, and null otherwise. Use it to conditionally register IDE tools:
Error Handling
All operations throwSmithersError on failure.
| Code | Cause |
|---|---|
INVALID_INPUT | Empty path, content, command, or url; or column provided without line |
PROCESS_SPAWN_FAILED | smithers-ctl not found on PATH or not executable |
TOOL_COMMAND_FAILED | smithers-ctl exited with a non-zero exit code |
PROCESS_SPAWN_FAILED with ENOENT produces a human-readable message: smithers-ctl is not installed or not on PATH.