Like make, but for common live ops commands
Create an Opsfile. Run ops prod rollback-cluster. Go back to sleep.
curl -fsSL https://seanseannery.github.io/opsfile/install.sh | bash
brew tap seanseannery/opsfile https://github.com/seanseannery/opsfile
brew install seanseannery/opsfile/opsfile
npm install -g github:seanseannery/opsfile
Create an Opsfile in your repo root. It uses Makefile-style syntax:
# Variables โ prefix with environment name to scope them
prod_AWS_ACCOUNT=1234567
preprod_AWS_ACCOUNT=8765431
# Commands โ define per-environment shell lines
# Use "default" as a fallback when env-specific block is absent
tail-logs:
default:
aws logs tail /aws/ecs/my-service --follow --since 30m
local:
docker logs myapp --follow --tail 100
list-instance-ips:
prod:
aws ec2 describe-instances --filters "Name=tag:Env,Values=prod" --query "Reservations[*].Instances[*].PrivateIpAddress" --output text
preprod:
aws ecs list-container-instances --cluster my-cluster-preprod --output text
# Shell env vars are injected automatically โ ops falls back to env if not in Opsfile
show-profile:
default:
echo "Using AWS profile: $(AWS_PROFILE)"
Run commands with the following syntax:
| Flag | Short | Description |
|---|---|---|
--directory <path> | -D <path> | Use the Opsfile in the given directory |
--env-file <path> | -e <path> | Load secrets from a .env file (defaults to .ops_secrets.env) |
--dry-run | -d | Print resolved commands without executing |
--list | -l | List available commands and environments |
--silent | -s | Execute commands without printing output |
--version | -v | Print the ops version and exit |
--help | -h | Show usage information and exit |
Quickly find the right command during a live outage
Let agents run ops scripts instead of googling commands
Share runbooks with your team as code
Keep your Makefile focused on CI/CD
No more tribal knowledge or bespoke bash aliases. Opsfile lives in the repo.
Inject secrets from .env files with -e โ never commit them to your Opsfile.