Skip to content

Commit 5bb76e8

Browse files
committed
examples
1 parent 3cdd359 commit 5bb76e8

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

pkg/cmd/auth/status/status.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,23 @@ func NewCmdStatus(f *cmdutil.Factory, runF func(*StatusOptions) error) *cobra.Co
136136
To change the active account for a host, see %[1]sgh auth switch%[1]s.
137137
`, "`"),
138138
Example: heredoc.Doc(`
139-
# Show authentication status for all accounts on all hosts
139+
# Display authentication status for all accounts on all hosts
140140
$ gh auth status
141141
142-
# Show authentication status for active accounts on a specific host
143-
$ gh auth status --hostname github.example.com --active
142+
# Display authentication status for the active account on a specific host
143+
$ gh auth status --active --hostname github.example.com
144144
145-
# Show the authentication status with json output
146-
$ gh auth status --json active,token,host,login
145+
# Display tokens in plain text
146+
$ gh auth status --show-token
147147
148-
# Gets the access token of the github.com active account
149-
$ gh auth status -a --json token --jq '.["github.com"][0].token'
148+
# Format authentication status as JSON
149+
$ gh auth status --json active,login,host
150+
151+
# Include plain text token in JSON output
152+
$ gh auth status --json token,login
153+
154+
# Format output as a flat JSON array
155+
$ gh auth status --json active,host,login --jq add
150156
`),
151157
RunE: func(cmd *cobra.Command, args []string) error {
152158
if err := cmdutil.MutuallyExclusive(

0 commit comments

Comments
 (0)