Skip to content

CLI: Add list-projects and list-files#198

Merged
sminot merged 7 commits intomainfrom
add-cli-subcommands
Apr 2, 2026
Merged

CLI: Add list-projects and list-files#198
sminot merged 7 commits intomainfrom
add-cli-subcommands

Conversation

@sminot
Copy link
Copy Markdown
Contributor

@sminot sminot commented Apr 1, 2026

Adding useful CLI methods.

Usage: cirro list-projects [OPTIONS]

  List projects

Options:
  --help  Show this message and exit.
Usage: cirro list-files [OPTIONS]

  List files in a dataset

Options:
  --project TEXT     Name or ID of the project
  --dataset TEXT     Name or ID of the dataset
  -i, --interactive  Gather arguments interactively
  --help             Show this message and exit.

@sminot sminot requested a review from nathanthorpe April 1, 2026 18:37
datasets = cirro.datasets.list(project_id)
dataset_id = get_id_from_name(datasets, input_params['dataset'])

files = cirro.datasets.get_assets_listing(project_id, dataset_id).files
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be a good time to check if we want to increase the file_limit param here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the file_limit parameter

file_limit (int): Maximum number of files to return (default 100,000)
"""
files = self._get_assets().files
if file_limit != 100000:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic seems unnecessary

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Just simplified it to remove the conditional

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

@sminot sminot merged commit c9bea2e into main Apr 2, 2026
10 checks passed
@sminot sminot deleted the add-cli-subcommands branch April 2, 2026 01:23
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