@fathnakbar/devops-cli
v1.0.4
Published
DevOps multi-server deployment, Portainer stack orchestration, and environment management CLI
Maintainers
Readme
@fathnakbar/devops-cli
Multi-server deployment, Portainer stack orchestration, and environment/build-arg management CLI.
Deploy Docker Compose stacks, execute commands inside remote containers, synchronize environment variables, and manage multi-server Portainer hosts from a single CLI—without requiring SSH access.
Features
- 🌐 Multi-Server Management: Manage production, staging, and multi-cloud Portainer hosts from one place.
- 🚀 Zero-SSH Deployments: Build & push Docker images locally/CI, then trigger atomic stack redeployments with image pulling and pruning via Portainer CE APIs.
- 🧩 Smart Build-Arg & Env Engine: Static Dockerfile
ARGdetection, prefix resolution (NEXT_PUBLIC_,NUXT_PUBLIC_,VITE_), POSIX variable interpolation (${VAR:-default},${VAR:?error}), and secret masking. - 🔄 Remote Stack Env Sync: Compare local
.envvs live remote Portainer stacks (devops env diff), pull remote configurations (devops env pull), or push updates (devops env push). - 🔎 Remote Container Operations: Stream remote container logs (
devops logs), inspect container health (devops ps), and execute remote commands (devops execute). - ⚡ Universal Runtime: Runs natively on Bun, Node.js (v18+), npm, pnpm, or as a standalone binary.
Installation
Via NPM
npm install -g @fathnakbar/devops-cliVia Bun
bun add -g @fathnakbar/devops-cliOr Run on the Fly (npx)
npx @fathnakbar/devops-cli --helpQuick Start
1. Register a Remote Host
devops server add prod \
--url https://portainer.example.com \
--token ptr_xxxxxxxxxxxxxxxxxxxx \
--endpoint 1 \
--registry registry.example.com \
--pull-registry localhost:5000 \
--default2. Initialize in Your Repository
Run in any repository containing a docker-compose.yml:
devops init
# Or link a stack interactively:
devops stack --server prod3. Deploy
# Build, push to registry, and update remote Portainer stack
devops deploy all --server prod
# Deploy a single service
devops deploy backend --server prodCLI Reference
Deployments & Builds
devops deploy <service|all> [--server <name>] [--dry-run]
devops push <service|all> [--server <name>]
devops restart [service|all] [--server <name>]
devops stack [--server <name>]Environment & Build-Arg Management
devops env list [service] [--show-secrets] [--json]
devops env get <KEY>
devops env set <KEY>=<VALUE> [--server <name>] [--global]
devops env unset <KEY>
devops env diff [--server <name>]
devops env pull [--server <name>] [--output .env]
devops env push [--server <name>] [--dry-run]
devops env validateRemote Inspection & Exec
devops ps [--server <name>]
devops logs <service|container> [--server <name>] [--tail 100]
devops execute <service|container> <command...> [--server <name>]Server Management
devops server list
devops server add [name] [options]
devops server use <name>
devops server remove <name>
devops server test [name]
devops server show [name]
devops server import-env [name]License
MIT © Muhammad Fathan Akbar
