mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +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:
+8
-1
@@ -1,9 +1,16 @@
|
||||
coder v0.0.0-devel
|
||||
|
||||
USAGE:
|
||||
coder whoami
|
||||
coder whoami [flags]
|
||||
|
||||
Fetch authenticated user info for Coder deployment
|
||||
|
||||
OPTIONS:
|
||||
-c, --column [URL|Username] (default: url,username)
|
||||
Columns to display in table output.
|
||||
|
||||
-o, --output text|json|table (default: text)
|
||||
Output format.
|
||||
|
||||
———
|
||||
Run `coder --help` for a list of global options.
|
||||
|
||||
Reference in New Issue
Block a user