Cli route list in json file/or text file oneliner

“scripts”: {
“develop”: “strapi develop”,
“start”: “strapi start”,
“build”: “strapi build”,
“develop:admin”: “strapi develop --watch-admin”,
“strapi”: “strapi”,
“export”: “strapi configuration:dump -f dump.json”,
“all:route”: “strapi routes:list > readme.txt”
},
this is my package.json script… I want to one liner list of all route endpoints… as I get in table format from cli…but not in json format/or text formats… is it anything missing from my side
Thanks

I would make my own nodejs script.
Call the function get the response back, then use JSON.parse to create a table formatted output or json file.