mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
feat(cli): add formatting options to coder whoami (#19970)
This addresses a long-standing gripe of mine: to get your logged in
username you would have to do
```bash
coder whoami | awk '{print $9}'
```
This allows you to do:
```
coder whoami -o json | jq -r '.username'
```
or
```
coder whoami -f table -c username
```
This commit is contained in:
Generated
+21
-1
@@ -6,5 +6,25 @@ Fetch authenticated user info for Coder deployment
|
||||
## Usage
|
||||
|
||||
```console
|
||||
coder whoami
|
||||
coder whoami [flags]
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### -c, --column
|
||||
|
||||
| | |
|
||||
|---------|------------------------------|
|
||||
| Type | <code>[URL\|Username]</code> |
|
||||
| Default | <code>url,username</code> |
|
||||
|
||||
Columns to display in table output.
|
||||
|
||||
### -o, --output
|
||||
|
||||
| | |
|
||||
|---------|--------------------------------|
|
||||
| Type | <code>text\|json\|table</code> |
|
||||
| Default | <code>text</code> |
|
||||
|
||||
Output format.
|
||||
|
||||
Reference in New Issue
Block a user