Skip to content

Add --format (plain | json) argument to display any output as formatted JSON or plain text (default) #1064

@cardoso

Description

@cardoso

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 fermyon/spin-vscode#1 and fermyon/spin-vscode#2 for instance while avoiding duplication of logic there.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions