Skip to main content

Module agents_cli

Module agents_cli 

Source
Expand description

Detection for Google’s agents-cli project layout.

agents-cli scaffold create writes an agents-cli-manifest.yaml at the project root naming the agent’s own subdirectory (agent_directory: <dir>), and generates a Dockerfile that COPYs only pyproject.toml, README.md, uv.lock*, and that one agent directory into the image — a keel.toml sitting at the project root next to the manifest is never in that COPY set, so it silently never reaches the container. keel init and keel doctor both need to recognize this layout: init writes the generated policy straight into the agent directory instead, and doctor warns when it finds a root keel.toml that would be left behind.

The manifest is a full YAML document, but we need exactly one scalar key out of it. Pulling in a YAML parser for that would be a real dependency (and a supply-chain surface) for one line of text, so this is a deliberate hand parse of the single agent_directory: key — not a general YAML reader. It tolerates the two forms agents-cli itself emits (bare and quoted scalars) and gives up (returns None) on anything else, which just means Keel falls back to treating the project as a non-agents-cli layout.

Structs§

AgentsCliLayout
The agents-cli layout facts relevant to Keel: where the manifest lives, and the agent’s own subdirectory (the only directory the generated Dockerfile ships).

Functions§

find_agents_cli_layout
Walk upward from project (inclusive) looking for agents-cli-manifest.yaml, bounded to [MAX_WALK_LEVELS] and stopping at the filesystem root. On the first manifest found, hand-parse its agent_directory key; return None if the key is missing or the directory it names does not exist.