Target selection
Agent plugin providing skills and MCP server configurations for Kuberoutectl scenarios.
npx -y skills add ymedlop/kuberoutectl-skills --skill target-selectionAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 17 days oldThe repository was created 17 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Point kubectl at the right cluster, after proving it is the right one. Handles prompts like 'switch me to prod', 'use the EU cluster', 'which cluster am I on', 'get me credentials for X', 'am I on the right context'. USE FOR: listing and filtering targets, resolving an ambiguous alias to a full id, confirming scope and region and endpoint before switching, selecting a target, recording a selection without touching kubeconfig. DO NOT USE FOR: discovering clusters not in the inventory yet (use inventory-discovery), or troubleshooting a switch that failed (use access-triage).
The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
7.0 KB, ~1.6k tokens by cl100k_base, as published. Nobody here has run it
Target selection
Use this when the user wants kubectl pointed at a specific cluster — "switch
me to prod", "which one am I on?", "get me credentials for X".
target use fetches a cluster's credentials into ~/.kube/config and makes it the
current context — an immediate change to what the user's kubectl talks to. Most of
this skill is the verification that comes before that, because aliases and names
are convenience strings and neither is unique: the same cluster name routinely
exists in a dev subscription and a prod one.
Preconditions
- Inventory synced at least once —
inventory-discovery. - You know which environment the user means. Verification confirms a match; it cannot invent one. If you don't know, ask before selecting.
Commands
# read-only
kuberoutectl target list
kuberoutectl target list --all
kuberoutectl target list --wide
kuberoutectl target list --provider azure
kuberoutectl target list --selector env=prod
kuberoutectl target inspect <alias|id|name>
kuberoutectl current
# Tier 3 — rewrites ~/.kube/config and moves the active context
kuberoutectl target use <alias|id|name>
kuberoutectl target use <alias|id|name> --no-kubeconfig
Steps
- Find candidates.
target list, narrowed with--provideror--selector.--wideadds the full ID column. - Check ambiguity first. Count matches for the reference the user gave:
target list -o json, filter client-side onnameandalias. More than one match means the reference is unsafe — show the candidates with theirscope_idandregion, and ask. Never pick the first row. - Verify the identity facts.
target inspect <ref>→ID,Scope,Region,Endpoint.Scopeis the authority: the subscription / account / project a user can recognise. A name containing "prod" proves nothing. - Confirm in scope terms. Not "cluster-test?" but "the GKE cluster
cluster-testin projectproject-9adf…, regioneurope-west3— correct?" - Select using the full
idwhen the phrasing was loose. - Confirm it answers. Selection is not reachability:
kuberoutectl current,kubectl config current-context,kubectl cluster-info. The server address should matchendpoint. If it fails, go toaccess-triage.
--no-kubeconfig records the choice without touching kubeconfig or the active
context.
Reading the result
$ kuberoutectl target inspect cluster-test
Alias cluster-test
ID gcp:project-REDACTED:europe-west3:cluster-test
Region europe-west3
Endpoint https://203.0.113.10
Version 1.35.5
Health valid
Action use
Scope gcp:project:project-REDACTED
Credential gcp:account:[email protected]
| Field | What it proves |
|---|---|
id | The unambiguous handle — provider, scope, region, name |
scope_id | Which subscription / account / project. Separates prod from dev |
endpoint | Control plane address — the fingerprint to match against cluster-info |
credential_id | Which identity is used. Hands off to access-triage |
health / action_hint | Whether it is usable as of the last sync |
alias, name, and platform prove nothing about which environment you are in.
$ kuberoutectl current
Target cluster-test (cluster-test)
Health valid
Action use
Selected 7d ago
Last sync 1d ago
Selected and Last sync are two independent clocks — when the user chose it,
and how old the provider-derived health is. Say which you mean.
MCP tools
Prefer the tool; drop to the CLI only where none exists, and say so.
| Step | MCP tool | Fallback |
|---|---|---|
| Find candidates | list_targets (provider, selector) | — |
| Count matches for ambiguity | list_targets, filter client-side | — |
| Verify identity facts | get_target | — |
| Confirm current selection | get_status | — |
| Select | use_target + activate: true | full mode only; absent under --read-only |
| Record only, no kubeconfig | use_target, activate unset | full mode only |
| Confirm reachability | no tool | kubectl cluster-info |
Steps 1–4 — the whole verification half — work under --read-only. Only the
selection needs full mode, which is the boundary you want: an MCP client cannot move
a user's kubectl context by accident. Note get_target errors on an unknown
ref rather than returning empty. Map:
mcp-tools.
Fields
reading-output for fields and action_hint;
reference-resolution for alias vs id vs
name; selectors for grammar.
Safety
target list,inspect,currentare Tier 1. Verification changes nothing — and stopping when the answer is ambiguous is the correct outcome, not a failure.target useis Tier 3: it rewrites~/.kube/configand moves the active context. Confirm which cluster first, especially when prod and non-prod look alike.- If
target usereports a credential problem, go toaccess-triage.
Common pitfalls
- Acting on an alias the user said out loud.
cluster-testin dev and in prod are different targets. Resolve toidfirst. - Inferring environment from the name. "prod" in a name is a string;
scope_idis the fact. - Treating
Health validas live. It is the last sync's opinion. target usesucceeded,kubectlstill fails. Selection wrote kubeconfig; reachability is separate — network, RBAC, control plane.- Assuming the active context is what kuberoutectl last selected. Anything can
rewrite kubeconfig.
currentreports kuberoutectl's record;kubectl config current-contextreports reality. Compare both. - Missing that
targetalso answers toclustersandcluster.