Summary
When agentcore commands are invoked without flags in a non-interactive environment (CI, piped stdin, agent automation), several commands fall through to Ink TUI rendering. Without a TTY attached, this causes the process to hang indefinitely.
The CLI already has a strong "any flag = CLI mode" pattern, but there's no safety net when no flags are provided and stdin is not a terminal.
Affected commands
Commands that render Ink TUI when no flags are given:
agentcore (bare - launches <App> TUI in alternate screen buffer)agentcore create (renders <CreateFlow>)agentcore deploy (renders <DeployFlow>)agentcore invoke (renders <InvokeFlow>)agentcore dev (enters fullscreen TUI without --logs/--invoke)agentcore add (renders <AddFlow>)agentcore remove (renders <RemoveResourceFlow>)
Suggested fix
Guard TUI launches with process.stdout.isTTY. When not a TTY and no CLI-mode flags are present, print help and exit with code 1 instead of rendering Ink.
Example pattern:
// Before launching any TUI flowif(!process.stdout.isTTY){cmd.help();// prints help to stdoutprocess.exit(1);}Alternatively, a global --non-interactive flag could force CLI-only behavior regardless of TTY state, giving automation consumers an explicit opt-in.
Why this matters
AI agents and CI pipelines are increasingly common consumers of CLIs. A hung process on bare invocation is a blocker for autonomous use - agents cannot answer prompts or interact with TUI flows, and the only recovery is a timeout or SIGKILL. TTY detection is the standard safety net (used by git, gh, docker, and most modern CLIs).
Reproduction
echo""| agentcore create
# Expected: help text + exit 1# Actual: process hangs waiting for TUI input
Summary
When
agentcorecommands are invoked without flags in a non-interactive environment (CI, piped stdin, agent automation), several commands fall through to Ink TUI rendering. Without a TTY attached, this causes the process to hang indefinitely.The CLI already has a strong "any flag = CLI mode" pattern, but there's no safety net when no flags are provided and stdin is not a terminal.
Affected commands
Commands that render Ink TUI when no flags are given:
agentcore(bare - launches<App>TUI in alternate screen buffer)agentcore create(renders<CreateFlow>)agentcore deploy(renders<DeployFlow>)agentcore invoke(renders<InvokeFlow>)agentcore dev(enters fullscreen TUI without--logs/--invoke)agentcore add(renders<AddFlow>)agentcore remove(renders<RemoveResourceFlow>)Suggested fix
Guard TUI launches with
process.stdout.isTTY. When not a TTY and no CLI-mode flags are present, print help and exit with code 1 instead of rendering Ink.Example pattern:
Alternatively, a global
--non-interactiveflag could force CLI-only behavior regardless of TTY state, giving automation consumers an explicit opt-in.Why this matters
AI agents and CI pipelines are increasingly common consumers of CLIs. A hung process on bare invocation is a blocker for autonomous use - agents cannot answer prompts or interact with TUI flows, and the only recovery is a timeout or SIGKILL. TTY detection is the standard safety net (used by git, gh, docker, and most modern CLIs).
Reproduction