Loading...
Loading...
Use when running commands inside a Zeabur service container. Use for one-off database operations like queries, data cleanup, or migrations (e.g. mongosh, psql, mysql, redis-cli). Use when user says "exec into container", "run command in service", "query database", "delete from database", "run mongo command", "run SQL", "check files in container", "debug inside service", or "shell into service". Use for container-level debugging like checking env vars, files, processes, or connectivity. NOT for deploying databases (use zeabur-template-deploy instead).
npx skill4agent add zeabur/agent-skills zeabur-service-execAlways useto invoke Zeabur CLI. Never usenpx zeabur@latestdirectly or any other installation method. Ifzeaburis not available, install Node.js first.npx
--npx zeabur@latest service exec --id <service-id> -- <command> [args...]# MongoDB - query, update, delete data
npx zeabur@latest service exec --id <mongodb-service-id> -- mongosh --eval 'db.users.find({})'
npx zeabur@latest service exec --id <mongodb-service-id> -- mongosh --eval 'db.sessions.deleteMany({title: /test/i})'
# PostgreSQL - run SQL queries (PGPASSWORD is set automatically in Zeabur containers)
npx zeabur@latest service exec --id <pg-service-id> -- psql -U postgres -c 'SELECT * FROM users LIMIT 10;'
# MySQL - run SQL queries (use env var to avoid interactive password prompt)
npx zeabur@latest service exec --id <mysql-service-id> -- sh -c 'mysql -u root -p"$MYSQL_ROOT_PASSWORD" -e "SHOW DATABASES;"'
# Redis - run commands
npx zeabur@latest service exec --id <redis-service-id> -- redis-cli KEYS '*'# List files
npx zeabur@latest service exec --id <service-id> -- ls -la
# Check environment variables
npx zeabur@latest service exec --id <service-id> -- env
# Check a specific env var
npx zeabur@latest service exec --id <service-id> -- sh -c "echo \$DATABASE_URL"
# Test database connectivity
npx zeabur@latest service exec --id <service-id> -- sh -c "nc -zv postgres 5432"
# Check running processes
npx zeabur@latest service exec --id <service-id> -- ps aux
# Read a config file
npx zeabur@latest service exec --id <service-id> -- cat /app/config.json
# Check disk usage
npx zeabur@latest service exec --id <service-id> -- df -h| Flag | Description |
|---|---|
| Service ID |
| Service name (prefer |
| Environment ID (if multiple environments) |
--sh -c "..."shbashsh -c "echo \$VAR"zeabur-service-listzeabur-deployment-logszeabur-variables