Skip to main content

commands.list_specs

List specs command for the Agent Runtimes CLI.

This module provides the list-specs command that shows available agent specs from the library. It can be used directly by other libraries or through the CLI.

Usage as library: ```python from agent_runtimes.commands.list_specs import ( list_agent_specs, get_agent_specs, OutputFormat, )

# Get specs as list of dicts
specs = get_agent_specs()
for spec in specs:
print(f"{spec['id']}: {spec['name']}")

# Print formatted output
list_agent_specs(output=OutputFormat.table)
```

OutputFormat Objects

class OutputFormat(str, Enum)

Output format options.

get_agent_specs

def get_agent_specs() -> list[dict[str, Any]]

Get available agent specs from the library.

Returns:

List of agent spec dictionaries with keys:

  • id: Agent spec ID
  • name: Human-readable name
  • description: Description of the agent
  • mcp_servers: List of MCP server IDs the agent uses

list_agent_specs

def list_agent_specs(
output: OutputFormat = OutputFormat.table) -> list[dict[str, Any]]

List available agent specs from the library.

This is the core logic of the list-specs command, usable by other libraries.

Arguments:

  • output - Output format (table or json). Controls how results are printed.

Returns:

List of agent spec dictionaries.