Add 'pipelinerun list' command to CLI#1045
Merged
Merged
Conversation
Adds a new `clarifai pipelinerun list` (alias `pr ls`) command that lists runs for a pipeline version via the existing `ListPipelineVersionRuns` gRPC endpoint. - New `Pipeline.list_pipeline_version_runs(pipeline_version_id=None, ...)` client method using `list_pages_generator`. Falls back to the instance's `pipeline_version_id` when not passed; raises `UserError` if neither is set. - New CLI command supports `--user_id`, `--app_id`, `--pipeline_id`, `--pipeline_version_id`, `--page_no`, `--per_page`. Missing IDs are loaded from `config-lock.yaml` (consistent with pause/cancel/resume/monitor). All four IDs are required after lockfile resolution (matches the backend validator). - Renders results with `display_co_resources`: ID, USER_ID, APP_ID, PIPELINE_VERSION_ID, STATUS, CREATED_AT, MODIFIED_AT, STARTED_AT, ENDED_AT, sorted by CREATED_AT desc. - Tests: 4 new tests covering flag invocation, lockfile fallback, missing required params, and missing pipeline_version_id. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Minimum allowed line rate is |
nitinbhojwani
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
clarifai pipelinerun list(aliasclarifai pr ls) command that lists runs for a pipeline version, completing the pipeline-run CLI alongside the existingpause,cancel,resume, andmonitorsubcommands.Changes
Client (
clarifai/client/pipeline.py)Pipeline.list_pipeline_version_runs(pipeline_version_id=None, filter_by=None, page_no=None, per_page=None)method.STUB.ListPipelineVersionRunsgRPC endpoint vialist_pages_generator.pipeline_version_idas an explicit argument; falls back toself.pipeline_version_id.UserErrorif neither is set.CLI (
clarifai/cli/pipeline_run.py)pipelinerun list/pr lscommand.--user_id,--app_id,--pipeline_id,--pipeline_version_id,--page_no(default 1),--per_page(default 16)._load_pipeline_params_from_configso missing IDs are loaded fromconfig-lock.yamlwhen run inside a pipeline workspace (consistent with the rest of thepipelinerungroup)._validate_pipeline_paramsafter lockfile resolution — matches the backend'sListPipelineVersionRunsRequestvalidator.display_co_resourcesas a plain-text table.ID,USER_ID,APP_ID,PIPELINE_VERSION_ID,STATUS,CREATED_AT,MODIFIED_AT,STARTED_AT,ENDED_AT.CREATED_ATdesc.Tests (
tests/cli/test_pipeline_run.py)test_list_with_flags— explicit flag invocation.test_list_with_config_lock— lockfile fallback.test_list_without_required_params— errors when nothing is supplied.test_list_without_pipeline_version_id— errors when version is missing.All 17 tests in
tests/cli/test_pipeline_run.pypass.Example usage
Notes
.protoor gRPC stub changes —ListPipelineVersionRunsalready exists inclarifai_grpc.pipeline_version_id; if that constraint is relaxed in the future, we can revisit adding an "all versions" mode.