kimi-cli icon indicating copy to clipboard operation
kimi-cli copied to clipboard

Full Built-in Shell Context with Native TTY Integration and Cross-Platform (Windows/Unix) Support

Open cyjin-yl opened this issue 1 year ago • 2 comments

What feature would you like to see?

Currently, kimi-cli provides a basic shell mode that executes commands via asyncio.create_subprocess_shell(). However, this approach has several limitations:

  • [ ] No persistent shell session context — each command runs independently, losing environment variables, working directory, and shell state. (Though zsh integration works but kimi CLI itself should also got this i hope)

  • [ ] Built-in commands like cd are not supported

  • [ ] Disconnected workflow — the shell mode and Kimi CLI’s agent mode are not integrated.

As a result, users must constantly switch between kimi-cli and their native terminal, which breaks workflow continuity and reduces productivity.

Additional information

For Unix/Linux Platforms

  • Implement pseudo-terminal (pty) allocation to spawn the user’s default shell ($SHELL, e.g., bash, zsh, fish).
  • Maintain a persistent shell session across commands (preserving env, cwd, job control, etc.).
  • Support shell-native features like signals, terminal resizing, and history.
  • Integrate seamlessly with Kimi’s agent mode, maintaining context between AI and shell

For Windows Platforms

  • Add native support for PowerShell Core (pwsh.exe) and Windows Subsystem for Linux (WSL).
  • (cmd.exe is never a modern choice, especially this year is 2025...)
  • Integrate via the ConPTY API to maintain session persistence.

Provide unified UX across all OSes.

After refining this proposal together with the community, I am ready to work on an another branch and then open a pull request.

cyjin-yl avatar Nov 07 '25 12:11 cyjin-yl

There is currently no support for Windows, is that right?

sunheyi6 avatar Jan 27 '26 08:01 sunheyi6

There is currently no support for Windows, is that right?

Kimi CLI does support Windows!

xiaoju111a avatar Jan 27 '26 09:01 xiaoju111a