#!/bin/env nu def main [ har_file: path, --type: string ] { let jsons = (open --raw $har_file | from json | get log.entries.response | where headers.value has "application/json" | get content.text) cd (mktemp -d) mut i = 1; for json in $jsons { $i += 1; $json | save $"($i).json" } open *.json | where type? == $type | to json }