Loading...
Loading...
Use when debugging services on a user's dedicated server via SSH. Use when needing to run a command on the server, inspect pods, check container logs, view k8s resources, or run kubectl commands. Use when "service exec" is insufficient and you need server-level access. Use when user says "check my server", "run X on my server", "debug pod", "kubectl", "SSH into server", "check k8s", or "inspect cluster".
npx skill4agent add zeabur/agent-skills zeabur-server-sshAlways useto invoke Zeabur CLI. Never usenpx zeabur@latestdirectly or any other installation method.zeabur
kubectlcommand not foundserver execnpx zeabur@latest server get <server-id> -i=false --json | jq -r .osZeaburOSUbuntuserver listOSosNeeds CLI 0.21.0 or newer. Ifcomes backos, the CLI is older — either letnullfetch the current version, or fall back to the API (see thenpx zeabur@latestskill for the token setup that defineszeabur-server-rent):$ZAPI_CFGbashcurl -sS --max-time 30 -K "$ZAPI_CFG" https://api.zeabur.com/graphql \ -H "Content-Type: application/json" \ -d '{"query":"query($id: ObjectID!) { server(_id: $id) { hasK3s } }","variables":{"id":"<server-id>"}}'is three-state and the third state is a trap:hasK3sis ZeaburOS,trueis Ubuntu only, andfalseis a server predating the field — which does run ZeaburOS. So the test isnull, neverhasK3s === false; the latter sweeps in every older server and wrongly reports it as a plain VPS.!hasK3s
kubectlcommand not foundzeabur-server-rentkubectlserver execssh2sshpassnpx zeabur@latest server exec --id <server-id> -- <command># Single command
npx zeabur@latest server exec --id <server-id> -- sudo kubectl get pods -A -o wide
# Compound command — quote it as ONE argument so && / | stay intact
npx zeabur@latest server exec --id <server-id> -- 'echo "=== PODS ===" && sudo kubectl get pods -A && echo "=== EVENTS ===" && sudo kubectl get events -A --sort-by=.lastTimestamp | tail -20'--ssh host <command>&&|… | tailnpx zeabur@latest server list -i=falsezeabur-server-listZeaburOS servers only. On a plain Ubuntu VPS these all fail with— see the section above.kubectl: command not found
server execsudo kubectl|&&server exec --id <id> -- 'sudo kubectl top pods -A --sort-by=memory | head -20'| Task | Command |
|---|---|
| List all pods | |
| Problem pods only | |
| Pod logs | |
| Exec into container | |
| Node resources | |
| Pod resources | |
| Describe pod | |
| Recent events | |
| Restart deployment | |
server execserver execserver execnpx zeabur@latest server ssh-info --id <server-id> -i=false{"ip":"1.2.3.4","port":22,"username":"root","password":"xxx"}ssh2sshpasswhich sshpass# sshpass (only if already known to be available)
sshpass -p '<password>' ssh -o StrictHostKeyChecking=no -p <port> <username>@<ip> sudo kubectl get pods -A# Node.js ssh2 (the Zeabur agent sandbox has it pre-installed)
NODE_PATH=$([ -d /root/.global/node_modules ] && echo /root/.global/node_modules || echo /home/vercel-sandbox/.global/node_modules) node -e "
const {Client} = require('ssh2');
const c = new Client();
c.on('ready', () => {
c.exec('<command>', (err, stream) => {
if (err) { console.error(err); process.exit(1); }
let out = '', errOut = '';
stream.on('data', d => out += d);
stream.stderr.on('data', d => errOut += d);
stream.on('close', code => {
if (out) console.log(out);
if (errOut) console.error(errOut);
c.end();
process.exit(code);
});
});
}).connect({host:'<ip>', port:<port>, username:'<username>', password:'<password>'});
"&&server exec-o wide-A-n <namespace>sudo kubectl exec <pod> -n <ns> -- cat /app/README.mdzeabur-server-listzeabur-service-exec