| Crates.io | waitup |
| lib.rs | waitup |
| version | 1.1.1 |
| created_at | 2025-08-19 16:30:31.983197+00 |
| updated_at | 2025-10-22 08:11:46.638507+00 |
| description | Wait for TCP ports and HTTP endpoints to be available. Essential for Docker, K8s, and CI/CD pipelines to ensure services are ready before proceeding. |
| homepage | https://github.com/grok-rs/waitup |
| repository | https://github.com/grok-rs/waitup |
| max_upload_size | |
| id | 1802153 |
| size | 392,970 |
A lightweight CLI tool for waiting until TCP ports and HTTP endpoints become available. Perfect for Docker containers, Kubernetes, and CI/CD pipelines.
# Install from source
git clone https://github.com/grok-rs/waitup.git
cd waitup
cargo install --path .
# Wait for a TCP port
waitup localhost:5432
# Wait for HTTP endpoint
waitup https://api.example.com/health --expect-status 200
# Run command after service is ready
waitup postgres:5432 -- npm start
cargo install waitup
git clone https://github.com/grok-rs/waitup.git
cd waitup
cargo install --path .
# Pull from GitHub Container Registry
docker pull ghcr.io/grok-rs/waitup:latest
docker pull ghcr.io/grok-rs/waitup:alpine
# Or build locally
# Standard image (92MB)
docker build -t waitup .
# Alpine image (3MB)
docker build -f Dockerfile.alpine -t waitup:alpine .
Download from releases.
# Wait for TCP port with timeout
waitup localhost:8080 --timeout 30s
# Wait for multiple services
waitup db:5432 redis:6379 api:8080
# Wait for any service to be ready
waitup primary-db:5432 backup-db:5432 --any
# HTTP health check with custom headers
waitup https://api.example.com/health \
--header "Authorization:Bearer token" \
--expect-status 200
services:
app:
image: myapp
depends_on:
- db
entrypoint: ["/bin/sh", "-c"]
command:
- |
waitup db:5432 --timeout 60s -- npm start
db:
image: postgres:15
# Or use as separate service
wait-for-db:
image: ghcr.io/grok-rs/waitup:alpine
command: ["db:5432", "--timeout", "60s"]
depends_on:
- db
initContainers:
- name: wait-for-db
image: ghcr.io/grok-rs/waitup:alpine
command: ["waitup", "postgres:5432", "--timeout", "5m"]
waitup [OPTIONS] <TARGETS>... [-- <COMMAND>...]
Options:
--timeout <DURATION> Total timeout (default: 30s)
--interval <DURATION> Initial retry interval (default: 1s)
--max-interval <DURATION> Maximum retry interval (default: 30s)
--connection-timeout <DURATION> Per-attempt timeout (default: 10s)
--expect-status <CODE> Expected HTTP status (default: 200)
--header <KEY:VALUE> Custom HTTP headers
--any Wait for any target (default: all)
--verbose Show detailed progress
--quiet No output except errors
--json JSON output format
-h, --help Print help
-V, --version Print version
Use human-readable duration formats:
30s - 30 seconds2m - 2 minutes1h30m - 1 hour 30 minutes500ms - 500 milliseconds0 - Success, all targets are reachable1 - Timeout, failed to connect within timeout2 - Invalid arguments or configuration3 - Command execution failed (when using --)Set defaults to avoid repetitive flags:
export WAITUP_TIMEOUT=60s
export WAITUP_INTERVAL=2s
waitup db:5432 # Uses environment defaults
# Bash
waitup --generate-completion bash > ~/.local/share/bash-completion/completions/waitup
# Zsh
waitup --generate-completion zsh > ~/.local/share/zsh/site-functions/_waitup
# Fish
waitup --generate-completion fish > ~/.config/fish/completions/waitup.fish
# Wait for PostgreSQL before migrations
waitup postgres:5432 --timeout 60s -- npm run migrate
# Wait for multiple databases
waitup mysql:3306 redis:6379 postgres:5432 -- npm start
# Wait for dependencies with health checks
waitup \
https://auth-service/health \
https://user-service/health \
--timeout 2m \
-- ./start-gateway.sh
# Wait for test services
waitup localhost:5432 localhost:6379 --timeout 30s -- npm test
# Build
cargo build
# Run tests
cargo test
# Install locally
cargo install --path .
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
MIT License - see LICENSE file for details.
Similar tools for service orchestration:
Report vulnerabilities at SECURITY.md.