Featured image of post KShell: A unified terminal entry point for managing multiple AI coding tools

KShell: A unified terminal entry point for managing multiple AI coding tools

An open-source tool for unified discovery and resuming of AI CLI sessions, with zero-code extensibility and declarative configuration support

Key Highlights

kshell is an open-source unified entry point for AI coding tools. The project is currently at v0.1.3, under the MIT license, with 232 commits. It was made public on October 6, 2026, and currently supports Windows, macOS, and Linux. Go 1.23+ and Wails v2 serve as desktop dependencies, while the frontend is built with React 19 + Bubbletea.

Core capabilities include: automatically scanning the local disk to discover all installed AI coding CLIs, displaying workspaces and session lists in a unified way, and supporting one-click resume back into the native CLI to continue interacting.

Core Design: Discover → Select → Hand Off

kshell’s positioning is very clear: serve only as a neutral entry point, and do not reimplement conversation protocols. Its workflow consists of three steps:

  • Discover: scan the disk to find installed tools, workspaces, and past sessions
  • Select: display them in a unified list/grid view, enabling cross-tool comparison
  • Hand off: return the session to the native CLI without wrapping it a second time

This avoids the risk posed by rapid iteration of vendors’ proprietary protocols. For example, Claude Code uses ACP, Codex uses the resume parameter, and Cursor uses yet another approach—kshell is natively compatible, so new features are available as soon as the tools are upgraded.

The backend has only 217 Go files and roughly 34,000 lines of code, with restrained module boundaries. The frontend has 106 TS/TSX files, accompanied by 106 test files.

Key Technical Details That Improve the Development Experience

KShell’s design reflects engineering pragmatism in several places:

  • Provider interface abstraction: implementing the interface is enough to bring a new tool under management, but the four built-in tools are hardcoded—because each vendor’s detection and resume methods carry historical baggage
  • SessionEnumerator interface: handles scenarios where “sessions are not in files,” such as OpenCode storing sessions in SQLite; the SQL must be a single line to accommodate npm.cmd’s re-parsing behavior on Windows
  • Read only the file header: Claude Code / Codex JSONL sessions are often several MB, so kshell reads only the header, with read limits: 256KB for Codex file headers and 2MB for Gemini file headers, enough to extract metadata such as ID, cwd, time, and title
  • Dual cache gating: uses mtime + size as two factors to determine whether a file has changed, avoiding missed detections from “rewritten with the same timestamp and length” or “content changed but length unchanged”
  • Terminal exit drain mechanism: delays 80–500ms before closing the terminal to drain remaining output, preventing the loss of roughly 40% of trailing conversation

The frontend architecture is lightweight: a single Zustand store, with tab state persisted to localStorage; xterm instances remain mounted, so switching tabs has zero cost (earlier versions destroyed and recreated them, losing buffers, scroll positions, and ANSI state).

SSH remote management also sets clear boundaries: always use the system ssh binary, use -o BatchMode=yes, reuse ~/.ssh/config and ssh-agent, and store only the private key path, never write the key to disk.

Extensibility and Configuration Flexibility

Declarative configuration supports zero-code extension. Users can declare new tools in ~/.kshell/providers.yaml:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
providers:
  - id: mytool
    name: MyTool
    detect:
      command: mytool
      dirs: ["~/.mytool"]
    sessions:
      glob: ~/.mytool/projects/*/*.jsonl
      format: jsonl
    fields:
      cwd: cwd
      id: sessionId
      timestamp: timestamp
      title: message.content
    resume:
      args: ["--resume", "{id}"]
    verified: false

verified: false marks a user configuration as untested, and the UI clearly indicates this. Declarative configuration and built-in configuration are merged via MergeProviders, and user configuration IDs have lower priority than built-in ones.

Tool detection also includes fault tolerance: Cursor’s shim is periodically wiped by the official updater, so kshell’s fallback strategy is to look in InstallDirs for a coexisting combination of node.exe and the main script, and to carry entry prefix arguments via BinArgs to ensure child processes inherit the correct cwd.

Who It’s For and Practical Adoption Advice

  • Who should use it: developers who use more than 3 AI coding CLIs at the same time; engineers who frequently need to restore past sessions; users who strongly depend on native CLI features (such as new diff algorithms or new tool calls)
  • Who should wait: users who use only a single AI toolchain (KShell’s value won’t be apparent); users who need cloud sync or SFTP transfer capabilities (the project explicitly does not support them)

Final Thoughts

The emergence of KShell confirms a trend: as the tool ecosystem becomes increasingly fragmented, a neutral orchestration layer is more sustainable than reinventing the wheel. It does not try to define a new conversation protocol, but instead solves the real pain point of “finding a session takes longer than writing code” at the lowest possible cost.