Skip to content

Add global --json, --auth, && --silent flag support #371

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

Merged
merged 28 commits into from
Jul 24, 2019
Merged

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

Todo:

@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.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy