Skip to content

feat(cli): add --json to 'concore status' - #698

Open
yadavchiragg wants to merge 1 commit into
ControlCore-Project:devfrom
yadavchiragg:feat/status-json
Open

yadavchiragg wants to merge 1 commit into
ControlCore-Project:devfrom
yadavchiragg:feat/status-json

Conversation

@yadavchiragg

Copy link
Copy Markdown

Why

concore status only prints a rich table. Scripts and CI that want to know whether a study is still running (or how much memory it uses) have to scrape terminal output. validate and inspect already have JSON output; status doesn't.

What

concore status --json prints
{"count": N, "processes": [{"pid", "name", "command", "uptime_seconds", "memory_mb"}]}

  • numbers are numbers (uptime_seconds int, memory_mb float rounded to 0.1); null when they can't be read
  • stdout is pure JSON (no "Scanning..." line)
  • the text view is unchanged: the process scan is now a separate function used by both views, and the table uses two small helpers that produce the same strings as before ("1h 2m 5s", "12.3 MB", "unknown")

Testing

  • tests/test_status_json.py (4 tests): pure JSON + consistent count, a real fake node process is reported with the right fields/types, text view still works, formatting helpers
  • existing CLI tests unchanged, ruff clean

Docs

Documented --json in concore_cli/README.md

status only printed a rich table, which scripts and CI cannot parse. Split the process scan from the rendering and add --json with numeric uptime_seconds and memory_mb. The text output is unchanged. Tests and docs included.
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.

1 participant