Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature Request: Have something like tail's format flag for all wrangler commands #2012

Open
fubhy opened this issue Oct 12, 2022 · 7 comments
Labels
chunky Bigger than most enhancement New feature or request

Comments

@fubhy
Copy link

fubhy commented Oct 12, 2022

Describe the solution

Related: cloudflare/pages-action#29

It would be great if the CLI supported a global --json flag for producing JSON output for all commands. That would make leveraging the CLI in CI much more painless. The entire aformentioned github action could then be replaced by npx wrangler publish --json | jq ... to grab the relevant output for instance.

@fubhy fubhy added the enhancement New feature or request label Oct 12, 2022
@penalosa
Copy link
Contributor

Could you give an example of the type of output you'd like to see from npx wrangler publish --json?

@fubhy
Copy link
Author

fubhy commented Oct 12, 2022

For instance, when you run npx wrangler pages deployment list, you get Environment │ Branch │ Source│Deployment │ Status │ Build

For npx wrangler pages publish --json I'd expect the same values (and maybe others too, like number of deployed files, number of functions, function paths, etc. [?!]) in JSON format.

@caass
Copy link
Contributor

caass commented Oct 13, 2022

Ah ok, so essentially something like wrangler tail --format json but for publishing? Hmm...

@caass caass moved this to Untriaged in workers-sdk Oct 13, 2022
@caass caass moved this from Untriaged to Backlog in workers-sdk Oct 13, 2022
@fubhy
Copy link
Author

fubhy commented Oct 13, 2022

Yes. For all commands so thart the outout can easily be piped into e.g. 'jq' or used in other tools more easily without trying to parse it from human readable output

@caass caass added the chunky Bigger than most label Oct 13, 2022
@caass caass changed the title 🚀 Feature Request: Add a --json flag to produce machine-readable output 🚀 Feature Request: Make tail's format flag apply across all wrangler commands Oct 13, 2022
@caass caass changed the title 🚀 Feature Request: Make tail's format flag apply across all wrangler commands 🚀 Feature Request: Have something like tail's format flag for all wrangler commands Oct 13, 2022
@rohit-gohri
Copy link

This would also help with the github action - cloudflare/wrangler-action#77
Currently one has to find the deploy url in the logs of the action.

@mlafeldt
Copy link

Contributing to this worthwhile goal: #6570

@mxschumacher
Copy link

I stumbled upon parsing code that tediously processes wrangler's terminal output , I agree that it would be wonderful to have the option for JSON output everywhere. Please see: https://github.com/Dhravya/cloudflare-saas-stack/blob/main/scripts/setup.ts#L29 - it would unlock a lot of automatio, bot locally and in the deployment process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chunky Bigger than most enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants