liveBook · Manning

Command-line interface

As explained in Context Engineering

A command-line interface is a text-based interface through which users interact with a computer program by entering commands.

A command-line interface (CLI) lets an AI agent interact with an environment by issuing commands through a shell. Unlike schema-driven function calling, it exposes a general-purpose command surface rather than requiring a predefined schema for each capability. section 4.3

A CLI tool loop connects command execution to the agent’s context:

  • The agent sends a command to a shell such as Bash. section 4.3
  • A sandbox contains execution, while a command policy can pause actions for human approval. section 4.3
  • The harness returns command output and errors to the model, which uses the results to choose its next step. section 4.3

Bug-fixing loop

An agent runs tests, examines the error output, modifies a source file, then reruns the tests to check the fix. section 4.3

Figure 4.3 CLI workflow: an AI agent using a Bash tool to execute commands in a sandboxed shell and incorporate the command output into its response
cli v5

Trace how a Bash command passes through a sandboxed shell and how its output returns to the agent. section 4.3

How Context Engineering covers it

How deep it goes
Explains command execution, feedback, sandboxing, and approval gates without detailing policy implementation.
Examples
Uses test execution, error inspection, source editing, and rerun tests to illustrate a bug-fixing loop.
What you can do after
Operate an agent workflow by running commands, inspecting results, and selecting subsequent steps.
How it connects
Contrasts with function calling and appears alongside the Model Context Protocol as an agent tool-use paradigm.

Also explained in

Compare how 12 books explain command-line interface →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Context Engineering. The section links point to the parts of the book it draws on.