Skip to content

Commit 1b8c9f5

Browse files
committed
Usability review and checklist updated
Signed-off-by: Kevin Stanley <stanleyk@objectcomputing.com>
1 parent ff2d115 commit 1b8c9f5

1 file changed

Lines changed: 190 additions & 13 deletions

File tree

specs/001-unityauth-cli/usability-recommendations.md

Lines changed: 190 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,22 @@ unityauth user list -t 1 -o json
2323
```
2424

2525
**Flag Mapping**:
26-
| Long Flag | Short Flag | Commands |
27-
|-----------|------------|----------|
28-
| `--tenant-id` | `-t` | user list, user create, user update, tenant users, permissions list |
29-
| `--format` | `-o` | All commands (global) |
30-
| `--verbose` | `-v` | All commands (global) |
31-
| `--email` | `-e` | user create, login |
32-
| `--role-ids` | `-r` | user create, user update |
33-
| `--first-name` | `-f` | user create, user update-profile |
34-
| `--last-name` | `-l` | user create, user update-profile |
35-
| `--password` | `-p` | user create, user update-profile |
36-
| `--service-id` | `-s` | permissions list |
26+
| Long Flag | Short Flag | Commands | Status |
27+
|-----------|------------|----------|--------|
28+
| `--tenant-id` | `-t` | user list, user create, user update, permissions list | ✅ Implemented |
29+
| `--format` | `-o` | All commands (global) | ✅ Implemented |
30+
| `--verbose` | `-v` | All commands (global) | ✅ Implemented |
31+
| `--role-ids` | `-r` | user create, user update | ✅ Implemented |
32+
| `--service-id` | `-s` | permissions list | ✅ Implemented |
33+
| `--email` | `-e` | user create, login | ⏸️ Deferred (infrequent use) |
34+
| `--first-name` | `-f` | user create, user update-profile | ⏸️ Deferred (infrequent use) |
35+
| `--last-name` | `-l` | user create, user update-profile | ⏸️ Deferred (infrequent use) |
36+
| `--password` | `-p` | user create, user update-profile | ⏸️ Deferred (security: prefer prompts) |
3737

3838
**Implementation**: Add `short_flag` parameter to Click options.
3939

40+
**Note**: Short flags were selectively added to the most frequently used options to avoid namespace pollution. Options like `--email`, `--first-name`, `--last-name`, and `--password` are typically only used once per command invocation and don't benefit as much from shorter typing. Additionally, `--password` is better handled via secure prompts than command-line flags.
41+
4042
---
4143

4244
### 1.2 Interactive Mode for Complex Commands
@@ -417,17 +419,183 @@ Errors:
417419
418420
---
419421
422+
## Priority 4 (Documentation)
423+
424+
### 4.1 Document `--dry-run` Flag
425+
426+
**Problem**: The `--dry-run` / `-n` flag was implemented but not documented in the user guide.
427+
428+
**Affected Commands**:
429+
- `user create --dry-run`
430+
- `user update --dry-run`
431+
- `user update-profile --dry-run`
432+
433+
**Files to Update**:
434+
- `docs/user-guide.md` - Add `--dry-run` option to each command's options table and examples
435+
436+
**Documentation to Add** (example for `user create`):
437+
438+
```markdown
439+
**Optional Options:**
440+
441+
| Option | Description |
442+
|--------|-------------|
443+
| `--dry-run`, `-n` | Preview changes without executing |
444+
445+
**Examples:**
446+
447+
\`\`\`bash
448+
# Preview user creation without actually creating
449+
unityauth user create --dry-run \
450+
--email user@example.com \
451+
--first-name John \
452+
--last-name Doe \
453+
--password "SecureP@ss123" \
454+
--tenant-id 1 \
455+
--role-ids "2,3"
456+
\`\`\`
457+
```
458+
459+
---
460+
461+
### 4.2 Document All Configuration Keys
462+
463+
**Problem**: The `config set` documentation only lists 3 keys but the implementation supports 10+.
464+
465+
**Current Documentation** (`docs/user-guide.md:273-280`):
466+
- `api_url`, `default_format`, `timeout`
467+
468+
**Missing Keys** (from `config.py:23-38`):
469+
- `api_version` - API version compatibility
470+
- `batch.max_size` - Maximum batch operation size
471+
- `batch.continue_on_error` - Continue on errors in batch mode
472+
- `batch.delay_ms` - Delay between batch API calls
473+
- `output.show_headers` - Show table headers
474+
- `output.table_style` - Table style (grid, simple, etc.)
475+
- `output.color_enabled` - Enable colored output
476+
477+
**Files to Update**:
478+
- `docs/user-guide.md` - Expand config set Available Keys table
479+
480+
**Documentation to Add**:
481+
482+
```markdown
483+
**Available Keys:**
484+
485+
| Key | Description | Default | Example |
486+
|-----|-------------|---------|---------|
487+
| `api_url` | UnityAuth API endpoint | `null` | `https://auth.example.com` |
488+
| `api_version` | API version for compatibility | `1.0` | `1.0` |
489+
| `default_format` | Default output format | `table` | `table`, `json`, `csv` |
490+
| `timeout` | Request timeout in seconds | `30` | `60` |
491+
| `batch.max_size` | Max records per batch operation | `1000` | `500` |
492+
| `batch.continue_on_error` | Continue batch on errors | `true` | `false` |
493+
| `batch.delay_ms` | Delay between batch calls (ms) | `0` | `100` |
494+
| `output.show_headers` | Show table headers | `true` | `false` |
495+
| `output.table_style` | Table formatting style | `grid` | `simple`, `plain` |
496+
| `output.color_enabled` | Enable colored output | `true` | `false` |
497+
498+
**Examples:**
499+
500+
\`\`\`bash
501+
# Set nested configuration using dot notation
502+
unityauth config set batch.max_size 500
503+
unityauth config set output.color_enabled false
504+
\`\`\`
505+
```
506+
507+
---
508+
509+
### 4.3 Add `init` to README Command Structure
510+
511+
**Problem**: The README command structure tree omits the `init` command.
512+
513+
**File to Update**: `README.md`
514+
515+
**Current** (line 117-138):
516+
```
517+
unityauth
518+
├── login
519+
├── logout
520+
...
521+
```
522+
523+
**Proposed**:
524+
```
525+
unityauth
526+
├── init # First-time setup wizard
527+
├── login # Authenticate with UnityAuth
528+
├── logout # Remove stored credentials
529+
...
530+
```
531+
532+
---
533+
534+
### 4.4 Add Installation Reference to User Guide
535+
536+
**Problem**: User guide has no installation instructions; users must find README first.
537+
538+
**File to Update**: `docs/user-guide.md`
539+
540+
**Proposed**: Add after the title/intro:
541+
542+
```markdown
543+
## Installation
544+
545+
See the [README](../README.md#installation) for installation instructions.
546+
547+
**Quick Install:**
548+
\`\`\`bash
549+
cd unityauth-cli
550+
python3 -m venv venv
551+
source venv/bin/activate
552+
python3 -m pip install -e .
553+
\`\`\`
554+
```
555+
556+
---
557+
558+
### 4.5 Add Quick Start to User Guide
559+
560+
**Problem**: User guide jumps straight into detailed command reference without a quick orientation.
561+
562+
**File to Update**: `docs/user-guide.md`
563+
564+
**Proposed**: Add after Installation section:
565+
566+
```markdown
567+
## Quick Start
568+
569+
\`\`\`bash
570+
# 1. First-time setup
571+
unityauth init
572+
573+
# 2. Or configure manually and login
574+
unityauth config set api_url https://auth.example.com
575+
unityauth login
576+
577+
# 3. Explore
578+
unityauth tenant list
579+
unityauth role list
580+
unityauth user list --tenant-id 1
581+
\`\`\`
582+
583+
For detailed command reference, see the sections below.
584+
```
585+
586+
---
587+
420588
## Implementation Checklist
421589
422590
### Phase 1: Quick Wins (P1)
423-
- [ ] Add short flags to all commands
591+
- [x] Add short flags to common commands (`-t`, `-o`, `-v`, `-r`, `-s`)
424592
- [ ] Add `whoami` command
425593
- [ ] Add interactive mode detection (`sys.stdin.isatty()`)
426594
- [ ] Implement interactive wizard for `user create`
427595
- [ ] Allow empty `--role-ids` to remove all roles from user
428596
429597
### Phase 2: Enhanced UX (P2)
430-
- [ ] Add `--dry-run` flag to mutating commands
598+
- [x] Add `--dry-run` flag to mutating commands
431599
- [ ] Add typo suggestions with `click-didyoumean`
432600
- [x] Create `unityauth init` setup wizard
433601
- [ ] Improve empty state messages with next steps
@@ -440,6 +608,13 @@ Errors:
440608
- [ ] Add confirmation prompts for destructive actions
441609
- [ ] Add Rich progress bars for batch operations
442610
611+
### Phase 4: Documentation (P4)
612+
- [x] Document `--dry-run` flag in user guide (user create/update/update-profile)
613+
- [ ] Document all configuration keys in user guide (config set section)
614+
- [ ] Add `init` command to README command structure tree
615+
- [ ] Add installation reference to user guide
616+
- [ ] Add quick start section to user guide
617+
443618
---
444619
445620
## Files to Modify
@@ -456,6 +631,8 @@ Errors:
456631
| `commands/batch.py` | Add `--dry-run`, Rich progress bars |
457632
| `utils/interactive.py` | New file for interactive prompts |
458633
| `pyproject.toml` | Add `click-didyoumean` dependency |
634+
| `docs/user-guide.md` | Add `--dry-run` docs, config keys, installation, quick start |
635+
| `README.md` | Add `init` to command structure tree |
459636
460637
---
461638

0 commit comments

Comments
 (0)