CLI wrapper
A CLI wrapper is a program that launches, manages, and UI-wraps other command-line tools — how apps like SpaceSpider host Claude Code and Codex CLI.
A CLI wrapper is a program that launches another command-line tool inside its own UI, streams the wrapped CLI's output through a terminal renderer, and forwards user input. SpaceSpider is a CLI wrapper: it hosts Claude Code, Codex CLI, Qwen Code, Kimi CLI, and plain shells in panes of a grid layout.
Why it matters
AI coding CLIs have exploded — every major model provider now ships one. They're powerful but fragmented: you may want all four open at once to compare, or to run them against the same task in parallel. A CLI wrapper makes that practical.
Good wrappers don't redefine the CLI experience; they just make it easier to run, layout, and resume. SpaceSpider's job is to manage PTYs, persist spaces, and stay out of the way when you're actually talking to the agent.
How it works
Under the hood a CLI wrapper needs:
- PTY management — spawn each wrapped CLI in its own PTY or ConPTY so it thinks it's in a real terminal
- Terminal rendering — a client that understands ANSI escape codes to draw output (SpaceSpider uses
@xterm/xterm) - Input forwarding — route keyboard events from the focused pane to the right PTY
- Resize handling — propagate window size changes so the child reflows output
- Lifecycle — spawn, detect exit, clean up
SpaceSpider layers on per-pane CLI selection (via cliCatalog in the Rust backend), detection (which CLIs are installed via which), and persistence of everything via tauri-plugin-store.
How it's used
Common CLI-wrapper use cases:
- GUI terminal emulators (Warp, iTerm2, Windows Terminal) — wrappers around one CLI
- AI workspace tools (SpaceSpider) — wrappers around many CLIs in a grid
- Task runners that shell out to tools and surface progress
- IDEs with embedded terminals
See getting-started and first-space to see the wrapper in action.
Related terms
- PTY — the plumbing every wrapper needs
- Terminal multiplexer — a specialized CLI-wrapper form
- Grid layout — how SpaceSpider arranges wrapped CLIs
- Space — SpaceSpider's persistent wrapper config
- Shell — the simplest thing to wrap
FAQ
Does a wrapper slow down the wrapped CLI?
A well-designed wrapper adds microseconds per keystroke and some memory for the renderer. Performance is dominated by the wrapped tool itself (network calls to the LLM, compile times, etc.).
Can I use my own terminal's keybindings inside a wrapped CLI?
Most keystrokes pass through unchanged. Wrappers typically reserve a small number of keys for their own UI (window focus, new space). SpaceSpider keeps this list short; see keyboard-shortcuts.
Related terms
- Agentic codingAgentic coding is software development where an LLM-powered agent plans, edits, runs, and verifies code on its own using tools, not just autocomplete.
- AI pair programmingAI pair programming is a collaboration style where an LLM assistant sits alongside you, suggesting code and reviewing changes in real time as you work.
- ANSI escape codesANSI escape codes are control sequences that terminals interpret for colors, cursor movement, and screen clearing — the language of every modern CLI UI.
- Autonomous agentAn autonomous agent is an AI program that perceives, decides, and acts on its own toward a goal — the architecture behind modern coding CLIs.
- CheckpointA checkpoint is a saved snapshot of file state that lets you roll back an AI coding agent's changes to a known-good point.
- Claude CodeClaude Code is Anthropic's official command-line agent that plans, edits, runs, and verifies code across your repo using Claude models and tool use.