Skip to content

Conversation

@DavidWells
Copy link
Contributor

To better support programatic use cases, this PR adds --json flag support for relevant commands.

This will disable normal CLI logging and only output json for the user to parse and use elsewhere

Example:

image

Depends on netlify/netlify-dev-plugin#224 & netlify/cli-utils#13

@DavidWells
Copy link
Contributor Author

DavidWells commented Jul 22, 2019

@DavidWells DavidWells changed the title Add --json flag support Add Global --json, --auth, && --silent flag support Jul 22, 2019
@DavidWells DavidWells changed the title Add Global --json, --auth, && --silent flag support Add global --json, --auth, && --silent flag support Jul 22, 2019
@DavidWells
Copy link
Contributor Author

DavidWells commented Jul 23, 2019

Example commands:

Some commands use https://stedolan.github.io/jq/ to parse json

--json Outputs returned data as JSON for further processing.

netlify sites:list --json | jq '.[0]'
netlify deploy --json | jq '.site_id'
netlify addons:list --json

--silent silences all logs in a command

netlify deploy --silent

--auth allows for the auth flag to be passed into any command.

netlify status --auth otherAccountToken

@DavidWells DavidWells merged commit 4ec5c13 into master Jul 24, 2019
@DavidWells DavidWells deleted the addJsonSupport branch July 24, 2019 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants