Skip to content

feat: sp — command-line client for the Sample Platform REST API#1

Open
gaurav02081 wants to merge 1 commit into
CCExtractor:masterfrom
gaurav02081:feat/initial-cli
Open

feat: sp — command-line client for the Sample Platform REST API#1
gaurav02081 wants to merge 1 commit into
CCExtractor:masterfrom
gaurav02081:feat/initial-cli

Conversation

@gaurav02081

Copy link
Copy Markdown

Initial import of the sp CLI into its own repo (moved out of the
sample-platform PR, per discussion — a client tool belongs in its own
repository, separate from the server that gets deployed on the VM).

What it is

sp is a CLI client for the Sample Platform REST API. It lets a developer
or an AI agent investigate CI runs end-to-end from the terminal, no web
frontend required:

  • sp run ls / show / summary / failures / results / result
  • sp run diff — expected-vs-actual structured diff (auto-resolves the hidden ids)
  • sp run logs / errors / artifacts
  • sp investigate <run_id> — one-shot triage: run info + pass/fail counts + classified failures
  • sp sample, sp regression, sp auth, sp health

Output defaults to JSON (for agents/scripts), with a -o table human view.
Each failure is labelled with a stable code (SEGFAULT, EXIT_CODE_MISMATCH,
OUTPUT_DIFF, …) so you get why a test failed without reading logs.

Notes

  • The API address is configured via --base-url / SP_BASE_URL, so it points
    at any deployment without code changes.
  • Depends on the Sample Platform REST API endpoints ([Feature] : Add REST API endpoints for access through AI  sample-platform#1117).
    Fully reviewable now; runs against a live server once those are deployed.
  • Includes a pytest suite (43 tests), lint/type configs (pycodestyle, pydocstyle,
    isort, mypy), and a GitHub Actions CI workflow.

Opening as a PR for review before merge, as discussed.

sp lets a developer or an AI agent investigate CI runs end-to-end from the
terminal (no web frontend): list/show runs, summaries, classified failures,
expected-vs-actual diffs, logs, errors, artifacts, samples, regression
tests, auth, and a one-shot `investigate` triage command.

Output defaults to JSON for agents, with a -o table human view. The API
address is configurable via --base-url / SP_BASE_URL. Includes a test suite
(pytest), lint/type configs (pycodestyle, pydocstyle, isort, mypy), and a
GitHub Actions CI workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants