Skip to content

feat: add --json output flag to submit, list, and report commands#29

Open
183amir wants to merge 7 commits intomainfrom
feat/json-output
Open

feat: add --json output flag to submit, list, and report commands#29
183amir wants to merge 7 commits intomainfrom
feat/json-output

Conversation

@183amir
Copy link
Collaborator

@183amir 183amir commented Mar 16, 2026

Summary

  • Add --json flag to submit, list, and report commands for machine-readable output
  • --json is mutually exclusive with --wrap and --truncate on list
  • Document --json flag in README

Examples

$ gridtk submit --json --wrap=echo hello
{"job_id": 1, "slurm_id": 42611, "name": "gridtk"}

$ gridtk list --json
[
  {
    "job_id": 1,
    "slurm_id": 42611,
    "state": "COMPLETED",
    "exit_code": "0",
    "name": "gridtk",
    ...
  }
]

$ gridtk report --json -j 1
[
  {
    "job_id": 1,
    "name": "gridtk",
    "state": "COMPLETED",
    "output_files": [{"path": "logs/gridtk.42611.out", "content": "hello\n"}]
  }
]

🤖 Generated with Claude Code


📚 Documentation preview 📚: https://gridtk--29.org.readthedocs.build/en/29/

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 16, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/gridtk
  cli.py 460, 481-482, 658-663, 666-714
Project Total  

This report was generated by python-coverage-comment-action

@183amir 183amir changed the base branch from main to fix/empty-result-feedback March 16, 2026 16:15
Amir Mohammadi and others added 6 commits March 16, 2026 17:18
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add no_jobs_message() helper that includes active filters in the
message so users understand why no jobs matched.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When default state filters are active (e.g. resubmit), suggest
--state all. When explicit filters are provided, show them.
When no filters at all, just state the fact.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@183amir 183amir requested a review from Yannick-Dayer March 16, 2026 16:57
@183amir 183amir mentioned this pull request Mar 16, 2026
Base automatically changed from fix/empty-result-feedback to main March 16, 2026 17:03
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