Export a Data Set
Export a test data set from Tosca Cloud to a local CSV, Excel, or JSON file.
Always use --json --silent on every toscactl command.
Steps
Parse arguments. Extract from
$ARGUMENTS:- Dataset name or ID (required)
- Format:
csv,excel, orjson(required — ask the user if not specified) - Output path (optional — defaults to
dataset_<id>.<ext>)
Run the export.
toscactl datasets export "<name_or_id>" --format <csv|excel|json> --json --silent [--output "<path>"] [--sort-column "<column>"] [--direction asc|desc]Parse the result. The JSON response contains:
path— the output file pathsize— file size in bytes
Report to the user. Show the file path and size. If relevant, offer to view the file contents.
Export Options
--sort-column <name>— sort rows by a specific column before exporting--direction asc|desc— sort direction (default: ascending)--separator <char>— CSV field separator (default: comma)--encoding <name>— character encoding (e.g.,utf-8)
Error Handling
- If the dataset is not found, suggest listing datasets with
/tosca-datasets list. - If the export fails with authorization errors, suggest re-authenticating with
/tosca-setup.