Initial commit: console.fish

Signed-off-by: George Kaklamanos <gkaklas@gkaklas.gr>
This commit is contained in:
George Kaklamanos 2025-07-12 15:34:01 +03:00
parent 3484d073ee
commit 9da267410a
Signed by: gkaklas
GPG key ID: C0CAB8A6BDC9399D

11
console.fish Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env nix
#! nix --quiet --extra-experimental-features nix-command --extra-experimental-features flakes shell nixpkgs#fish nixpkgs#hcloud nixpkgs#jq nixpkgs#choose nixpkgs#urlencode nixpkgs#novnc nixpkgs#wl-clipboard --command fish
set console (hcloud server request-console $argv[1] -o json 2> /dev/null )
set path (echo $console|jq --raw-output .wss_url|choose -f "cloud" 1|urlencode)
set pass (echo $console|jq --raw-output .password)
echo $pass|wl-copy
echo "Password (copied): $pass"
echo "Path (auto-filled): $path"
xdg-open "http://localhost:6080/vnc.html?host=web-console.hetzner.cloud&port=443&path=$path" 2> /dev/null
novnc 2> /dev/null > /dev/null