spinframework / spinframework/spin
Add --format (plain | json) argument to display any output as formatted JSON or plain text (default)
@me-diru is already working on this.
Since Jun 19, 2024.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 310
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 24
Description
From clig.dev:
Display output as formatted JSON if --json is passed. JSON allows for more structure than plain text, so it makes it much easier to output and handle complex data structures. jq is a common tool for working with JSON on the command-line, and there is now a whole ecosystem of tools that output and manipulate JSON.
It is also widely used on the web, so by using JSON as the input and output of programs, you can pipe directly to and from web services using curl.
My use-case for this would be a web-based dashboard that can perform some operations like build, up, and deploy. Ideally the spin command itself and any subcommands would obey this flag.
This could also help with adding features to the vscode extension like https://github.com/fermyon/spin-vscode/issues/1 and https://github.com/fermyon/spin-vscode/issues/2 for instance while avoiding duplication of logic there.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.