Skip to content

exec tool: support interactive CLI prompts #18

@carletex

Description

@carletex

Current exec tool uses execFile with no stdin — can't handle interactive CLI prompts (e.g. npx create-eth@latest).

Options

1. Non-interactive flags (no code change)

Most CLIs have flags to skip prompts (--yes, --skip-install, etc). Agent just needs to know them.

2. Pipe stdin with spawn

Write all answers upfront to stdin. Simple but blind — breaks if prompt order changes.

3. Read stdout, respond to stdin

Stream output, pattern-match prompts, write appropriate input. Reactive but brittle.

4. PTY via node-pty

Full terminal emulation. Handles TUIs, arrow keys, ANSI. Heavy native dependency.

5. Multi-turn tool pattern (most agenty)

Split into exec_start + exec_respond tools. LLM reads prompt output and decides what to type — truly interactive, multiple API round-trips.

Recommendation

Option 1 + 5: non-interactive flags as pragmatic default, multi-turn pattern as the interesting agent-native approach.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions