gsc-cli

Overview

The gsc command surface grouped by area, with the global flags every command accepts.

Every command has -h/--help, and every command that returns data accepts -o json|yaml, plus -o csv for row-shaped results. The command reference lists every flag; these pages show how the groups fit together.

Groups

Global flags

FlagEffect
-s, --siteProperty: sc-domain:example.com, https://www.example.com/, or a bare host (or GSC_SITE)
--profileSaved profile (or GSC_PROFILE)
-o, --outputtable (default), json, yaml, or csv
--read-onlyBlock remote writes, local credential changes, and self-update
--dry-runFor write commands: print the request and send nothing
--yesConfirm destructive commands without a prompt
--no-inputNever prompt or open a browser
-q, --quiet / -v, --verboseFewer notes, or a log line per request, on stderr
--timeoutHTTP request timeout (default 30s)
--access-token, --credentialsCredential overrides; prefer GSC_ACCESS_TOKEN or GSC_CREDENTIALS

The property comes from --site, then GSC_SITE, then the profile's default site (set at login or with gsc sites use).

Account and setup

gsc auth status                                   # also: login, list, use, logout, token
gsc doctor --online                               # local checks plus one API call
gsc update --check
gsc completion zsh > "${fpath[1]}/_gsc"

Any API method

gsc api sends an authenticated request to the Search Console API, so a method Google adds later is usable the day it ships. PATH is relative to https://searchconsole.googleapis.com and must already be URL-escaped:

gsc api GET /webmasters/v3/sites
gsc api POST /webmasters/v3/sites/sc-domain%3Aexample.com/searchAnalytics/query --data '{"startDate":"2026-09-01","endDate":"2026-09-30"}'
gsc api PUT /webmasters/v3/sites/sc-domain%3Aexample.com/sitemaps/https%3A%2F%2Fexample.com%2Fsitemap.xml --dry-run

GET and the two read-only POSTs are reads. Every other request is treated as a write: blocked by --read-only, printed instead of sent with --dry-run, and confirmed (or --yes) before it is sent. --data takes JSON, @file, or - for stdin.

On this page