Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions agentstack/cli/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ def list_tools():
List all available tools by category.
"""
tools = get_all_tools()
curr_category = None

categories = {}

# Group tools by category
for tool in tools:
if tool.category not in categories:
categories[tool.category] = []
categories[tool.category].append(tool)

print("\n\nAvailable AgentStack Tools:")
for category, tools in itertools.groupby(tools, lambda x: x.category):
if curr_category != category:
print(f"\n{category}:")
curr_category = category
for tool in tools:
# Display tools by category
for category in sorted(categories.keys()):
print(f"\n{category}:")
for tool in categories[category]:
print(" - ", end='')
print(term_color(f"{tool.name}", 'blue'), end='')
print(f": {tool.url if tool.url else 'AgentStack default tool'}")
Expand Down
Loading