Skip to content

Commit 60f9a6b

Browse files
docs: add CLI handling to 013 spec
- Add FR-012: upstream list MUST handle new Health actions - Add CLI Hint column to Actions table - Add Phase 4: CLI Updates to plan.md - Add section 8: CLI Updates to quickstart.md
1 parent 6fa5883 commit 60f9a6b

3 files changed

Lines changed: 56 additions & 11 deletions

File tree

specs/013-structured-server-state/plan.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ internal/
3636
└── upstream/
3737
└── manager.go # Populate MissingSecret, OAuthConfigErr in input
3838
39+
# CLI (Go)
40+
cmd/mcpproxy/
41+
└── upstream_cmd.go # Add set_secret, configure action hints
42+
3943
# Frontend (Vue)
4044
frontend/src/
4145
├── components/
@@ -102,6 +106,16 @@ internal/
102106

103107
3. Update TypeScript types if needed (add new action values)
104108

109+
### Phase 4: CLI Updates
110+
111+
1. Update `cmd/mcpproxy/upstream_cmd.go` `outputServers()`:
112+
```go
113+
case "set_secret":
114+
actionHint = fmt.Sprintf("Set %s", health.Detail)
115+
case "configure":
116+
actionHint = "Edit config"
117+
```
118+
105119
## Verification
106120

107121
```bash

specs/013-structured-server-state/quickstart.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,32 @@ case 'configure':
187187

188188
Remove "System Diagnostics" banner (lines 3-33). The "Servers Needing Attention" banner handles all issues.
189189

190+
### 8. CLI Updates (cmd/mcpproxy/upstream_cmd.go)
191+
192+
Add handlers for new actions in `outputServers()`:
193+
194+
```go
195+
// Format action as CLI command hint
196+
actionHint := "-"
197+
switch healthAction {
198+
case "login":
199+
actionHint = fmt.Sprintf("auth login --server=%s", name)
200+
case "restart":
201+
actionHint = fmt.Sprintf("upstream restart %s", name)
202+
case "enable":
203+
actionHint = fmt.Sprintf("upstream enable %s", name)
204+
case "approve":
205+
actionHint = "Approve in Web UI"
206+
case "view_logs":
207+
actionHint = fmt.Sprintf("upstream logs %s", name)
208+
// New actions
209+
case "set_secret":
210+
actionHint = fmt.Sprintf("Set %s", healthDetail)
211+
case "configure":
212+
actionHint = "Edit config"
213+
}
214+
```
215+
190216
## Verification
191217

192218
```bash
@@ -209,5 +235,6 @@ cd frontend && npm run build
209235
| `internal/health/calculator.go` | Add missing secret/OAuth config checks |
210236
| `internal/upstream/manager.go` | Populate new input fields |
211237
| `internal/management/diagnostics.go` | Aggregate from Health |
238+
| `cmd/mcpproxy/upstream_cmd.go` | Add CLI hints for new actions |
212239
| `frontend/src/components/ServerCard.vue` | Handle new actions |
213240
| `frontend/src/views/Dashboard.vue` | Remove duplicate banner |

specs/013-structured-server-state/spec.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ As a developer, I want to see ONE consolidated health display on the Dashboard.
9191
- **FR-010**: Dashboard MUST display ONE consolidated health section
9292
- **FR-011**: Fix/action buttons MUST navigate to relevant pages, not show CLI hints
9393

94+
### CLI
95+
96+
- **FR-012**: `upstream list` MUST handle new Health actions with appropriate CLI hints
97+
9498
## Success Criteria
9599

96100
- **SC-001**: Users see exactly ONE health section on Dashboard
@@ -112,17 +116,17 @@ As a developer, I want to see ONE consolidated health display on the Dashboard.
112116

113117
### Actions (Updated)
114118

115-
| Scenario | Level | Action | Detail | Navigation |
116-
|----------|-------|--------|--------|------------|
117-
| Healthy | `healthy` | `""` | - | - |
118-
| Connecting | `degraded` | `""` | - | - |
119-
| Token expiring | `degraded` | `login` | expiry time | OAuth flow |
120-
| Connection error | `unhealthy` | `restart` | error message | Restarts server |
121-
| OAuth needed | `unhealthy` | `login` | - | OAuth flow |
122-
| Missing secret | `unhealthy` | `set_secret` | secret name | `/ui/secrets` |
123-
| OAuth config issue | `unhealthy` | `configure` | error/param | Server config tab |
124-
| Disabled | `healthy` | `enable` | - | Enables server |
125-
| Quarantined | `healthy` | `approve` | - | Approves server |
119+
| Scenario | Level | Action | Detail | Web UI | CLI Hint |
120+
|----------|-------|--------|--------|--------|----------|
121+
| Healthy | `healthy` | `""` | - | - | `-` |
122+
| Connecting | `degraded` | `""` | - | - | `-` |
123+
| Token expiring | `degraded` | `login` | expiry time | OAuth flow | `auth login --server=X` |
124+
| Connection error | `unhealthy` | `restart` | error message | Restarts server | `upstream restart X` |
125+
| OAuth needed | `unhealthy` | `login` | - | OAuth flow | `auth login --server=X` |
126+
| Missing secret | `unhealthy` | `set_secret` | secret name | `/ui/secrets` | `Set SECRET_NAME` |
127+
| OAuth config issue | `unhealthy` | `configure` | error/param | Server config tab | `Edit config` |
128+
| Disabled | `healthy` | `enable` | - | Enables server | `upstream enable X` |
129+
| Quarantined | `healthy` | `approve` | - | Approves server | `Approve in Web UI` |
126130

127131
## Out of Scope
128132

0 commit comments

Comments
 (0)