Releases: GoCodeAlone/ratchet-cli
v0.9.4
v0.9.4 — Interactive PTY Works with Claude Code
Interactive PTY Sessions
The vt10x virtual terminal emulator is now the primary Stream() path. CLI tools are driven through a real pseudo-terminal with screen buffer reading — no more fragile prompt detection on raw byte streams.
Verified
| Provider | Interactive PTY | Multi-turn | Status |
|---|---|---|---|
| Claude Code | ✅ Working | ✅ (via JSON streaming fallback) | Full support |
| Copilot CLI | ✅ Connects | In progress | |
| Ollama | N/A (uses Genkit) | ✅ | Working |
Claude Code: Full Interactive Session
$ ratchet provider default claude
$ ratchet -p "Write a reverse_list function"
→ def reverse_list(lst): return lst[::-1]
The PTY session:
- Starts Claude Code in a pseudo-terminal
- Auto-handles trust prompts (presses Enter)
- Waits for ❯ prompt via vt10x screen buffer
- Types message character-by-character + Enter
- Reads response from screen diff
- Extracts clean text, filtering UI chrome
Architecture
- vt10x.Terminal maintains a 100×30 virtual screen
- Background goroutine feeds PTY bytes → virtual terminal
- Screen polling detects prompts and response completion
- Response extraction filters box-drawing, status bars, and UI elements
Full Changelog
v0.9.3
v0.9.3 — Interactive PTY with Virtual Terminal
Interactive PTY Sessions
The PTY provider now uses vt10x virtual terminal emulator to process the rich TUI output from CLI tools like Claude Code. This properly handles cursor positioning and escape sequences — the raw PTY byte stream is processed into a readable screen buffer.
Stream() resolution order:
- JSON streaming (Claude Code
--output-format stream-json, Gemini--output-format stream-json) — structured events, most reliable - Interactive PTY (for tools without JSON streaming) — virtual terminal screen reading with prompt detection
- Non-interactive fallback — simple exec + stdout capture
How the Interactive PTY Works
vt10x.Terminalmaintains a 100×30 character screen buffer- Background goroutine feeds raw PTY bytes into the virtual terminal
waitForPromptpolls the screen for the❯prompt characterreadResponsediffs screen snapshots to extract new response text- Auto-handles trust prompts (e.g., "trust this folder?" → press Enter)
- Messages sent character-by-character + CR (some TUIs need this)
Verified
Both Claude Code (JSON streaming) and Ollama (Genkit streaming) work correctly.
Dependencies
workflow-plugin-agent v0.6.8hinshun/vt10x— VT10x terminal emulator
Full Changelog
v0.9.2
v0.9.2 — Real Streaming for PTY Providers
PTY CLI providers now use each tool's native JSON streaming output instead of fragile PTY prompt detection. This is the proper solution — no more empty responses, no more prompt detection regex hacks.
How It Works
- Claude Code:
--output-format stream-json --verbose→ structured JSON events parsed in real-time - Gemini CLI:
--output-format stream-json→ similar structured output - Copilot, Codex, Cursor: fallback to non-interactive exec (these tools don't have JSON streaming)
Verified
$ ratchet provider default claude # Claude Code provider
$ ratchet -p "What is 2+2?" # → "4" (via stream-json)
$ ratchet provider default ollama-test
$ ratchet -p "What is 3+3?" # → "6" (via Genkit streaming)
Both Claude Code and Ollama work through the same Stream() code path — no special-casing needed.
Breaking Change
Requires workflow-plugin-agent v0.6.7 (CLIAdapter interface has new StreamingArgs/ParseStreamEvent methods).
Full Changelog
v0.9.1
v0.9.1 — PTY Providers Actually Work
Fixed the critical issue where PTY CLI providers (Claude Code, Copilot, etc.) returned empty responses. The daemon's chat handler was calling Stream() (interactive PTY mode) which requires complex prompt detection that fails on real CLI tools. Now detects PTY providers and uses Chat() (non-interactive -p flag) instead.
Verified with Real CLIs
$ ratchet provider setup claude-code # ✓ registered
$ ratchet -p "What is 2+2?" # → "4"
$ ratchet -p "Write a prime checker" # → correct Python function
Code Review Fixes (workflow-plugin-agent v0.6.6)
- Zombie process prevention on PTY EOF
- Multi-turn session serialization (sessionMu)
- OSC ANSI sequence stripping
- Codex prompt detection regex fix
Full Changelog
v0.9.0
v0.9.0 — PTY CLI Providers
Drive AI CLIs as Provider Backends
Ratchet can now use Claude Code, GitHub Copilot CLI, OpenAI Codex, Google Gemini CLI, and Cursor Agent as provider backends through pseudo-terminal automation. This lets you orchestrate across multiple AI providers using your existing subscriptions — no separate API keys needed.
Setup
ratchet provider setup claude-code # Uses 'claude' CLI
ratchet provider setup copilot-cli # Uses 'copilot' CLI
ratchet provider setup codex-cli # Uses 'codex' CLI
ratchet provider setup gemini-cli # Uses 'gemini' CLI
ratchet provider setup cursor-cli # Uses 'agent' CLIEach setup: verifies the binary is installed → runs a health check → registers as a provider.
How It Works
- Chat(): Runs the CLI with
-pflag for single-shot queries (stateless) - Stream(): Drives the CLI interactively via PTY — detects prompts, sends messages, reads streaming output, keeps session alive for multi-turn
- Teams: Agents in a team can use any CLI provider as their backend
Architecture
CLIAdapterinterface per tool handles binary name, flags, prompt detection, response parsingptyProviderimplementsprovider.Providerwith PTY session management- Multi-turn sessions reuse the same PTY process
- ANSI escape codes stripped from output (including OSC sequences)
Code Review Fixes
- Zombie process prevention (cmd.Wait on EOF)
- Multi-turn session serialization (sessionMu prevents concurrent Stream races)
- Codex prompt detection uses correct regex
- OSC sequence stripping in ANSI cleaner
workflow-plugin-agent v0.6.6
Required dependency — contains the PTY provider core and all 5 CLI adapters.
Full Changelog
v0.8.3
v0.8.3 — PTY Test Coverage
PTY-Based TUI Tests
8 integration tests that drive the real ratchet TUI through a pseudo-terminal, testing the exact same code path users see — no mocks, no separate code paths.
Tests cover:
- One-shot chat (correct response)
- TUI launch (splash screen, prompt, status bar renders)
- Multi-turn conversation (model recalls context from prior turns)
- No thinking leak (reasoning suppressed in output)
- Provider list, daemon status, model list commands
- Text wrapping (lines don't exceed terminal width)
# Run PTY tests (requires Ollama running)
go test -tags integration ./internal/tui/ -v -timeout 600sTest Coverage Summary
- 33 E2E tests — real gRPC, in-memory DB, mock LLM
- 17 adversarial tests — edge cases, error paths
- 5 CLI integration tests — real binary, real Ollama
- 8 PTY tests — real TUI, real terminal rendering
Full Changelog
v0.8.2
v0.8.2 — Quality Release
All known issues fixed. Tested end-to-end with real Ollama.
Thinking Suppression
- Ollama thinking/reasoning disabled by default (
think: false). Clean output with no reasoning leak in chat or team execution. - Uses Ollama-native
GenerateContentConfigwithNumPredictfor max tokens.
Session Cleanup
- Stale sessions (>24h) automatically marked as completed on daemon startup.
Streaming Performance
- Cached glamour markdown renderer — no longer creates a new renderer per token (was O(n²), now O(n)).
Debug Mode
ratchet daemon start --background --debugenables request/response logging to~/.ratchet/debug.log.
Verified End-to-End
- Chat: clean output, no thinking
- Teams: agents message each other, produce correct code, no reasoning leak
- Sessions: cleanup working (19 stale sessions cleared)
- All 33+ E2E tests + 5 CLI integration tests pass
Full Changelog
v0.8.1
v0.8.1
Team Fixes
- send_message tool works — renamed
typeparam tomessage_typeto avoid JSON Schema keyword collision - Error messages visible — team errors now show actual messages instead of empty
error: - Thinking event handling — mesh forwarder maps executor thinking events; team converter suppresses from output
Known Issue
Qwen3 model reasoning may still appear in team output as regular text for complex multi-tool prompts. Fix requires enabling Ollama think: true config per-call.
Full Changelog
v0.8.0
v0.8.0 — Teams Actually Work
Multi-agent teams now function end-to-end with real LLMs. Tested with Ollama qwen3:1.7b.
Team Fixes
- Team configs use default provider — removed hardcoded
qwen3:14b/qwen3:8bfrom built-in code-gen config. Agents now use your configured default provider. No need to have specific models installed. - Null provider guard —
SpawnTeamreturns a clear error if no provider is available, instead of crashing - Error messages visible — team error events now show the actual error message (was empty before due to using wrong event field)
- WithTools fix — Genkit rejects multiple
WithTools()calls. Fixed to pass all tool refs in a single call (workflow-plugin-agent v0.6.3)
Other Fixes
- Text wrapping — minimum 40-column wrap prevents garbled rendering when terminal size isn't set yet
- Failed messages not saved — user messages are only persisted after the provider accepts the request, preventing duplicate messages on timeout/error
- Better provider logging — team provider factory logs which resolution path is used (alias → default → fallback)
Tested End-to-End
$ ratchet team start code-gen --task "Write a fibonacci function"
# 3 agents (architect, coder, reviewer) collaborate via blackboard
# Produces working Python code through real Ollama inference
Full Changelog
v0.7.10
v0.7.10
- Ctrl+H hint in status bar — keybind hints now show
Ctrl+H thinkingalongside sidebar/team/quit