MoonshotAI / MoonshotAI/kimi-cli

Shell 工具交互式输入支持 || Shell tool interactive input support

Open
#1,117 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
11.4k
Forks
1.3k
Avg merge
9h 47m
Merged PRs (30d)
2

Description

What feature would you like to see?

(TLDR: 想要交互式shell命令的支持,提示用户输入或让agent自动输入)

(generated by kimi cli)
Feedback: Shell 工具交互式输入支持

问题描述
当前 Shell 工具使用 PIPE 创建 stdin,但从不向其中写入数据。这导致任何需要用户输入的脚本(如 read、input()、npm init 等)都会阻塞直到超时(默认 60s),最终被强制终止。

典型场景

  1. 运行 npm init 或类似需要交互式配置的命令
  2. 执行需要确认/密码输入的脚本
  3. 运行第三方 CLI 工具(如数据库迁移工具、脚手架等)

当前行为

命令:npm init
结果:阻塞 60s → "Command killed by timeout (60s)"

建议方案

  1. 短期:检测到交互式命令时主动提示用户,或提供 --input 参数允许预先传递输入
  2. 中期:类似 Claude Code/Codex,在命令需要输入时将控制权交还给用户终端
  3. 长期:支持 expect 风格的自动化输入,或提供交互式 Shell 模式
Additional information

No response


What feature would you like to see?

(TLDR: If you want support for interactive shell commands, prompt the user for input or let the agent input it automatically)

(generated by kimi cli)
Feedback: Shell tool interactive input support

Problem description
Current shell tools use PIPE to create stdin but never write data to it. This causes any script that requires user input (such as read, input(), npm init, etc.) to block until it times out (default 60s) and is eventually forced to terminate.

Typical scenario

  1. Run npm init or similar commands that require interactive configuration
  2. Execute scripts that require confirmation/password input
  3. Run third-party CLI tools (such as database migration tools, scaffolding, etc.)

current behavior

Command: npm init
Result: Blocked for 60s → "Command killed by timeout (60s)"

Suggestions

  1. Short-term: Proactively prompt the user when an interactive command is detected, or provide the --input parameter to allow input to be passed in advance
  2. Mid-term: Similar to Claude Code/Codex, control is returned to the user terminal when the command needs to be entered.
  3. Long-term: support expect-style automated input, or provide interactive shell mode
Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Shell tool's stdin PIPE and 60-second timeout handling, which the issue identifies as the source of the blockage. Compare the proposed input modes and define which interactive behavior should be supported, with npm init and confirmation or password prompts as completion examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.