Skip to content

feat(cli): add JSON output for run listings - #16

Closed
Morrow588 wants to merge 3 commits into
m87techlabs:mainfrom
Morrow588:feat/runs-list-json
Closed

Morrow588 wants to merge 3 commits into
m87techlabs:mainfrom
Morrow588:feat/runs-list-json

Conversation

@Morrow588

Copy link
Copy Markdown

What and why

Closes #13. slm runs list --json prints the complete status objects as a JSON array, so scripts can consume run metadata without parsing the table. The existing --project filter is applied first. Empty homes and unmatched filters produce []; the default table output is unchanged.

The change serializes the existing status dictionaries rather than maintaining a second field list, preserving optional status fields. CONTRIBUTING.md includes the command and CHANGELOG.md records the new option.

Verification

pytest tests/unit/test_runs.py -q
6 passed

make lint
All checks passed!
94 files already formatted
Success: no issues found in 56 source files

make test
246 passed, 4 deselected, 1 warning in 51.76s

Local commands used UV_PROJECT_ENVIRONMENT=.venv-cpu UV_NO_SYNC=1; the environment uses the exported uv.lock package versions with PyTorch 2.11.0+cpu in place of the CUDA wheel because the CUDA dependency installation exceeded the sandbox disk limit. No dependency or lockfile changes are included. abc2midi was built from its upstream source and put on PATH for the full CPU suite. OMP_NUM_THREADS=1 and MKL_NUM_THREADS=1 were set. The warning is the existing Starlette/AnyIO deprecation.

All five new JSON cases fail against the original CLI (unrecognized --json) and pass with this change. Tests compare the entire decoded status objects, exercise project filtering and three empty-result cases, and retain the existing table test. The uploaded four files were compared to the tested local versions with no differences.

Checklist (CONTRIBUTING.md)

  • Lint and all CPU tests pass locally (environment difference above); training code is unchanged
  • No project-specific engine references or Project API changes
  • CLI documentation and changelog in the same change; no new pipeline stage
  • No new tools, dependencies, or abbreviations
  • Reported test counts come from actual runs
  • Conventional commit subjects; no co-author or generated-by trailers

Let scripts consume full run statuses without parsing the human-readable table. Empty selections are JSON arrays, and the existing project filter applies.
@sandeeps85

Copy link
Copy Markdown
Contributor

Thank you for this, @Morrow588. It's a careful, well-tested change. Another contributor had asked to take #13 on the issue and their PR covers the same ground, so we've merged #17 and I'm closing this one. Sorry for the overlap: we've added a "Picking up an issue" section to CONTRIBUTING (comment first, get assigned, then open a PR) so it doesn't happen again. If you'd like to pick up another, comment on any open good first issue and I'll assign it.

@sandeeps85 sandeeps85 closed this Oct 15, 2026
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.

slm runs list --json for scripts

2 participants