Skip to main content

resq-deploy

Version: v0.1.16 · License: Apache-2.0 · Crate: crates.io · API docs: docs.rs
Interactive deployment manager for ResQ environments — Docker Compose and Kubernetes TUI

Overview

Crates.io License Interactive deployment manager for ResQ environments. Provides a three-panel Ratatui TUI for managing Docker Compose and Kubernetes deployments across dev, staging, and production, plus a non-interactive --action flag for CI/CD pipelines and scripting.

Overview

resq-deploy wraps docker compose and kubectl behind a unified interface. Operators select a target environment and service, pick an action, and watch real-time execution output — all without leaving the terminal. For automation, every action is accessible via a single CLI invocation that streams output to stdout and exits with the process status code.

Architecture

Installation

# From the workspace root
cargo install --path crates/resq-deploy

# Or build locally
cargo build --release -p resq-deploy
# Binary: target/release/resq-deploy

CLI Arguments

FlagShortDefaultDescription
--env <ENV>devTarget environment: dev, staging, or prod
--service <NAME>allScope action to a single service
--k8soffUse Kubernetes backend instead of Docker Compose
--action <ACTION>Run a single action non-interactively and exit

Usage Examples

Interactive TUI (default)

# Launch with defaults (dev environment, Docker Compose)
resq-deploy

# Target staging environment
resq-deploy --env staging

# Kubernetes mode against production
resq-deploy --k8s --env prod

Non-Interactive / CI Mode

# Bring up the dev stack
resq-deploy --env dev --action up

# Deploy to production via Kubernetes
resq-deploy --env prod --k8s --action deploy

# Restart a single service
resq-deploy --env dev --service infrastructure-api --action restart

# Tear down staging
resq-deploy --env staging --action down

# View logs for a specific service
resq-deploy --env dev --service coordination-hce --action logs

CI Pipeline Example

# Build, deploy, and gate on health
resq-deploy --env dev --action up
resq-health --check || { echo "Services not ready"; exit 1; }

# Production Kubernetes deploy
resq-deploy --env prod --k8s --action deploy

TUI Layout

+-- Services ----------+-- Actions ----------+-- Execution Log ----------------+
|                      |                     |                                 |
| > infrastructure-api |   > status          | [14:22:01] Starting up...       |
|   coordination-hce   |     build           | [14:22:02] infra-api OK         |
|   intelligence-pdie  |     up              | [14:22:03] coord-hce OK         |
|   web-dashboard      |     down            | [14:22:04] All services up      |
|                      |     restart         |                                 |
|                      |     logs            |                                 |
+----------------------+---------------------+---------------------------------+
| ENV: DEV   [E] cycle env   [Tab] focus   [Up/Down] select   [Enter] run     |
| [Q] quit                                                                     |
+------------------------------------------------------------------------------+

Keyboard Shortcuts

KeyAction
q / EscQuit
TabCycle focus between Services and Actions panels
Up / kMove selection up in focused panel
Down / jMove selection down in focused panel
EnterExecute the selected action on the selected service
eCycle environment: dev -> staging -> prod -> dev

Docker Compose Actions

ActionDescriptionUnderlying Command
statusShow container status for all servicesdocker compose ps --format json
buildBuild images for one or all servicesdocker compose build [service]
upStart services in detached mode with builddocker compose up -d --build [service]
downStop and remove all containersdocker compose down
restartRestart one or all servicesdocker compose restart [service]
logsTail last 100 log lines (streaming)docker compose logs -f --tail 100 [service]

Kubernetes Actions

ActionDescriptionUnderlying Command
statusList pods in the environment namespacekubectl get pods -n resq-<env> -o wide
deployApply Kustomize overlay for the environmentkubectl apply -k infra/k8s/overlays/<env>
destroyDelete resources from overlay (safe ignore)kubectl delete -k infra/k8s/overlays/<env> --ignore-not-found
logsStream logs from a specific deploymentkubectl logs -f deployment/<service> -n resq-<env>

Managed Services

The following services are tracked by default:
ServiceDescription
infrastructure-apiCore platform API
coordination-hceCoordination engine
intelligence-pdieIntelligence/ML engine
web-dashboardFrontend web application

Environment Configuration

EnvironmentDocker Compose FilesK8s Overlay Path
devdocker-compose.yml + docker-compose.dev.ymlinfra/k8s/overlays/dev
stagingdocker-compose.yml (base only)infra/k8s/overlays/staging
proddocker-compose.yml + docker-compose.prod.ymlinfra/k8s/overlays/prod
Docker Compose files are resolved relative to <project_root>/infra/docker/. Kubernetes overlays are resolved relative to <project_root>/infra/k8s/overlays/<env>. The project root is auto-detected by ascending two directory levels from the current working directory.

Environment Variables

resq-deploy does not currently read environment variables for configuration. All settings are controlled via CLI flags. Docker and kubectl inherit the calling shell’s environment (e.g., DOCKER_HOST, KUBECONFIG).

Dependencies

CratePurpose
resq-tuiShared TUI components, theme, header/footer widgets
clapCLI argument parsing (derive mode)
tokioAsync runtime for background task management
serde / serde_jsonJSON deserialization of docker compose ps output
chronoTimestamp handling
anyhowError propagation

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.