Skip to content

Feature: Update kdm watch command to be interactive #137

@utkarsh232005

Description

@utkarsh232005

🎯 Goal

Enhance the existing kdm watch live dashboard into a feature-rich split-pane TUI with resource actions, detail overlays, and inline AI diagnostics.


📌 Current Behavior

kdm watch launches an interactive real-time TUI dashboard that auto-refreshes status and metrics. Press Ctrl+C to exit.

Example usage:

kdm watch

🚀 Proposed Interactive Dashboard

Layout

┌──────────────────────┬──────────────────────┐
│   Kubernetes Pods    │   Docker Containers  │
├──────────────────────┼──────────────────────┤
│ > nginx        ✔     │   api-server    ✔    │
│   redis        ✔     │   postgres      ✔    │
│   backend      ✖     │   cache         ✖    │
└──────────────────────┴──────────────────────┘

Detail Panel (for selected resource)
──────────────────────────────────────
  Name:   nginx
  Status: Running
  CPU:    30%
  RAM:    220MB
──────────────────────────────────────
[L] Logs  [A] AI Analysis  [R] Restart  [Q] Quit

User Flow

  1. Dashboard loads with a split-pane grid — Kubernetes on the left, Docker on the right.
  2. Press Tab or / to switch focus between panels. The active panel highlights its border.
  3. Use / to select a resource. The detail panel below updates automatically.
  4. Press action keys for the selected resource:
    • l → Stream live logs.
    • a → Run AI diagnosis and display explanation:
    AI Diagnosis
    ─────────────
    Possible root cause:
    Container cannot connect to Redis.
    
    Recommended:
    kubectl describe pod backend
    
    • r → Restart the selected resource.
  5. Press Q to quit.

Keyboard Shortcuts

Key Action
Tab / / Switch focus between panels
/ Navigate resources
l Stream logs for selected resource
a Run AI analysis
r Restart selected resource
Q Quit

Recommended Libraries

Component Library
Split-pane layout Ink <Box> with flexDirection="row" + yoga-layout
Resource list ink-select-input
Colors chalk

📋 Contribution Workflow

  1. Fork the repo and create a feature branch (e.g., feature/interactive-kdm-watch).
  2. Implement the interactive TUI for kdm watch using the layout and flow described above.
  3. Submit a PR explicitly linked to this issue (e.g., Closes #137).
  4. 📸 Include a screenshot or recording of the implemented UI in your PR to verify the new dashboard experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions