opsh

Write safer operational Bash scripts with opsh strict defaults and importable libraries.

4|2|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/alexanderguy/skills --skill opsh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opsh
Source: https://github.com/alexanderguy/skills/tree/main/skills/opsh
Command: npx skills add https://github.com/alexanderguy/skills --skill opsh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It eliminates inconsistent, fragile operational shell scripting by providing a curated opsh Bash environment with strict runtime defaults, predictable utilities, and a shared import-based library system.

Core Features & Use Cases

  • Strict, reliable runtime defaults: Enforces safer Bash behavior (errexit, nounset, pipefail, and better error propagation) to reduce silent failures during operations work.
  • Import-based standard libraries: Access reusable functionality via lib::import (for example: git, semver, ssh, cloud-init, path, and more).
  • Built-in primitives for common scripting needs: Consistent logging (log::info, log::warn, log::error, log::fatal), managed temp files/dirs (temp::file, temp::dir), arrays (array::split, array::join), and ordered step execution (steps::run).
  • Use Case: Debugging and deploying infrastructure tasks where you need reproducible scripts that fail fast, log clearly, and reuse proven helpers for versioning, SSH setup, and environment handling.

Quick Start

Use the opsh skill to run an imported-library script by asking: "Write an opsh script that checks whether the local git working tree is clean and prints the current version, failing with a clear error if the repo is dirty."

Frequently Asked Questions about opsh

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write safer Bash scripts for automation and deployment?

Safer Bash scripts use strict runtime defaults like errexit, nounset, and pipefail to reduce silent failures during operations work. This approach enforces fail-fast behavior and predictable error propagation in deployment and automation tasks.

What is the best way to manage dependencies in operational shell scripts?

Managing dependencies in operational shell scripts is best handled through an import-based standard library system. Using deterministic library access provides reusable functionality for tasks like version checks, SSH context handling, and path management.

How do I add structured logging to my Bash scripting workflow?

To add structured logging to your Bash scripting workflow, use built-in logging primitives that categorize output by severity. Standardized log levels ensure clear, consistent error reporting and operational visibility during infrastructure debugging and deployment.

Does this Bash scripting approach work for SSH context handling and cloud-init waits?

Yes, this Bash scripting approach works for SSH context handling and cloud-init waits by providing importable standard libraries specifically designed for these tasks. It ensures reproducible scripts that fail fast and log clearly for infrastructure environments.

Why do my operational Bash scripts fail silently during deployments?

Operational Bash scripts often fail silently during deployments because they lack strict runtime defaults like errexit and pipefail. Without predictable error propagation and managed temporary files, unexpected failures go unnoticed.