cloudos-cli 2.71.0__tar.gz → 2.73.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/PKG-INFO +34 -1
  2. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/README.md +33 -0
  3. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/__main__.py +145 -78
  4. cloudos_cli-2.73.0/cloudos_cli/_version.py +1 -0
  5. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/utils/details.py +8 -1
  6. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli.egg-info/PKG-INFO +34 -1
  7. cloudos_cli-2.71.0/cloudos_cli/_version.py +0 -1
  8. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/LICENSE +0 -0
  9. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/__init__.py +0 -0
  10. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/clos.py +0 -0
  11. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/configure/__init__.py +0 -0
  12. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/configure/configure.py +0 -0
  13. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/cost/__init__.py +0 -0
  14. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/cost/cost.py +0 -0
  15. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/datasets/__init__.py +0 -0
  16. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/datasets/datasets.py +0 -0
  17. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/import_wf/__init__.py +0 -0
  18. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/import_wf/import_wf.py +0 -0
  19. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/jobs/__init__.py +0 -0
  20. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/jobs/job.py +0 -0
  21. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/link/__init__.py +0 -0
  22. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/link/link.py +0 -0
  23. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/logging/__init__.py +0 -0
  24. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/logging/logger.py +0 -0
  25. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/procurement/__init__.py +0 -0
  26. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/procurement/images.py +0 -0
  27. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/queue/__init__.py +0 -0
  28. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/queue/queue.py +0 -0
  29. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/related_analyses/__init__.py +0 -0
  30. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/related_analyses/related_analyses.py +0 -0
  31. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/utils/__init__.py +0 -0
  32. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/utils/array_job.py +0 -0
  33. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/utils/cloud.py +0 -0
  34. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/utils/errors.py +0 -0
  35. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/utils/last_wf.py +0 -0
  36. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/utils/requests.py +0 -0
  37. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli/utils/resources.py +0 -0
  38. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli.egg-info/SOURCES.txt +0 -0
  39. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli.egg-info/dependency_links.txt +0 -0
  40. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli.egg-info/entry_points.txt +0 -0
  41. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli.egg-info/requires.txt +0 -0
  42. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/cloudos_cli.egg-info/top_level.txt +0 -0
  43. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/setup.cfg +0 -0
  44. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/setup.py +0 -0
  45. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/tests/__init__.py +0 -0
  46. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/tests/functions_for_pytest.py +0 -0
  47. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/tests/test_cli_project_create.py +0 -0
  48. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/tests/test_cost/__init__.py +0 -0
  49. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/tests/test_cost/test_job_cost.py +0 -0
  50. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/tests/test_logging/__init__.py +0 -0
  51. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/tests/test_logging/test_logger.py +0 -0
  52. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/tests/test_related_analyses/__init__.py +0 -0
  53. {cloudos_cli-2.71.0 → cloudos_cli-2.73.0}/tests/test_related_analyses/test_related_analyses.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudos_cli
3
- Version: 2.71.0
3
+ Version: 2.73.0
4
4
  Summary: Python package for interacting with CloudOS
5
5
  Home-page: https://github.com/lifebit-ai/cloudos-cli
6
6
  Author: David Piñeyro
@@ -1669,6 +1669,39 @@ If you require more information on the files and folder listed, you can use the
1669
1669
  - Virtual Name (the file or folder name)
1670
1670
  - Storage Path
1671
1671
 
1672
+ **Output Format Options**
1673
+
1674
+ The `datasets ls` command supports different output formats using the `--output-format` option:
1675
+
1676
+ - **`stdout` (default)**: Displays results in the console with Rich formatting
1677
+ - Without `--details`: Simple list of file/folder names with color coding (blue underlined for folders)
1678
+ - With `--details`: Rich formatted table with all file information
1679
+
1680
+ - **`csv`**: Saves results to a CSV file
1681
+ - Without `--details`: CSV with two columns: "Name,Storage Path"
1682
+ - With `--details`: CSV with columns "Type, Owner, Size, Size (bytes), Last Updated, Virtual Name, Storage Path"
1683
+
1684
+ Examples:
1685
+
1686
+ ```bash
1687
+ # Simple list to console (default)
1688
+ cloudos datasets ls Data --profile my_profile
1689
+
1690
+ # Detailed table in console
1691
+ cloudos datasets ls Data --details --profile my_profile
1692
+
1693
+ # Simple CSV output
1694
+ cloudos datasets ls Data --profile my_profile --output-format csv
1695
+
1696
+ # Detailed CSV output
1697
+ cloudos datasets ls Data --details --output-format csv --profile my_profile
1698
+
1699
+ # Custom output filename
1700
+ cloudos datasets ls Data --details --output-format csv --output-basename my_files --profile my_profile
1701
+ ```
1702
+
1703
+ When using `--output-format csv`, you can optionally specify a custom base filename using `--output-basename`. If not provided, the filename will be auto-generated based on the path (e.g., `datasets_ls.csv`).
1704
+
1672
1705
  #### Move Files
1673
1706
 
1674
1707
  Relocate files and folders within the same project or across different projects. This is useful for reorganizing data and moving results to appropriate locations.
@@ -1634,6 +1634,39 @@ If you require more information on the files and folder listed, you can use the
1634
1634
  - Virtual Name (the file or folder name)
1635
1635
  - Storage Path
1636
1636
 
1637
+ **Output Format Options**
1638
+
1639
+ The `datasets ls` command supports different output formats using the `--output-format` option:
1640
+
1641
+ - **`stdout` (default)**: Displays results in the console with Rich formatting
1642
+ - Without `--details`: Simple list of file/folder names with color coding (blue underlined for folders)
1643
+ - With `--details`: Rich formatted table with all file information
1644
+
1645
+ - **`csv`**: Saves results to a CSV file
1646
+ - Without `--details`: CSV with two columns: "Name,Storage Path"
1647
+ - With `--details`: CSV with columns "Type, Owner, Size, Size (bytes), Last Updated, Virtual Name, Storage Path"
1648
+
1649
+ Examples:
1650
+
1651
+ ```bash
1652
+ # Simple list to console (default)
1653
+ cloudos datasets ls Data --profile my_profile
1654
+
1655
+ # Detailed table in console
1656
+ cloudos datasets ls Data --details --profile my_profile
1657
+
1658
+ # Simple CSV output
1659
+ cloudos datasets ls Data --profile my_profile --output-format csv
1660
+
1661
+ # Detailed CSV output
1662
+ cloudos datasets ls Data --details --output-format csv --profile my_profile
1663
+
1664
+ # Custom output filename
1665
+ cloudos datasets ls Data --details --output-format csv --output-basename my_files --profile my_profile
1666
+ ```
1667
+
1668
+ When using `--output-format csv`, you can optionally specify a custom base filename using `--output-basename`. If not provided, the filename will be auto-generated based on the path (e.g., `datasets_ls.csv`).
1669
+
1637
1670
  #### Move Files
1638
1671
 
1639
1672
  Relocate files and folders within the same project or across different projects. This is useful for reorganizing data and moving results to appropriate locations.
@@ -1331,7 +1331,7 @@ def job_details(ctx,
1331
1331
  raise ValueError(f"Job '{job_id}' not found or not accessible: {str(e)}")
1332
1332
  except Exception as e:
1333
1333
  raise ValueError(f"Failed to retrieve details for job '{job_id}': {str(e)}")
1334
- create_job_details(json.loads(j_details.content), job_id, output_format, output_basename, parameters)
1334
+ create_job_details(json.loads(j_details.content), job_id, output_format, output_basename, parameters, cloudos_url)
1335
1335
 
1336
1336
 
1337
1337
  @job.command('list')
@@ -2997,6 +2997,16 @@ def run_bash_array_job(ctx,
2997
2997
  'Details contains "Type", "Owner", "Size", "Last Updated", ' +
2998
2998
  '"Virtual Name", "Storage Path".'),
2999
2999
  is_flag=True)
3000
+ @click.option('--output-format',
3001
+ help=('The desired display for the output, either directly in standard output or saved as file. ' +
3002
+ 'Default=stdout.'),
3003
+ type=click.Choice(['stdout', 'csv'], case_sensitive=False),
3004
+ default='stdout')
3005
+ @click.option('--output-basename',
3006
+ help=('Output file base name to save jobs details. ' +
3007
+ 'Default=datasets_ls'),
3008
+ default='datasets_ls',
3009
+ required=False)
3000
3010
  @click.pass_context
3001
3011
  @with_profile_config(required_params=['apikey', 'workspace_id'])
3002
3012
  def list_files(ctx,
@@ -3008,7 +3018,9 @@ def list_files(ctx,
3008
3018
  project_name,
3009
3019
  profile,
3010
3020
  path,
3011
- details):
3021
+ details,
3022
+ output_format,
3023
+ output_basename):
3012
3024
  """List contents of a path within a CloudOS workspace dataset."""
3013
3025
  verify_ssl = ssl_selector(disable_ssl_verification, ssl_cert)
3014
3026
 
@@ -3024,89 +3036,144 @@ def list_files(ctx,
3024
3036
  try:
3025
3037
  result = datasets.list_folder_content(path)
3026
3038
  contents = result.get("contents") or result.get("datasets", [])
3039
+
3027
3040
  if not contents:
3028
3041
  contents = result.get("files", []) + result.get("folders", [])
3029
3042
 
3030
- if details:
3031
- console = Console(width=None)
3032
- table = Table(show_header=True, header_style="bold white")
3033
- table.add_column("Type", style="cyan", no_wrap=True)
3034
- table.add_column("Owner", style="white")
3035
- table.add_column("Size", style="magenta")
3036
- table.add_column("Last Updated", style="green")
3037
- table.add_column("Virtual Name", style="bold", overflow="fold")
3038
- table.add_column("Storage Path", style="dim", no_wrap=False, overflow="fold", ratio=2)
3039
-
3040
- for item in contents:
3041
- is_folder = "folderType" in item or item.get("isDir", False)
3042
- type_ = "folder" if is_folder else "file"
3043
-
3044
- # Enhanced type information
3045
- if is_folder:
3046
- folder_type = item.get("folderType")
3047
- if folder_type == "VirtualFolder":
3048
- type_ = "virtual folder"
3049
- elif folder_type == "S3Folder":
3050
- type_ = "s3 folder"
3051
- elif folder_type == "AzureBlobFolder":
3052
- type_ = "azure folder"
3053
- else:
3054
- type_ = "folder"
3055
- else:
3056
- # Check if file is managed by Lifebit (user uploaded)
3057
- is_managed_by_lifebit = item.get("isManagedByLifebit", False)
3058
- if is_managed_by_lifebit:
3059
- type_ = "file (user uploaded)"
3060
- else:
3061
- type_ = "file (virtual copy)"
3062
-
3063
- user = item.get("user", {})
3064
- if isinstance(user, dict):
3065
- name = user.get("name", "").strip()
3066
- surname = user.get("surname", "").strip()
3067
- else:
3068
- name = surname = ""
3069
- if name and surname:
3070
- owner = f"{name} {surname}"
3071
- elif name:
3072
- owner = name
3073
- elif surname:
3074
- owner = surname
3043
+ # Process items to extract data
3044
+ processed_items = []
3045
+ for item in contents:
3046
+ is_folder = "folderType" in item or item.get("isDir", False)
3047
+ type_ = "folder" if is_folder else "file"
3048
+
3049
+ # Enhanced type information
3050
+ if is_folder:
3051
+ folder_type = item.get("folderType")
3052
+ if folder_type == "VirtualFolder":
3053
+ type_ = "virtual folder"
3054
+ elif folder_type == "S3Folder":
3055
+ type_ = "s3 folder"
3056
+ elif folder_type == "AzureBlobFolder":
3057
+ type_ = "azure folder"
3075
3058
  else:
3076
- owner = "-"
3077
-
3078
- raw_size = item.get("sizeInBytes", item.get("size"))
3079
- size = format_bytes(raw_size) if not is_folder and raw_size is not None else "-"
3080
-
3081
- updated = item.get("updatedAt") or item.get("lastModified", "-")
3082
- filepath = item.get("name", "-")
3083
-
3084
- if item.get("fileType") == "S3File" or item.get("folderType") == "S3Folder":
3085
- bucket = item.get("s3BucketName")
3086
- key = item.get("s3ObjectKey") or item.get("s3Prefix")
3087
- s3_path = f"s3://{bucket}/{key}" if bucket and key else "-"
3088
- elif item.get("fileType") == "AzureBlobFile" or item.get("folderType") == "AzureBlobFolder":
3089
- account = item.get("blobStorageAccountName")
3090
- container = item.get("blobContainerName")
3091
- key = item.get("blobName") if item.get("fileType") == "AzureBlobFile" else item.get("blobPrefix")
3092
- s3_path = f"az://{account}.blob.core.windows.net/{container}/{key}" if account and container and key else "-"
3059
+ type_ = "folder"
3060
+ else:
3061
+ # Check if file is managed by Lifebit (user uploaded)
3062
+ is_managed_by_lifebit = item.get("isManagedByLifebit", False)
3063
+ if is_managed_by_lifebit:
3064
+ type_ = "file (user uploaded)"
3093
3065
  else:
3094
- s3_path = "-"
3095
-
3096
- style = Style(color="blue", underline=True) if is_folder else None
3097
- table.add_row(type_, owner, size, updated, filepath, s3_path, style=style)
3066
+ type_ = "file (virtual copy)"
3067
+
3068
+ user = item.get("user", {})
3069
+ if isinstance(user, dict):
3070
+ name = user.get("name", "").strip()
3071
+ surname = user.get("surname", "").strip()
3072
+ else:
3073
+ name = surname = ""
3074
+ if name and surname:
3075
+ owner = f"{name} {surname}"
3076
+ elif name:
3077
+ owner = name
3078
+ elif surname:
3079
+ owner = surname
3080
+ else:
3081
+ owner = "-"
3082
+
3083
+ raw_size = item.get("sizeInBytes", item.get("size"))
3084
+ size = format_bytes(raw_size) if not is_folder and raw_size is not None else "-"
3085
+
3086
+ updated = item.get("updatedAt") or item.get("lastModified", "-")
3087
+ filepath = item.get("name", "-")
3088
+
3089
+ if item.get("fileType") == "S3File" or item.get("folderType") == "S3Folder":
3090
+ bucket = item.get("s3BucketName")
3091
+ key = item.get("s3ObjectKey") or item.get("s3Prefix")
3092
+ storage_path = f"s3://{bucket}/{key}" if bucket and key else "-"
3093
+ elif item.get("fileType") == "AzureBlobFile" or item.get("folderType") == "AzureBlobFolder":
3094
+ account = item.get("blobStorageAccountName")
3095
+ container = item.get("blobContainerName")
3096
+ key = item.get("blobName") if item.get("fileType") == "AzureBlobFile" else item.get("blobPrefix")
3097
+ storage_path = f"az://{account}.blob.core.windows.net/{container}/{key}" if account and container and key else "-"
3098
+ else:
3099
+ storage_path = "-"
3100
+
3101
+ processed_items.append({
3102
+ 'type': type_,
3103
+ 'owner': owner,
3104
+ 'size': size,
3105
+ 'raw_size': raw_size,
3106
+ 'updated': updated,
3107
+ 'name': filepath,
3108
+ 'storage_path': storage_path,
3109
+ 'is_folder': is_folder
3110
+ })
3111
+
3112
+ # Output handling
3113
+ if output_format == 'csv':
3114
+ import csv
3115
+
3116
+ csv_filename = f'{output_basename}.csv'
3117
+
3118
+ if details:
3119
+ # CSV with all details
3120
+ with open(csv_filename, 'w', newline='', encoding='utf-8') as csvfile:
3121
+ fieldnames = ['Type', 'Owner', 'Size', 'Size (bytes)', 'Last Updated', 'Virtual Name', 'Storage Path']
3122
+ writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
3123
+ writer.writeheader()
3124
+
3125
+ for item in processed_items:
3126
+ writer.writerow({
3127
+ 'Type': item['type'],
3128
+ 'Owner': item['owner'],
3129
+ 'Size': item['size'],
3130
+ 'Size (bytes)': item['raw_size'] if item['raw_size'] is not None else '',
3131
+ 'Last Updated': item['updated'],
3132
+ 'Virtual Name': item['name'],
3133
+ 'Storage Path': item['storage_path']
3134
+ })
3135
+ else:
3136
+ # CSV with just names
3137
+ with open(csv_filename, 'w', newline='', encoding='utf-8') as csvfile:
3138
+ writer = csv.writer(csvfile)
3139
+ writer.writerow(['Name', 'Storage Path'])
3140
+ for item in processed_items:
3141
+ writer.writerow([item['name'], item['storage_path']])
3142
+
3143
+ click.secho(f'\nDatasets list saved to: {csv_filename}', fg='green', bold=True)
3144
+
3145
+ else: # stdout
3146
+ if details:
3147
+ console = Console(width=None)
3148
+ table = Table(show_header=True, header_style="bold white")
3149
+ table.add_column("Type", style="cyan", no_wrap=True)
3150
+ table.add_column("Owner", style="white")
3151
+ table.add_column("Size", style="magenta")
3152
+ table.add_column("Last Updated", style="green")
3153
+ table.add_column("Virtual Name", style="bold", overflow="fold")
3154
+ table.add_column("Storage Path", style="dim", no_wrap=False, overflow="fold", ratio=2)
3155
+
3156
+ for item in processed_items:
3157
+ style = Style(color="blue", underline=True) if item['is_folder'] else None
3158
+ table.add_row(
3159
+ item['type'],
3160
+ item['owner'],
3161
+ item['size'],
3162
+ item['updated'],
3163
+ item['name'],
3164
+ item['storage_path'],
3165
+ style=style
3166
+ )
3098
3167
 
3099
- console.print(table)
3168
+ console.print(table)
3100
3169
 
3101
- else:
3102
- console = Console()
3103
- for item in contents:
3104
- name = item.get("name", "")
3105
- is_folder = item.get("folderType") or item.get("isDir")
3106
- if is_folder:
3107
- console.print(f"[blue underline]{name}[/]")
3108
- else:
3109
- console.print(name)
3170
+ else:
3171
+ console = Console()
3172
+ for item in processed_items:
3173
+ if item['is_folder']:
3174
+ console.print(f"[blue underline]{item['name']}[/]")
3175
+ else:
3176
+ console.print(item['name'])
3110
3177
 
3111
3178
  except Exception as e:
3112
3179
  raise ValueError(f"Failed to list files for project '{project_name}': {str(e)}")
@@ -0,0 +1 @@
1
+ __version__ = '2.73.0'
@@ -73,7 +73,7 @@ def get_path(param, param_kind_map, execution_platform, storage_provider, mode="
73
73
  return value
74
74
 
75
75
 
76
- def create_job_details(j_details_h, job_id, output_format, output_basename, parameters):
76
+ def create_job_details(j_details_h, job_id, output_format, output_basename, parameters, cloudos_url="https://cloudos.lifebit.ai"):
77
77
  """
78
78
  Creates formatted job details output from job data in multiple formats.
79
79
 
@@ -113,6 +113,8 @@ def create_job_details(j_details_h, job_id, output_format, output_basename, para
113
113
  Whether to create a separate configuration file containing job parameters.
114
114
  If True and parameters exist, creates a '.config' file with Nextflow-style
115
115
  parameter formatting.
116
+ cloudos_url : str, optional
117
+ The base URL of the CloudOS instance. Defaults to "https://cloudos.lifebit.ai".
116
118
 
117
119
  Returns
118
120
  -------
@@ -293,6 +295,11 @@ def create_job_details(j_details_h, job_id, output_format, output_basename, para
293
295
  for key, value in job_details_json.items():
294
296
  if key == "Parameters":
295
297
  table.add_row(key, "\n".join(value.split(";")))
298
+ elif key == "ID":
299
+ # Add hyperlink to job ID
300
+ job_url = f"{cloudos_url}/app/advanced-analytics/analyses/{value}"
301
+ job_id_with_link = f"[link={job_url}]{value}[/link]"
302
+ table.add_row(key, job_id_with_link)
296
303
  else:
297
304
  table.add_row(key, str(value))
298
305
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudos_cli
3
- Version: 2.71.0
3
+ Version: 2.73.0
4
4
  Summary: Python package for interacting with CloudOS
5
5
  Home-page: https://github.com/lifebit-ai/cloudos-cli
6
6
  Author: David Piñeyro
@@ -1669,6 +1669,39 @@ If you require more information on the files and folder listed, you can use the
1669
1669
  - Virtual Name (the file or folder name)
1670
1670
  - Storage Path
1671
1671
 
1672
+ **Output Format Options**
1673
+
1674
+ The `datasets ls` command supports different output formats using the `--output-format` option:
1675
+
1676
+ - **`stdout` (default)**: Displays results in the console with Rich formatting
1677
+ - Without `--details`: Simple list of file/folder names with color coding (blue underlined for folders)
1678
+ - With `--details`: Rich formatted table with all file information
1679
+
1680
+ - **`csv`**: Saves results to a CSV file
1681
+ - Without `--details`: CSV with two columns: "Name,Storage Path"
1682
+ - With `--details`: CSV with columns "Type, Owner, Size, Size (bytes), Last Updated, Virtual Name, Storage Path"
1683
+
1684
+ Examples:
1685
+
1686
+ ```bash
1687
+ # Simple list to console (default)
1688
+ cloudos datasets ls Data --profile my_profile
1689
+
1690
+ # Detailed table in console
1691
+ cloudos datasets ls Data --details --profile my_profile
1692
+
1693
+ # Simple CSV output
1694
+ cloudos datasets ls Data --profile my_profile --output-format csv
1695
+
1696
+ # Detailed CSV output
1697
+ cloudos datasets ls Data --details --output-format csv --profile my_profile
1698
+
1699
+ # Custom output filename
1700
+ cloudos datasets ls Data --details --output-format csv --output-basename my_files --profile my_profile
1701
+ ```
1702
+
1703
+ When using `--output-format csv`, you can optionally specify a custom base filename using `--output-basename`. If not provided, the filename will be auto-generated based on the path (e.g., `datasets_ls.csv`).
1704
+
1672
1705
  #### Move Files
1673
1706
 
1674
1707
  Relocate files and folders within the same project or across different projects. This is useful for reorganizing data and moving results to appropriate locations.
@@ -1 +0,0 @@
1
- __version__ = '2.71.0'
File without changes
File without changes
File without changes