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_agentspecs, get_agentspecs, OutputFormat, )

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

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

OutputFormat Objects

class OutputFormat(str, Enum)

Output format options.

get_agentspecs

def get_agentspecs() -> 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_agentspecs

def list_agentspecs(
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.