Skip to content

Commit 49991fd

Browse files
committed
docs: update README with list command, global flags, and config options
- Add `list` command to commands table and full documentation section - Add `--output, -o` to global flags - Add `--refresh` to root and env command flags - Add `--provider` to revoke usage examples - Add `cache_ttl` to config example and fields - Add key features: list, JSON output, TTY detection
1 parent 21f5208 commit 49991fd

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

README.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ A CLI tool for elevating cloud permissions (Azure, AWS) via CyberArk Secure Clou
1717
- Entra ID group membership elevation via `grant --group` or `grant --groups`
1818
- Session revocation via `grant revoke`
1919
- Session status monitoring
20+
- Eligible target discovery via `grant list`
2021
- Local eligibility cache with configurable TTL
22+
- Machine-readable JSON output (`--output json`)
23+
- TTY detection with fail-fast for non-interactive environments
2124
- Secure token storage in system keyring
2225

2326
## Usage
@@ -46,13 +49,20 @@ grant --favorite prod-contrib
4649
grant --groups
4750
grant --group "Cloud Admins"
4851

52+
# List eligible targets (no elevation)
53+
grant list
54+
grant list --provider azure
55+
grant list --groups
56+
grant list --output json
57+
4958
# Check active sessions
5059
grant status
5160

5261
# Revoke sessions
53-
grant revoke # interactive multi-select
54-
grant revoke <session-id> # direct by ID
55-
grant revoke --all # revoke all
62+
grant revoke # interactive multi-select
63+
grant revoke <session-id> # direct by ID
64+
grant revoke --all # revoke all
65+
grant revoke --all --provider azure # revoke all for a specific provider
5666
```
5767

5868
## Installation
@@ -104,6 +114,7 @@ Running `grant` with no subcommand elevates cloud permissions (the core behavior
104114
|---------|-------------|
105115
| `configure` | Configure or reconfigure Identity URL and username (optional — `login` auto-configures on first run) |
106116
| `env` | Perform elevation and output AWS credential export statements (for `eval $(grant env)`) |
117+
| `list` | List eligible cloud targets and Entra ID groups without triggering elevation |
107118
| `login` | Authenticate to CyberArk Identity (auto-configures on first run, MFA handled interactively) |
108119
| `logout` | Clear cached tokens from keyring |
109120
| `status` | Show authentication state and active SCA sessions |
@@ -115,6 +126,7 @@ Running `grant` with no subcommand elevates cloud permissions (the core behavior
115126
### Global Flags
116127

117128
- `--verbose, -v` — Enable verbose output, including request/response details and timing
129+
- `--output, -o` — Output format: `text` (default) or `json` for machine-readable output
118130

119131
### configure
120132

@@ -141,7 +153,24 @@ This command:
141153
- Outputs only shell `export` statements (no human-readable messages)
142154
- Designed for AWS elevations — returns an error for Azure (which doesn't return credentials)
143155

144-
Supports the same flags as the root command: `--provider`, `--target`, `--role`, `--favorite`.
156+
Supports the same flags as the root command: `--provider`, `--target`, `--role`, `--favorite`, `--refresh`.
157+
158+
### list
159+
160+
List eligible cloud targets and Entra ID groups without triggering elevation. Useful for discovering what you can elevate to, and for programmatic consumption via JSON output.
161+
162+
```bash
163+
grant list # all targets and groups
164+
grant list --provider azure # cloud targets for a specific provider
165+
grant list --groups # Entra ID groups only
166+
grant list --output json # machine-readable JSON
167+
grant list --refresh # bypass eligibility cache
168+
```
169+
170+
**Flags:**
171+
- `--provider, -p` — Filter by cloud provider: `azure`, `aws`
172+
- `--groups` — Show only Entra ID groups (mutually exclusive with `--provider`)
173+
- `--refresh` — Bypass eligibility cache and fetch fresh data
145174

146175
### login
147176

@@ -174,6 +203,7 @@ Running `grant` with no subcommand requests JIT (just-in-time) permission elevat
174203
- `--favorite, -f` — Use a saved favorite alias (combines provider, target, and role)
175204
- `--groups` — Show only Entra ID groups in the interactive selector
176205
- `--group, -g` — Group name for direct group membership elevation
206+
- `--refresh` — Bypass eligibility cache and fetch fresh data
177207

178208
**Target matching:**
179209
- Matches by workspace name (case-insensitive, partial match)
@@ -236,6 +266,7 @@ Application settings including default provider and favorites.
236266
```yaml
237267
profile: grant # SDK profile name
238268
default_provider: azure # Default cloud provider
269+
cache_ttl: 4h # Eligibility cache TTL (Go duration syntax)
239270

240271
favorites:
241272
prod-contrib:
@@ -251,6 +282,7 @@ favorites:
251282
**Fields:**
252283
- `profile` — Name of the SDK profile in `~/.idsec_profiles/` (default: `grant`)
253284
- `default_provider` — Default cloud provider for elevation (used when `--provider` is omitted)
285+
- `cache_ttl` — Eligibility cache TTL as a Go duration string (default: `4h`; e.g., `2h`, `30m`)
254286
- `favorites` — Map of favorite names to provider/target/role combinations
255287

256288
### Environment Variables

0 commit comments

Comments
 (0)