Skip to content

Add CLI for Synapse public backend API#38

Open
droxer wants to merge 2 commits into
mainfrom
codex/implement-cli-using-public-api
Open

Add CLI for Synapse public backend API#38
droxer wants to merge 2 commits into
mainfrom
codex/implement-cli-using-public-api

Conversation

@droxer
Copy link
Copy Markdown
Owner

@droxer droxer commented May 6, 2026

Motivation

  • Provide a simple, local CLI to exercise the backend public integration API (/v1) for creating agent runs, posting follow-up messages, and retrieving run status/results to aid development, automation, and debugging.

Description

  • Add a new CLI module at backend/public_api_cli.py implementing an async httpx client (PublicApiClient) that talks to the /v1 endpoints with bearer auth and JSON error handling.
  • Implement top-level subcommands: run (create a new agent run), message (post a follow-up message to a conversation), status (fetch run status), and result (fetch run result with --format selection), and include UUID validation via uuid.UUID.
  • Provide CLI flags and env var fallbacks for configuration: --base-url (or SYNAPSE_BASE_URL), --api-key (or SYNAPSE_API_KEY), and --timeout.
  • Expose the CLI as a console script synapse-cli by adding [project.scripts] synapse-cli = "public_api_cli:main" to backend/pyproject.toml.

Testing

  • Ran formatter: python -m ruff format public_api_cli.py, which reformatted the file successfully.
  • Ran linter/check: python -m ruff check public_api_cli.py, and the check passed.
  • No automated pytest test suite was executed as part of this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant