# Burn Your Flags: Interactive CLIs for Agents

Mark Lummus & Navinkumar Patil, PayPal | AI Engineer World's Fair 2026 | 53:43

Source: https://www.youtube.com/watch?v=aV_vgUSatqs
Channel: AI Engineer (https://www.youtube.com/@aiDotEngineer). Summarised by AIE Talks.
Page: https://aietalks.com/talks/burn-your-flags-interactive-clis-for-agents
Published: 2026-10-11
Tags: computer-use, context-engineering, structured-outputs, tool-use

## TL;DR
- Interactive CLIs can fail silently because an agent may see a redraw loop instead of the prompt that a human sees.
- Flags work for known, independent inputs, but become awkward when later choices depend on earlier answers or live API responses.
- Agents can work with interactive CLIs through tmux, structured side channels, and context that exposes choices and constraints.

## Summary
Mark Lummus and Navinkumar Patil run a workshop around Barista 9000, an interactive coffee-ordering CLI that often loses agents at terminal prompts. They argue that adding flags is only a good answer when the inputs are known in advance and independent. Interactive flows can adapt to earlier answers, API responses, and available resources, while also carrying guidance and guard rails. The workshop asks participants to adapt the CLI for an agent and compete on a leaderboard. Patil presents tmux sessions as a quick way to send keys and capture terminal state, then describes IPC side channels that expose structured JSON. He also shows how context injection can provide an agent with options, limits, and conditions that a human would normally infer from the interface. The competition exposes a limitation: a deterministic parser with low latency can score well without really solving the general interaction problem. The speakers finish by recommending predictable CLIs with enough context and machine-readable access for agents.

## Key ideas
### Interactive prompts can disappear from an agent without causing an error
[02:29](https://www.youtube.com/watch?v=aV_vgUSatqs&t=149s)
Lummus explains that agents often shell out to Bash, but some harnesses handle interactive programs poorly. A human sees a question with arrow-key options, while the agent may see only a redraw loop. The harness can lose the interface state and fail quietly, with no error to diagnose. This makes the problem different from an ordinary failed command. The agent may be waiting for a choice that it never recognized as a prompt. The workshop uses this failure mode as its starting point.

### Flags stop fitting when the workflow depends on context
[02:59](https://www.youtube.com/watch?v=aV_vgUSatqs&t=179s)
Interactive CLIs can ask a later question based on an earlier answer or on a response from an API. Lummus says flags work well when the flow is known in advance, the operation is a single pass, and the options are independent. They become difficult when every possible path needs its own combination of flags. The interactive flow can also hold guidance and guard rails that would otherwise need to be recreated in command syntax. A coffee order is a simple example of a flow that can change as information arrives.

### An agent can follow a decision tree when the CLI exposes one
[05:10](https://www.youtube.com/watch?v=aV_vgUSatqs&t=310s)
Lummus distinguishes an agent from a fixed automation script. A script has its decisions prepared in advance. An agent can reason, react, ask, retry, and back up. He says an agent can walk a decision tree if the tool provides that tree, while flags cannot express the same changing interaction cleanly. He connects this problem to accessibility: the CLI can keep its guidance and guard rails while offering an interface suited to a different kind of reader. The human-facing flow does not have to be discarded.

### The workshop tests agent-friendly CLI changes with Barista 9000
[06:32](https://www.youtube.com/watch?v=aV_vgUSatqs&t=392s)
The speakers give participants a bare CLI called Barista 9000, which takes coffee orders and fails when run through an agent because it is interactive. Participants download the PayPal Cafe repository, register a name, run the CLI, and submit information to a server. A leaderboard tracks their results, with a Mac Mini offered as the prize. The organizers deliberately hold back suggestions at first, then introduce ideas during the exercise. They describe these as good ideas rather than established best practices because the design space is still unsettled.

### Tmux provides a practical first way to expose terminal state
[25:47](https://www.youtube.com/watch?v=aV_vgUSatqs&t=1547s)
Patil's first suggestion is to run the CLI inside tmux. The agent can send keys and capture the contents of a pane instead of losing the interactive session. He recommends starting with the help command, since agents commonly inspect help before using a tool. Detached sessions can keep long-running work alive, and separate sessions can support multiple agents. Tmux is a relatively low-effort approach because it gives the agent access to the same terminal state that a human would otherwise observe.

### Structured side channels are cleaner than screen scraping
[28:28](https://www.youtube.com/watch?v=aV_vgUSatqs&t=1708s)
Patil's second suggestion is an IPC side channel that exposes state and input as data. He compares it to adding a REST API to a web application: the visual interface remains for humans, while the API gives a machine a structured interface. The agent should know the available choices and the expected output JSON. In the Barista example, fields such as coffee size and a default value can be supplied in machine-readable form. This lets the agent read state and send input without interpreting terminal redraws.

### Context injection tells the agent about constraints that humans infer
[31:35](https://www.youtube.com/watch?v=aV_vgUSatqs&t=1895s)
Patil describes context injection as a way to give an agent information that is not obvious from the basic interface. If the CLI has only two gallons of oat milk left, the context can tell the agent what to ask the user, whether two ounces are acceptable, and whether it should offer a backup. The same CLI can present selectable options to a human while giving an agent a complete input description. Patil presents this as a progression from capturing the screen, to exposing structured state, to describing the surrounding conditions.

### The competition rewards deterministic parsers and fast responses
[35:10](https://www.youtube.com/watch?v=aV_vgUSatqs&t=2110s)
The leaderboard ranks accuracy first and response time second. A participant points out that the benchmark can be gamed by fulfilling one order with a deterministic parser and very low latency. Lummus accepts the criticism and says he likes determinism in a CLI used by an LLM. The CLI should be a small, focused instrument that returns the same response for the same command. He does not want an agent embedded inside the CLI and then handed to another agent, because the result would be unpredictable.

### The final recommendation combines context, side channels, and tmux
[52:24](https://www.youtube.com/watch?v=aV_vgUSatqs&t=3144s)
The winning solution was a deterministic CLI solver driven through tmux, and another participant described using an agent to build and optimize the CLI. Lummus and Patil close by repeating three starting points: give the agent good context, provide a side channel, and tell it to use tmux. These techniques address different parts of the problem. Tmux preserves access to the interactive terminal, side channels provide structured state and input, and context injection explains options and constraints that the agent needs to make decisions.

## Notable quotes
- Mark Lummus: "The agent sees a redraw loop, not a question, and the harness loses the UI state." (04:00)
- Mark Lummus: "The agent can reason. It can react. It can ask. It can retry. It can back up." (05:10)
- Navinkumar Patil: "So instead of doing screen scraping, which T-Max actually does for visual inference, you could start using side channels." (28:28)
- Mark Lummus: "The LLM is the non-deterministic player here. We want the CLI to be as someone described it, a small sharp instrument." (41:52)
- Mark Lummus: "Give it good context, give it a side channel, and tell it to use T-Mox." (52:24)

## Tools & references mentioned
- PayPal
- PayPal Cafe
- Barista 9000
- Bash
- tmux
- REST API
- Claude Agent SDK
- Claude
- Claude Code
- Codex
- Opus 4.8
- Eclipse
- IntelliJ
- JetBrains
- Microsoft VS Code
- Cursor
- Windsurf
- Mac Mini

## Who should watch
- You maintain a CLI that an agent must operate, and interactive prompts are being skipped without useful error messages.
- Your tool has workflows whose later choices depend on earlier answers, API responses, or current resource limits.
- You are building an agent benchmark and want to understand how deterministic parsers and response latency can distort the result.

## Related talks

- [Your Agent Hates Your CLI](https://aietalks.com/talks/your-agent-hates-your-cli) (Ayush Bhardwaj, Allos AI, 12:20)
- [Designing CLIs for Agents, Not Humans](https://aietalks.com/talks/designing-clis-for-agents-not-humans) (Pedro Lopez, Airbyte, 18:20)
- [Your agent is blindfolded](https://aietalks.com/talks/your-agent-is-blindfolded) (Johan Lajili, Poolside, 09:58)
- [Building Agent Interfaces: Lessons from Chrome DevTools (MCP) for Agents](https://aietalks.com/talks/building-agent-interfaces-lessons-from-chrome-devtools-mcp-for-agents) (Michael Hablich, Google, 22:38)
- [Agents Need Feature Flags](https://aietalks.com/talks/agents-need-feature-flags) (Sachin Gupta, 19:17)
