Skip to content

[FEAT] Add CLI feature to fetch and install agents from Swarms market… - #1282

Closed
Steve-Dusty wants to merge 1 commit into
kyegomez:masterfrom
Steve-Dusty:cli-feature
Closed

[FEAT] Add CLI feature to fetch and install agents from Swarms market…#1282
Steve-Dusty wants to merge 1 commit into
kyegomez:masterfrom
Steve-Dusty:cli-feature

Conversation

@Steve-Dusty

@Steve-Dusty Steve-Dusty commented Jan 5, 2026

Copy link
Copy Markdown
Contributor
  • Add new swarms marketplace CLI command to search, browse, and install agents from the Swarms marketplace
  • Create marketplace API client utilities for programmatic access
  • Add comprehensive documentation and examples

Changes

New Files

  • swarms/utils/agent_marketplace.py - API client with query_agents(), get_agent_by_id(), install_agent() functions
  • examples/marketplace/marketplace_cli_example.py - Usage examples
  • docs/swarms/cli/cli_marketplace_guide.md - Full documentation

Modified Files

  • swarms/cli/main.py - Added marketplace command and subcommands
  • swarms/utils/__init__.py - Exported new marketplace functions
  • docs/swarms/cli/cli_reference.md - Added marketplace command reference
  • docs/mkdocs.yml - Added marketplace guide to navigation

CLI Commands

swarms marketplace                              # Show help
swarms marketplace list --limit 10              # List agents
swarms marketplace search --query "trading"     # Search agents
swarms marketplace info <agent-id>              # View details
swarms marketplace install <agent-id>           # Install locally

API Integration

- Endpoint: POST https://swarms.world/api/query-agents
- Auth: Authorization: Bearer <SWARMS_API_KEY>
- Docs: https://docs.swarms.ai/docs/marketplace/agents-api

Test plan

- swarms marketplace shows help
- swarms marketplace list returns agents
- swarms marketplace search --query X filters results
- swarms marketplace info <id> displays agent details
- swarms marketplace install <id> creates valid Python file
- Python imports work: from swarms.utils.agent_marketplace import query_agents

<!-- readthedocs-preview swarms start -->
----
📚 Documentation preview 📚: https://swarms--1282.org.readthedocs.build/en/1282/

<!-- readthedocs-preview swarms end -->

@github-actions github-actions Bot added documentation Improvements or additions to documentation utils labels Jan 5, 2026
Comment thread swarms/cli/main.py


def run_marketplace_search(
query: str = None,

Check failure

Code scanning / Pyre

Incompatible variable type Error

Incompatible variable type [9]: query is declared to have type str but is used as type None.
Comment thread swarms/cli/main.py

def run_marketplace_search(
query: str = None,
category: str = None,

Check failure

Code scanning / Pyre

Incompatible variable type Error

Incompatible variable type [9]: category is declared to have type str but is used as type None.
Comment thread swarms/cli/main.py


def run_marketplace_list(
category: str = None,

Check failure

Code scanning / Pyre

Incompatible variable type Error

Incompatible variable type [9]: category is declared to have type str but is used as type None.
Comment thread swarms/cli/main.py
):
"""List available agents in the marketplace."""
run_marketplace_search(
query=None,

Check failure

Code scanning / Pyre

Incompatible parameter type Error

Incompatible parameter type [6]: In call run_marketplace_search, for argument query, expected str but got None.
from pathlib import Path
from typing import Any, Dict, List, Optional

import httpx

Check failure

Code scanning / Pyre

Undefined import Error

Undefined import [21]: Could not find a module corresponding to import httpx.
from typing import Any, Dict, List, Optional

import httpx
from loguru import logger

Check failure

Code scanning / Pyre

Undefined import Error

Undefined import [21]: Could not find a module corresponding to import loguru.
}

if search:
data["search"] = search

Check failure

Code scanning / Pyre

Incompatible parameter type Error

Incompatible parameter type [6]: In call dict.__setitem__, for 2nd positional argument, expected int but got str.
if search:
data["search"] = search
if category:
data["category"] = category

Check failure

Code scanning / Pyre

Incompatible parameter type Error

Incompatible parameter type [6]: In call dict.__setitem__, for 2nd positional argument, expected int but got str.
if category:
data["category"] = category
if free_only:
data["priceFilter"] = "free"

Check failure

Code scanning / Pyre

Incompatible parameter type Error

Incompatible parameter type [6]: In call dict.__setitem__, for 2nd positional argument, expected int but got str.

return {"agents": agents, "total": total}

except httpx.HTTPStatusError as e:

Check failure

Code scanning / Pyre

Invalid except clause Error

Invalid except clause [66]: Exception handler type annotation unknown must extend BaseException.
@kyegomez kyegomez closed this Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants