Skip to content

Feature: Update kdm show command to be interactiveΒ #135

@utkarsh232005

Description

@utkarsh232005

🎯 Goal

Convert the kdm show command from a static CLI table output into a fully interactive TUI dashboard β€” similar to tools like k9s, LazyDocker, and btop.


πŸ“Œ Current Behavior

kdm show retrieves and displays workload resources or cluster metadata in plain, formatted tables.

Subcommands:

Subcommand Description
kdm show runners Combined table of all active Kubernetes pods and Docker containers
kdm show pods Kubernetes pods only
kdm show containers Docker containers only
kdm show nodes Kubernetes cluster node details
kdm show minikube Local Minikube profile and connection status

Example usage:

kdm show runners
kdm show pods
kdm show minikube

πŸš€ Proposed Interactive Dashboard

Since KDM is built with Ink (React for CLIs), the goal is to build a fully interactive TUI β€” not static terminal output.

Architecture

kdm show
   β”‚
   β–Ό
Ink React Component
   β”œβ”€β”€ useInput() β€” keyboard event handler
   β”œβ”€β”€ useState() β€” active tab, search query, selected row
   β”œβ”€β”€ Kubernetes / Docker API layer β€” fetch resources
   └── Modal overlay component β€” resource details
   β”‚
   β–Ό
Terminal UI

Layout

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Pods  |  Containers  |  Nodes  |  Runners  | Minikube β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Search: nginx                                        πŸ” β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ NAME          STATUS      AGE       CPU      MEMORY    β”‚
│────────────────────────────────────────────────────────│
β”‚ nginx-123     Running     2h        15%      120MB     β”‚
β”‚ backend-api   CrashLoop   30m       40%      300MB     β”‚
β”‚ redis-cache   Running     5h        8%       90MB      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ TAB:Switch  /:Search  ENTER:Details  Q:Quit           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

User Flow

  1. User runs kdm show β†’ default Pods tab loads.
  2. Press β†’ / ← or Tab / Shift+Tab to switch between tabs.
  3. Press / to activate the search bar β€” the table filters instantly as you type.
  4. Use ↑ / ↓ to navigate rows.
  5. Press Enter on a row to open a detail overlay popup:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ nginx-123              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Status : Running       β”‚
β”‚ CPU    : 15%           β”‚
β”‚ Memory : 120MB         β”‚
β”‚ Node   : worker-01     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. Press Esc to dismiss the overlay. Press Q to quit.

Keyboard Shortcuts

Key Action
← / β†’ / Tab Switch tabs
↑ / ↓ Navigate table rows
/ Activate search filter
Enter Open resource detail overlay
Esc Close overlay
Q Quit

Recommended Libraries

Component Library
Tabs ink-tab
Search Input ink-text-input
Table ink-table
Colors chalk
Layout Ink <Box> with flexbox

πŸ“‹ Contribution Workflow

  1. Fork the repo and create a feature branch (e.g., feature/interactive-kdm-show).
  2. Implement the interactive TUI for kdm show using the layout and flow described above.
  3. Submit a PR explicitly linked to this issue (e.g., Closes #135).
  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