refactor(cli): update API endpoints to v1 versioning and add dynamic port configuration to mock server

- Update mock-cli-server.py to use dynamic port allocation (8020-8050 range)
  - Add socket-based port availability checking
  - Generate dynamic config file at cli-dev/cli-staging-config-dynamic.yaml
  - Remove docstring header and shebang
  - Update endpoint paths: /v1/marketplace/gpus → /v1/marketplace/gpu/list, /v1/agent/workflows → /v1/agents/workflows

- Standardize all CLI command API
This commit is contained in:
oib
2026-03-04 23:24:10 +01:00
parent a200a50085
commit 210a77d860
13 changed files with 249 additions and 81 deletions

View File

@@ -66,7 +66,7 @@ def api(ctx, endpoint, method, data):
import httpx
# Prepare request
url = f"{config.coordinator_url.rstrip('/')}/api/v1/{endpoint.lstrip('/')}"
url = f"{config.coordinator_url.rstrip('/')}/{endpoint.lstrip('/')}"
headers = {}
if config.api_key:
headers['Authorization'] = f"Bearer {config.api_key}"