Skip to content

[Feature]: new vcluster prompt #26

Description

@SmarterOps

Problem or Use Case

This PR for introduces a new "vcluster prompt" command that outputs a shell prompt segment when the active Kubernetes context belongs to a vind cluster.

Example output:

(vind:demo)

The command outputs an empty string when the current context is not managed by vind.

Motivation

Users working with multiple Kubernetes clusters often rely on prompt indicators to avoid running commands against the wrong cluster. Python virtual environments, kube-ps1, and similar tools provide clear visual feedback about the current execution environment.

Today, vind users do not have an official way to display the active vind cluster in their terminal prompt.

Proposed Solution

Add a lightweight "vcluster prompt" command that:

  1. Detects the current Kubernetes context.
  2. Determines whether the context belongs to a vind cluster.
  3. Outputs a prompt segment such as "(vind:demo)".

This command can be integrated with Bash, Zsh, Fish, Starship, and other shell prompt frameworks without requiring the CLI to modify the user's shell environment.

Benefits

  • Clear visual indication of active vind context.
  • Prevents accidental operations against the wrong cluster.
  • Works across all major shells.
  • Avoids shell-specific hacks.
  • Follows established Kubernetes ecosystem patterns.

Example

PS1='$(vcluster prompt) '$PS1

Result:

(vind:demo) user@laptop:~$

Alternatives Considered

No response

Area

Other

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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