Opsfile

Like make, but for common live-ops commands

Create an Opsfile. Run ops prod rollback-cluster. Go back to sleep. (or just have claude do it)

$ ops prod tail-logs
Fetching logs from /aws/ecs/my-service-prod ...
$ ops prod check-alarms
No alarms in ALARM state. All clear.
$ claude "/ops:run are there any errors in staging?"
Running: ops staging error-rate โ†’ 0.04% (9 errors / 30 min)

Installation

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

Requires the ops CLI to be installed first โ€” use curl, Homebrew, or npm above.

/plugin marketplace add seanseannery/opsfile
/plugin install ops@opsfile

Getting Started

Step 1: Create an 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)"
or use the Claude plugin

Run /ops:init-opsfile to have Claude analyze your repo's tech stack and generate a tailored Opsfile automatically.

$ claude "/ops:init-opsfile"

Step 2: Run ops commands

Run commands with the following syntax:

$ ops [flags] <environment> <command> [args]
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-dPrint resolved commands without executing
--list-lList available commands and environments
--silent-sExecute commands without printing output
--version-vPrint the ops version and exit
--help-hShow usage information and exit

Examples:

$ ops preprod instance-count
$ ops prod open-dashboard
$ ops local logs
$ ops prod k8s -namespace myspace
or use the Claude plugin

Pass a command directly or describe what you need in plain English โ€” /ops:run discovers your available commands and resolves the best match.

$ claude "/ops:run prod tail-logs"
$ claude "/ops:run --list"
$ claude "/ops:run are there any errors in staging?"

Claude Code Plugin

Install the ops plugin once to unlock the Claude skill alternatives shown above.

Requires the ops CLI to be installed first โ€” install it above.

/plugin marketplace add seanseannery/opsfile
/plugin install ops@opsfile

Why use it?

โšก
Less Stress

Quickly find the right command during a live outage

๐Ÿค–
Less AI tokens

CLI > MCP. Agents run ops scripts instead of googling commands or loading large MCP context

๐Ÿ“–
Knowledge Sharing

Share runbooks with your team as code

๐Ÿ“ฆ
Encapsulation

Keep your Makefile focused on CI/CD

๐Ÿค
Team Standardisation

No more tribal knowledge or bespoke bash aliases. Opsfile lives in the repo.

๐Ÿ”’
Secrets-Safe by Design

Inject secrets from .env files with -e โ€” never commit them to your Opsfile.