Skip to content

Instantly share code, notes, and snippets.

@f9n
Created January 27, 2026 21:14
Show Gist options
  • Select an option

  • Save f9n/10360c2a96fc0b3044f2e09d1ad6f751 to your computer and use it in GitHub Desktop.

Select an option

Save f9n/10360c2a96fc0b3044f2e09d1ad6f751 to your computer and use it in GitHub Desktop.
Change teleport proxy
function tsh-x() {
# 1. List local profiles by looking at the keys directory and select via fzf
local selected_profile=$(ls -d ~/.tsh/keys/*/ 2>/dev/null | xargs -n 1 basename | fzf --height 15% --reverse --header="📡 Select Teleport Cluster")
# Exit if no selection is made (e.g., if ESC is pressed)
if [ -z "$selected_profile" ]; then
echo "No cluster selected."
return
fi
echo "🚀 Connecting to $selected_profile..."
# 2. Perform the login. tsh will automatically print the session status upon success.
tsh login --proxy="$selected_profile"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment