AI for Bash & Python Automation
Generate, review, and harden automation scripts. Idempotent, safe, production-ready.
Prompts
- Intermediate
Bash Script Safety & Portability Review Prompt
Audit an existing Bash script line by line for unsafe quoting, missing strict mode, destructive commands, race conditions, and bashisms that break portability, and return prioritized fixes.
- Claude
- ChatGPT
Open prompt - Intermediate
Trap-Driven Cleanup & Rollback Bash Script Prompt
Write a robust Bash script that uses set -euo pipefail plus EXIT/ERR/INT traps to guarantee temp-file cleanup and partial-work rollback even when a command fails midway.
- Claude
- ChatGPT
Open prompt - Intermediate
Convert a Fragile Bash Pipeline to Python Prompt
Rewrite an overgrown, fragile Bash script full of pipes, subshells, and string parsing into a maintainable Python program with proper error handling, types, and tests.
- Claude
- ChatGPT
Open prompt - Advanced
Idempotent systemd-Timer Maintenance Job Prompt
Write a safe, idempotent maintenance job (script plus systemd service and timer units) that can run on a schedule, survive overlaps and missed runs, and never corrupt state when run twice.
- Claude
- ChatGPT
Open prompt - Intermediate
Add Pytest Coverage to an Automation Script Prompt
Wrap an existing Python automation script in a pytest suite that mocks subprocess, network, filesystem, and clock side effects so the logic is tested fast and deterministically without touching real systems.
- Claude
- ChatGPT
Open prompt - Intermediate
Idempotent Bulk File Rename & Migrate Tool Prompt
Write a Python tool that safely renames or relocates large batches of files using a rule set, with mandatory dry-run, collision detection, atomic moves, and an undo manifest so a bad run is reversible.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Log Parser & Anomaly Extractor Prompt
Build a Python tool that streams large or rotated log files, parses structured and semi-structured lines, aggregates error patterns, and emits a summary report without loading everything into memory.
- Claude
- ChatGPT
Open prompt - Intermediate
Retrofit a Python Script with Argparse, Logging & Retries Prompt
Take an ad-hoc Python script with hardcoded values, print() debugging, and no error recovery, and add a proper argparse CLI, structured logging, and bounded retries with backoff.
- Claude
- ChatGPT
Open prompt - Advanced
Multi-Command Python CLI Tool Scaffold Prompt
Design a production-ready Python CLI tool with subcommands, global flags, config-file precedence, machine-readable output, and clean exit codes that an ops team can extend without rework.
- Claude
- ChatGPT
Open prompt - Intermediate
Bash comm/join/sort Set Reconciliation Prompt
Reconcile two ops inventory lists with sort, comm, and join to surface drift, intersections, and one-sided membership
- Claude
- ChatGPT
- Cursor
Open prompt - Advanced
Bash exec File-Descriptor Redirection Logging Prompt
Wire script-wide logging with exec, custom file descriptors, and tee to split stdout/stderr to console and log files
- Claude
- ChatGPT
- Cursor
Open prompt - Intermediate
Bash mapfile/readarray Bulk Line Ingestion Prompt
Read command output and files into Bash arrays safely with mapfile/readarray, including null-delimited and callback handling
- Claude
- ChatGPT
- Cursor
Open prompt - Intermediate
Bash printf Safe String Formatting and %q Quoting Prompt
Replace fragile echo calls with printf for locale-stable, injection-resistant string building and %q shell-quoting
- Claude
- ChatGPT
- Cursor
Open prompt - Beginner
Bash select Built-in Interactive Menu Prompt
Build a dependency-free interactive menu using the bash select built-in and PS3 with input validation and a re-prompt loop
- Claude
- ChatGPT
- Cursor
Open prompt - Intermediate
Python argparse Parent Parsers and Shared-Flag Layering Prompt
Compose argparse parsers with parents=[...] to share common flags across subcommands and layer config-file, env, and flag precedence
- Claude
- ChatGPT
- Cursor
Open prompt - Advanced
Python asyncio.create_subprocess_exec Fan-Out Prompt
Run many external commands concurrently under asyncio with bounded concurrency, captured output, and per-command timeouts.
- Claude
- ChatGPT
- Cursor
Open prompt - Intermediate
Python concurrent.futures ThreadPool vs ProcessPool Selector Prompt
Decide between ThreadPoolExecutor and ProcessPoolExecutor and wire up correct exception handling and chunking.
- Claude
- ChatGPT
- Cursor
Open prompt - Advanced
Python signal.alarm SIGALRM Timeout Watchdog Prompt
Wrap stubborn blocking calls with a SIGALRM-based timeout context manager, fully aware of its main-thread and Unix-only caveats.
- Claude
- ChatGPT
- Cursor
Open prompt - Advanced
Bash Coprocess Bidirectional Pipe Orchestration Prompt
Drive a long-running interactive child process from a Bash script using a coproc so you can stream commands in and read responses out without re-spawning the process per call
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Named Pipe FIFO Producer-Consumer Pipeline Prompt
Decouple a data producer from one or more consumers across separate processes using a mkfifo named pipe, with correct open/blocking semantics and cleanup
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Process Substitution Patterns Prompt
Use process substitution to feed command output where a filename is expected — diffing two live command outputs, tee-ing to multiple consumers, and avoiding subshell variable loss
- Claude
- ChatGPT
Open prompt - Intermediate
Bash xargs Parallel Batch Execution Prompt
Process a large list of items (URLs, files, hosts) concurrently with xargs -P bounded parallelism, with NUL-safe input and correct failure aggregation
- Claude
- ChatGPT
Open prompt - Beginner
Python Context Manager Resource Cleanup Prompt
Wrap acquisition and guaranteed release of a resource (lock, temp dir, DB connection, mounted path) in a custom context manager so cleanup runs even on exceptions
- Claude
- ChatGPT
Open prompt - Advanced
Python fcntl Advisory File Locking Prompt
Serialize access to a shared resource across processes using fcntl advisory locks (flock/lockf) so two script instances never run the critical section concurrently
- Claude
- ChatGPT
Open prompt - Intermediate
Python Jinja2 Config Template Rendering Prompt
Render environment-specific config files (nginx, systemd units, app YAML) from Jinja2 templates plus a variables file, with strict undefined handling and safe output
- Claude
- ChatGPT
Open prompt - Intermediate
Python logging.config dictConfig Setup Prompt
Configure Python's logging via a single declarative dictConfig dictionary with multiple handlers, formatters, and per-module log levels instead of scattered basicConfig calls
- Claude
- ChatGPT
Open prompt - Beginner
Ruff and Black Pre-commit Pipeline Setup Prompt
Stand up a pre-commit configuration that runs Ruff (lint + import sort) and Black formatting on staged Python files locally and in CI, with a non-conflicting tool ordering
- Claude
- ChatGPT
Open prompt - Advanced
GNU/BSD Coreutils Portability Shim Prompt
Audit a Bash script for GNU-only coreutils flags that break on macOS/BSD, then add a portable shim layer (feature detection plus fallbacks) so the same script runs identically on Linux and macOS runners.
- Claude
- ChatGPT
Open prompt - Advanced
Secure umask & File-Write Hardening for Secret-Handling Scripts Prompt
Harden a Bash automation script that writes tokens, keys, or credentials so every file it creates is restrictive by default, written atomically, never leaks via temp files or world-readable defaults, and never echoes secrets to logs or process lists.
- Claude
- ChatGPT
Open prompt - Beginner
Self-Documenting Makefile Task Runner Prompt
Build a self-documenting Makefile that wraps a project's Bash and Python automation as discoverable targets, with a help target, .PHONY hygiene, dependency ordering, and safe variable handling.
- Claude
- ChatGPT
Open prompt - Advanced
Python asyncio Semaphore Bounded-Concurrency Review Prompt
Review an asyncio script that fans out work to find unbounded concurrency, then redesign it with a semaphore-bounded task pool, proper cancellation, backpressure, and clean shutdown so it can't overwhelm downstreams.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Click CliRunner Test Suite Prompt
Design a pytest suite that exercises a Click-based CLI end to end using CliRunner, covering exit codes, stdout/stderr separation, prompts, isolated filesystems, and env-var precedence without touching real systems.
- Claude
- ChatGPT
Open prompt - Advanced
Python Environment Markers & Platform-Conditional Deps Prompt
Author correct PEP 508 environment markers and platform-conditional dependency specifiers so an automation package installs the right wheels per OS, Python version, and architecture without forcing unneeded packages everywhere.
- Claude
- ChatGPT
Open prompt - Intermediate
Python pip-audit Dependency Vulnerability Scan Prompt
Stand up an automated pip-audit vulnerability scan for a Python automation repo, triage findings against actual usage, propose minimal-risk version bumps, and wire it into CI with a sane fail policy.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Watchdog Debounced File-Event Handler Prompt
Design a Python file-watching service with the watchdog library that debounces rapid event bursts, deduplicates editor save-churn, runs a safe action per stable change, and survives the watched directory being recreated.
- Claude
- ChatGPT
Open prompt - Intermediate
ShellCheck-Driven Bash Hardening Pass Prompt
Run a legacy Bash script through a ShellCheck-informed hardening review that resolves every warning by category, applies strict-mode and quoting fixes, and produces a safe, production-ready rewrite.
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Word-Splitting and Quoting Hardening Prompt
Audit and rewrite a Bash script to eliminate unquoted-expansion bugs, unsafe word splitting, and glob injection while preserving intended behavior
- Claude
- ChatGPT
Open prompt - Advanced
Bash Exit-Code and Pipefail Propagation Audit Prompt
Audit a Bash script for swallowed failures, missing pipefail, and broken exit-code propagation through pipes, subshells, and command substitution
- Claude
- ChatGPT
Open prompt - Intermediate
Bash getopts Long-Options Parser Prompt
Build a robust Bash option parser that supports both short flags and GNU-style long options with validation and a generated usage block
- Claude
- ChatGPT
Open prompt - Advanced
Bash Sourceable Function Library Pattern Prompt
Refactor scattered Bash helpers into a safe, namespaced, sourceable library that can be reused across scripts without polluting the caller's environment
- Claude
- ChatGPT
Open prompt - Advanced
Bash rsync Mirror with Safe-Deletion Guard Prompt
Build a Bash rsync mirroring script with dry-run defaults, delete-protection guards, and confirmation before any destructive --delete operation
- Claude
- ChatGPT
Open prompt - Intermediate
Python Layered Config Precedence Resolver Prompt
Build a Python config resolver that merges defaults, config file, environment variables, and CLI flags into a typed dataclass with deterministic precedence
- Claude
- ChatGPT
Open prompt - Intermediate
Python pytest Fixtures for CLI Integration Tests Prompt
Design pytest fixtures and integration tests that exercise a Python automation CLI end to end with isolated temp filesystems, fake env, and captured output
- Claude
- ChatGPT
Open prompt - Advanced
Python Subprocess Streaming Output with Timeout Prompt
Write a Python helper that runs a long subprocess, streams stdout/stderr live to logs while capturing them, and enforces a hard timeout with clean termination
- Claude
- ChatGPT
Open prompt - Intermediate
Python venv pip-tools Pinned Bootstrap Prompt
Generate a reproducible virtualenv bootstrap that compiles fully pinned, hash-verified dependencies from a high-level requirements.in using pip-tools
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Batch File Conversion Pipeline Prompt
Create a Bash pipeline that converts a directory of files (images, audio, or docs) in bulk with parallelism, skipping already-converted outputs idempotently.
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Config File Diff and Safe Merge Prompt
Create a Bash script that compares a shipped default config against a live one, shows the drift, and merges new keys without overwriting local edits.
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Disk Space Cleanup Advisor Prompt
Write a Bash script that finds the biggest space consumers, recommends safe deletions, and only removes files after explicit confirmation with a dry-run default.
- Claude
- ChatGPT
Open prompt - Beginner
Bash System Info Collector Snapshot Prompt
Generate a portable Bash script that gathers OS, hardware, network, and package facts into a single timestamped report for support tickets and audits.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Directory Tree Snapshot and Compare Prompt
Build a Python tool that records a hashed manifest of a directory tree and later reports added, removed, and modified files for change auditing.
- Claude
- Copilot
Open prompt - Advanced
Python Incremental Snapshot Backup Prompt
Build a Python backup tool that creates incremental, hardlink-based snapshots of a directory, prunes by retention policy, and verifies integrity.
- Claude
- Cursor
Open prompt - Advanced
Python Paginated REST API Extractor Prompt
Build a Python script that walks a paginated REST API, handles rate limits and retries, and writes normalized records to JSONL incrementally and resumably.
- Claude
- Copilot
Open prompt - Intermediate
Python Process Watchdog and Auto-Restart Prompt
Build a Python watchdog that monitors a long-running process or endpoint and restarts it with backoff when it hangs, crashes, or fails a health probe.
- Claude
- Cursor
Open prompt - Beginner
Python SMTP HTML Report Mailer Prompt
Generate a Python module that renders a summary report and emails it via SMTP with attachments, retries, and a dry-run mode for scheduled jobs.
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Associative Arrays Data Modeling Prompt
Model configuration maps, lookup tables, and grouped state in Bash using associative and indexed arrays instead of brittle parallel variables or repeated grep calls.
- Claude
- ChatGPT
Open prompt - Beginner
Bash Heredoc and envsubst Config Templating Prompt
Generate config files, manifests, and scripts from templates in Bash using heredocs and envsubst — with controlled variable expansion, quoting safety, and no accidental shell interpretation of the payload.
- Claude
- ChatGPT
Open prompt - Beginner
Bash Resilient curl Downloader Prompt
Write a robust file downloader in Bash using curl with retries, resume, checksum verification, timeouts, and atomic placement — for installers, artifacts, and bootstrap scripts that must not corrupt the target.
- Claude
- ChatGPT
Open prompt - Advanced
Bash xtrace Debugging and Profiling Prompt
Diagnose and profile a misbehaving Bash script using set -x, custom PS4 with timestamps and line numbers, BASH_XTRACEFD redirection, and targeted tracing — without drowning in noise or leaking secrets.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Datetime and Timezone Handling Prompt
Handle dates, times, timezones, and durations correctly in automation scripts — UTC-everywhere storage, aware datetimes, DST-safe scheduling, and reliable parsing/formatting of timestamps.
- Claude
- ChatGPT
Open prompt - Beginner
Python pathlib Filesystem Refactor Prompt
Refactor brittle os.path and string-concatenated file handling into clean, cross-platform pathlib code — safe joins, globbing, existence checks, and atomic-friendly path operations.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Regex Extraction and Validation Toolkit Prompt
Build correct, readable, and well-tested regular expressions in Python for parsing logs, validating input, and extracting structured fields — with named groups, verbose mode, and catastrophic-backtracking checks.
- Claude
- ChatGPT
Open prompt - Advanced
Python shutil and Safe Archive Extraction Prompt
Create and extract tar/zip archives in Python with shutil, tarfile, and zipfile — defending against path-traversal (zip slip), symlink escapes, and decompression bombs while preserving permissions where intended.
- Claude
- ChatGPT
Open prompt - Intermediate
Python ThreadPoolExecutor I/O Fan-Out Prompt
Parallelize I/O-bound work — HTTP requests, file reads, shell-outs, DB queries — with concurrent.futures.ThreadPoolExecutor, with bounded concurrency, ordered results, error isolation, and clean cancellation.
- Claude
- ChatGPT
Open prompt - Beginner
Bash .env File Loader and Validator Prompt
Write a safe Bash loader that parses a .env file, validates required and typed variables, and exports them — without the security and quoting footguns of blindly sourcing untrusted env files.
- Claude
- ChatGPT
Open prompt - Advanced
Bash to POSIX sh Portability Audit Prompt
Audit a Bash script for bashisms and rewrite it as portable POSIX sh so it runs identically under dash, busybox ash, and Alpine containers without a bash binary.
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Terminal Color and Styling Library with tput Prompt
Build a reusable Bash output library that uses tput for colors, bold, and status glyphs, auto-disables styling when output is not a TTY or NO_COLOR is set, and degrades gracefully on dumb terminals.
- Claude
- ChatGPT
Open prompt - Intermediate
Python argparse Subcommand CLI Without Dependencies Prompt
Scaffold a multi-command Python CLI using only the standard-library argparse — subparsers, shared global flags, env-var defaults, and clean exit codes — for scripts that must run with zero pip installs.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Memory-Bounded JSONL Stream Processor Prompt
Process multi-gigabyte JSONL or newline-delimited log files in constant memory with Python generators — filter, transform, and aggregate without loading the file into RAM or choking on malformed lines.
- Claude
- ChatGPT
Open prompt - Advanced
Python Graceful Shutdown and Signal Handling Prompt
Add robust SIGTERM/SIGINT handling to a long-running Python worker so it finishes in-flight work, releases resources, and exits cleanly within the container's grace period instead of being SIGKILLed.
- Claude
- ChatGPT
Open prompt - Intermediate
Python SQLite Local State and Cache Store Prompt
Use the standard-library sqlite3 module as a durable local state, cache, and checkpoint store for automation scripts — with WAL mode, upserts, TTL expiry, and safe concurrent access — instead of fragile JSON state files.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Resilient API Calls with the tenacity Library Prompt
Wrap flaky external API calls with the tenacity library — declarative retry, exponential backoff with jitter, exception/result-based stop conditions, and circuit-breaker-style guards — instead of hand-rolled retry loops.
- Claude
- ChatGPT
Open prompt - Beginner
Bash Dependency Preflight Check Prompt
Generate a reusable preflight block that verifies required commands, versions, env vars, and permissions before a Bash script does any real work — failing fast with actionable messages instead of cryptic mid-run errors.
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Dry-Run Mode Pattern Prompt
Add a first-class `--dry-run` mode to a Bash automation script so every mutating action is previewed instead of executed — with a single `run()` wrapper, clear PLAN output, and no accidental side effects.
- Claude
- ChatGPT
Open prompt - Beginner
Bash Leveled Logging Library Prompt
Build a small, sourceable Bash logging library with DEBUG/INFO/WARN/ERROR levels, timestamps, TTY-aware color, and a LOG_LEVEL threshold — so your scripts emit consistent, greppable output to stderr.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Atomic File Writes Prompt
Rewrite Python file-writing code to be atomic and crash-safe — write to a temp file in the same directory, fsync, then os.replace — so readers never see partial files and a killed process never leaves corruption.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Pydantic Settings Config Prompt
Replace ad-hoc os.environ access and scattered config parsing with a typed pydantic-settings model — validated env vars, .env loading, nested settings, secrets, and clear startup errors instead of runtime KeyErrors.
- Claude
- ChatGPT
Open prompt - Advanced
Python Safe Subprocess Wrapper Prompt
Build a hardened Python wrapper around subprocess that runs external commands safely — no shell=True, list args, timeouts, captured output, non-zero handling, and streaming logs — replacing fragile os.system and shell-string calls.
- Claude
- ChatGPT
Open prompt - Advanced
Python Token Bucket Rate Limiter Prompt
Implement a correct, thread-safe (and asyncio-friendly) token bucket rate limiter in Python to throttle outbound API calls, respect provider quotas, and smooth bursts — with tests and a clean decorator/context-manager API.
- Claude
- ChatGPT
Open prompt - Beginner
Ruff and Pre-Commit Lint and Format Setup Prompt
Stand up a fast, opinionated Python lint and format pipeline using Ruff (linter + formatter) wired into pre-commit and CI — replacing the flake8/isort/black stack with one tool and a clean pyproject.toml config.
- Claude
- ChatGPT
Open prompt - Intermediate
uv Reproducible Python Environments Prompt
Adopt uv for fast, fully reproducible Python environments — a locked uv.lock, pinned interpreter, dependency groups, and uv run scripts — replacing slow pip/venv/requirements.txt workflows in dev, CI, and Docker.
- Claude
- ChatGPT
Open prompt - Advanced
Idempotent Bash Provisioning Script Prompt
Generate bash setup scripts that converge a host to a desired state and can be re-run safely any number of times — check-before-change for packages, users, files, services, and symlinks — without Ansible.
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Temp File Cleanup with mktemp and trap Prompt
Generate bash scripts that create temp files and directories safely with mktemp and guarantee cleanup on every exit path — normal return, error, and signals — so scripts never leak /tmp garbage or clobber shared filenames.
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Script Machine-Readable JSON Output Prompt
Retrofit a bash script with a clean --json output mode using jq, separating human stdout from machine output, emitting valid structured results and proper exit codes so the script composes into pipelines and CI.
- Claude
- ChatGPT
Open prompt - Advanced
Bash Signal Handling and Graceful Daemon Shutdown Prompt
Make a long-running bash loop or worker handle SIGTERM/SIGINT gracefully — finish the in-flight unit of work, release locks, flush state, and exit with the right code — so container stops and systemd restarts never corrupt data.
- Claude
- ChatGPT
Open prompt - Beginner
Cron Environment Hardening and Debug Wrapper Prompt
Diagnose and fix the classic 'works in my shell, fails in cron' problem — minimal PATH, missing env, no TTY, swallowed output — by wrapping jobs in a hardened runner that logs, locks, and captures failures.
- Claude
- ChatGPT
Open prompt - Intermediate
Python File Integrity and Dedup Tool Prompt
Build a Python tool that hashes a directory tree, detects duplicate and corrupted files, and verifies integrity against a stored manifest — for backups, artifact stores, and data-pipeline outputs.
- Claude
- ChatGPT
Open prompt - Advanced
Python Multiprocessing CPU Batch Worker Prompt
Build a CPU-bound batch processor in Python using multiprocessing/ProcessPoolExecutor — chunking, worker isolation, progress, graceful shutdown, and result aggregation — to saturate all cores without the GIL bottleneck.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Type Hints and mypy Strict Retrofit Prompt
Incrementally add type hints to an untyped Python automation script and get it passing mypy --strict — annotating signatures, taming Any, modeling Optional, and wiring a CI gate — without a risky big-bang rewrite.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Typer CLI App Scaffold Prompt
Generate a modern, type-hint-driven CLI using Typer — subcommands, validated options, rich help, shell completion, and clean exit codes — for operations tools that need to feel like first-class CLIs.
- Claude
- ChatGPT
Open prompt - Advanced
Bash Database Dump and Backup Automation Prompt
Automate consistent, compressed, verified database dumps (Postgres/MySQL) with encryption, offsite upload, retention, and a restore drill — so backups are provably restorable, not just present.
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Interactive TUI Menu with whiptail Prompt
Wrap a risky operational script in a guided whiptail/dialog menu — checklists, confirmations, input validation, and a non-interactive flag — so on-call engineers run it safely at 3am without memorizing flags.
- Claude
- ChatGPT
Open prompt - Beginner
Bash Error Trap and Self-Diagnosing Script Prompt
Add an ERR trap, line-number-aware error reporting, and an opt-in xtrace debug mode to a Bash script so failures print exactly where and why they died instead of a silent non-zero exit.
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Single-Instance Lock with flock Prompt
Guarantee a script runs as a single instance using flock, with stale-lock detection, PID tracking, and clean release on every exit path — so overlapping cron runs never collide.
- Claude
- ChatGPT
Open prompt - Advanced
Python Idempotent ETL Pipeline Prompt
Build a restartable extract-transform-load script with checkpointing, idempotent upserts, batching, and dead-letter handling so a mid-run failure resumes instead of double-loading.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Heartbeat and Dead Man's Switch Prompt
Instrument a scheduled job to ping a heartbeat URL on success and alert when it goes silent — turning 'the cron job stopped running and nobody noticed' into a paged alert within minutes.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Log Tailer and Pattern Alerter Prompt
Build a long-running script that tails log files or journald, matches patterns, debounces and rate-limits, and fires alerts — a lightweight 'grep for trouble and notify me' daemon without a full logging stack.
- Claude
- ChatGPT
Open prompt - Advanced
Python Object Storage Sync Script Prompt
Write a resumable one-way sync to S3-compatible object storage — checksum-based change detection, multipart uploads, concurrency, dry-run, and delete-extras guardrails — without shelling out to the aws CLI.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Structured Logging for Automation Scripts Prompt
Add production-grade structured logging to a Python automation script — JSON logs, correlation IDs, levels, redaction of secrets, and rotation — so cron and systemd runs are debuggable after the fact.
- Claude
- ChatGPT
Open prompt - Advanced
Async Concurrent HTTP Poller with asyncio and httpx Prompt
Build a fast, bounded-concurrency async poller/fetcher that hits many endpoints with asyncio and httpx, with rate limiting, retries, timeouts, and structured results.
- Claude
- ChatGPT
Open prompt - Intermediate
Convert awk/sed Log One-Liners to a Maintainable Script Prompt
Refactor a pile of clever-but-unreadable awk/sed log-parsing one-liners into a single documented, testable script with named fields, clear stages, and proper error handling.
- Claude
- ChatGPT
Open prompt - Advanced
Backup and Restore Script with Rotation and Verification Prompt
Build a self-contained backup script that produces consistent, verified, rotated backups and a tested restore path — checksums, retention (GFS), encryption, and a restore drill so backups are provably recoverable.
- Claude
- ChatGPT
Open prompt - Intermediate
Bash Argument Parsing Scaffold Prompt
Generate a robust bash CLI scaffold with getopts plus hand-rolled long-option parsing, --help/--version, validation, and sensible defaults — production-grade rather than a brittle positional hack.
- Claude
- ChatGPT
Open prompt - Beginner
Bash Strict Mode Script Scaffold Prompt
Generate a production-grade Bash script skeleton with strict mode, trap-based cleanup, structured logging, and argument parsing so every new script starts hardened instead of being retrofitted later.
- Claude
- ChatGPT
Open prompt - Advanced
Testing Automation Scripts with bats and pytest Prompt
Add real automated tests to Bash and Python scripts using bats-core and pytest — mocking external commands, asserting exit codes and output, and covering the error paths so refactors stop breaking production jobs.
- Claude
- ChatGPT
Open prompt - Advanced
Destructive Operation Guard Wrapper Prompt
Build a safety wrapper around destructive commands (rm, drop, terraform destroy) with dry-run by default, typed confirmation, scope guards, and an audit trail so a stray script can't nuke prod.
- Claude
- ChatGPT
Open prompt - Beginner
Dotfiles and Workstation Bootstrap Installer Prompt
Generate an idempotent bootstrap script that sets up a fresh workstation — installs packages, symlinks dotfiles, and configures shells/tools — safely re-runnable, backing up existing files instead of clobbering them, across macOS and Linux.
- Claude
- ChatGPT
Open prompt - Intermediate
Inotify File Watcher Action Script Prompt
Generate a reliable inotifywait-based watcher that triggers an action on file/directory changes, with event debouncing, recursive watching, atomic-write handling, and a systemd unit so it survives reboots.
- Claude
- ChatGPT
Open prompt - Intermediate
jq JSON and YAML Transformation Pipeline Prompt
Design a robust jq-based pipeline to filter, reshape, and merge JSON (and YAML via yq) with safe defaults, null handling, and a stored filter file so the transformation is reviewable and testable rather than an inscrutable inline blob.
- Claude
- ChatGPT
Open prompt - Intermediate
Log Rotation and Cleanup Script Prompt
Generate a safe disk-cleanup and log-rotation script that prunes old logs and artifacts by age and size with dry-run, locking, and guardrails so it never deletes the wrong directory or fills the disk mid-run.
- Claude
- ChatGPT
Open prompt - Advanced
Migrate Bash to Python Prompt
Convert an overgrown, hard-to-maintain Bash script into clean, testable Python — preserving behavior while replacing fragile string-munging, brittle error handling, and unquoted expansions with structured, idiomatic code.
- Claude
- ChatGPT
Open prompt - Intermediate
Packaging a Python CLI with pyproject.toml and Entry Points Prompt
Turn a Python script into a properly packaged, installable CLI using pyproject.toml, console entry_points, src layout, versioning, and a clean build/distribution workflow.
- Claude
- ChatGPT
Open prompt - Intermediate
Parallel Job Execution with xargs and GNU Parallel Prompt
Turn a serial shell loop into a controlled parallel pipeline using xargs -P or GNU parallel, with bounded concurrency, per-job logging, fail-fast vs collect-errors modes, and correct quoting.
- Claude
- ChatGPT
Open prompt - Intermediate
Prometheus Textfile Collector Metrics Exporter Prompt
Write a Python script that emits custom metrics in Prometheus exposition format for the node_exporter textfile collector — correct types, labels, atomic writes, and HELP/TYPE lines.
- Claude
- ChatGPT
Open prompt - Intermediate
Python API Client Script Prompt
Build a robust Python client script for a REST API with session reuse, auth handling, pagination, rate-limit awareness, and typed responses — suitable for automation jobs rather than throwaway one-liners.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Bulk File Processing Script Prompt
Build a safe, idempotent batch file-processing script in Python that walks directories, transforms or renames files atomically, handles huge datasets without exhausting memory, and can resume after interruption.
- Claude
- ChatGPT
Open prompt - Intermediate
Python CLI Tool with Click Prompt
Design a well-structured Python command-line tool using Click (or argparse) with subcommands, config precedence, good help text, and clean exit codes — packaged so it installs as a console script.
- Claude
- ChatGPT
Open prompt - Beginner
Friendly Python CLI UX with Progress Bars and JSON Output Prompt
Add polished UX to a Python CLI — progress bars, colored output that degrades gracefully, a --json machine-readable mode, and clean handling of non-TTY and quiet modes.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Config Loader with Dataclasses and Validation Prompt
Generate a typed configuration loader that merges defaults, files (YAML/TOML/JSON), and environment variables into validated dataclasses with clear, fail-fast errors.
- Claude
- ChatGPT
Open prompt - Intermediate
Python CSV and Excel Report Generator Prompt
Build a script that pulls data from an API or database and produces clean, formatted CSV and Excel reports with headers, types, totals, and safe file handling.
- Claude
- ChatGPT
Open prompt - Advanced
Reusable Python Retry and Backoff Decorator Library Prompt
Design a small, reusable retry/backoff decorator that wraps flaky functions with exponential backoff, jitter, exception filtering, and hooks — for both sync and async code.
- Claude
- ChatGPT
Open prompt - Advanced
Python Secrets Loader from Vault and Cloud Secret Managers Prompt
Build a Python secrets loader that fetches credentials from HashiCorp Vault or a cloud secret manager (AWS/GCP/Azure) with caching, a pluggable backend, and zero secrets on disk or in logs.
- Claude
- ChatGPT
Open prompt - Intermediate
Python Slack, Teams, and Webhook Notifier Module Prompt
Build a reusable Python notification module that sends messages to Slack, Teams, or generic webhooks with a unified interface, retries, rate limiting, and safe failure handling.
- Claude
- ChatGPT
Open prompt - Advanced
Python SSH Remote Host Automation with Paramiko or Fabric Prompt
Generate safe, idempotent remote-host automation in Python using Fabric or Paramiko — connection reuse, command checks, file transfer, and proper failure handling across many hosts.
- Claude
- ChatGPT
Open prompt - Advanced
Retry and Backoff for Resilient Automation Prompt
Add correct retry, exponential backoff with jitter, timeouts, and circuit-breaking to flaky network or API calls in Bash and Python automation — without retrying things that should never be retried.
- Claude
- ChatGPT
Open prompt - Advanced
Self-Updating Script with Safe Replace Prompt
Add a secure self-update mechanism to a CLI script: version check against a release source, checksum/signature verification, atomic in-place replacement, and rollback — without leaving a half-written binary if the network drops mid-update.
- Claude
- ChatGPT
Open prompt - Intermediate
Systemd Timer Job Script Prompt
Convert a cron job into a robust systemd service + timer with proper logging, failure handling, sandboxing, and overlap prevention — or generate the units and accompanying script from scratch.
- Claude
- ChatGPT
Open prompt - Beginner
Wait-For Healthcheck Readiness Script Prompt
Generate a wait-for / readiness script that blocks until service dependencies (TCP ports, HTTP endpoints, databases) are actually ready, with timeout, exponential backoff, and clear exit codes — no more sleep 30 in entrypoints.
- Claude
- ChatGPT
Open prompt - Beginner
Bash Script Code Review Prompt
Get a senior-engineer review of any Bash script — safety, idempotency, error handling, portability.
- Claude
- ChatGPT
- Cursor
Open prompt - Intermediate
Ansible Playbook Generator Prompt
Generate idempotent Ansible playbooks with proper handlers, tags, and check-mode support.
- Claude
- ChatGPT
- Cursor
Open prompt
Guides
- · 10 min read
Set Operations in Bash: comm, join, and sort for Inventory Reconciliation
Reconcile host inventories with plain Bash. Use sort, comm, and join to find drift, intersections, and differences between lists without writing a Python script.
Read guide - · 11 min read
Bash File-Descriptor Redirection: exec, tee, and Custom FDs for Script Logging
Build solid script logging with Bash file descriptors. Use exec to redirect stdout and stderr, tee to a log file, and custom FDs to separate diagnostics from data.
Read guide - · 10 min read
Reading Command Output into Arrays with Bash mapfile and readarray
Slurp command output and files into Bash arrays the safe way. Use mapfile and readarray to dodge word-splitting bugs and handle null-delimited filenames cleanly.
Read guide - · 11 min read
Stop Using echo: Safe String Formatting in Bash with printf and %q
Why printf beats echo for portable output, how format strings work, and how the %q directive produces injection-safe, shell-quoted strings for building commands.
Read guide - · 8 min read
Bash & Python Error Guide: 'Argument list too long' (E2BIG)
Fix bash 'Argument list too long' (E2BIG): the ARG_MAX limit from wildcards expanding to thousands of files, and how xargs, find -exec, and globbing solve it.
Read guide - · 9 min read
Bash & Python Error Guide: 'BrokenPipeError' and 'UnicodeDecodeError'
Fix Python BrokenPipeError when piping to head/grep and UnicodeDecodeError reading non-UTF-8 files: SIGPIPE handling, encoding detection, and safe I/O patterns.
Read guide - · 8 min read
Bash & Python Error Guide: 'command not found' in Shell and Scripts
Resolve bash 'command not found': fix a broken PATH, missing installs, sudo stripping PATH, typos, and binaries that exist but are not on the search path.
Read guide - · 8 min read
Bash & Python Error Guide: 'IndentationError' and 'TabError' (Mixed Tabs/Spaces)
Fix Python IndentationError and TabError: mixed tabs and spaces, inconsistent indent levels, unexpected indent/dedent, and editor settings that hide the problem.
Read guide - · 10 min read
Bash & Python Error Guide: 'ModuleNotFoundError: No module named'
Fix Python ModuleNotFoundError: No module named: wrong interpreter, inactive venv, PYTHONPATH gaps, package vs import name mismatch, and sudo/cron context issues.
Read guide - · 9 min read
Bash & Python Error Guide: 'No such file or directory' on an Existing Script
Fix 'No such file or directory' when running a script that clearly exists: bad shebang, CRLF in the interpreter line, missing interpreter, or wrong arch binary.
Read guide - · 9 min read
Bash & Python Error Guide: 'Permission denied' Running a Script
Fix 'Permission denied' when executing a script: missing execute bit, noexec-mounted filesystem, directory permissions, ACLs, and SELinux/AppArmor denials.
Read guide - · 9 min read
Bash & Python Error Guide: 'syntax error near unexpected token'
Fix bash 'syntax error near unexpected token' caused by Windows CRLF line endings, broken heredocs, unbalanced quotes, and stray control characters in scripts.
Read guide - · 9 min read
Bash & Python Error Guide: 'TypeError: NoneType object is not subscriptable'
Fix Python TypeError: 'NoneType' object is not subscriptable/iterable: functions returning None, dict.get misses, mutating methods, and unguarded API responses.
Read guide - · 10 min read
Interactive Menus in Pure Bash with select and PS3 (No dialog or whiptail)
Build robust interactive menus in pure Bash using the select built-in and PS3 prompt, with input validation and quit handling, no dialog or whiptail required.
Read guide - · 11 min read
Running Hundreds of Commands Concurrently with Python asyncio Subprocesses
Fan out hundreds of shell commands with asyncio.create_subprocess_exec, bounding concurrency with a Semaphore, capturing output safely, and enforcing per-task timeouts.
Read guide - · 11 min read
CPU-Bound Ops Work in Python: concurrent.futures ProcessPoolExecutor Done Right
When threads stall on the GIL, ProcessPoolExecutor is the fix. Learn chunking, map vs submit/as_completed, and clean exception propagation for CPU-bound ops work.
Read guide - · 10 min read
Timeouts and Watchdogs in Python with signal.alarm and SIGALRM
Bound blocking calls and build watchdogs in Python using signal.alarm and SIGALRM. Covers the main-thread and Unix-only caveats and when subprocess timeouts win.
Read guide - · 10 min read
Reading Config Files in Python with tomllib: Stdlib TOML Since 3.11
Python 3.11 ships tomllib in the standard library. Learn to read TOML ops config, layer defaults, validate inputs, and why TOML beats ad-hoc INI or env soup.
Read guide - · 10 min read
AI-Assisted CSV and Spreadsheet Wrangling in Python for Ops Reports
Ops lives on CSV exports nobody wants to touch. Use AI to draft Python that cleans, joins, and reports — then verify the numbers before anyone trusts them.
Read guide - · 9 min read
AI-Assisted Regex for Ops: Stop Guessing, Start Verifying
Regex is write-once, debug-forever. Use AI to draft and explain patterns for logs and configs, then test against real strings before any pattern ships.
Read guide - · 10 min read
AI-Assisted sed and awk: Log and Config Munging Without the Memory Tax
sed and awk are unbeatable for text munging but nobody remembers the syntax. Use AI to draft the one-liner, then verify it against real data before prod.
Read guide - · 11 min read
Building a Python Slack Bot for Ops with AI (ChatOps Without the Foot-Guns)
A Slack bot turns your runbooks into chat commands. Use AI to draft the Bolt handlers, then lock down auth, verify signatures, and keep tokens out of code.
Read guide - · 10 min read
Dry-Running Destructive Scripts with AI Before They Touch Prod
Destructive automation deserves a dry-run mode. Use AI to add --dry-run, preview diffs, and confirmation gates so a script shows its work before it acts.
Read guide - · 10 min read
Generating Makefiles as Ops Task Runners with AI (Without the Tab Pain)
A Makefile is the simplest task runner that's already installed everywhere. Use AI to draft self-documenting targets, then review for the classic make footguns.
Read guide - · 10 min read
Parsing YAML in Bash and Python: yq and PyYAML Without the Footguns
YAML runs your infra but bash can't parse it safely. Use yq in scripts and PyYAML in Python, with AI to draft the queries — and dodge the classic gotchas.
Read guide - · 9 min read
Sending Email and Alerts from Scripts with Python smtplib (AI-Drafted, Human-Hardened)
Scripts still need to email reports and alerts. Use AI to draft smtplib senders, then verify TLS, escape user content, and keep SMTP credentials out of code.
Read guide - · 11 min read
Writing pre-commit Hooks for Ops Repos with AI (Catch It Before It Lands)
pre-commit hooks stop bad commits at the source. Use AI to draft custom Bash and Python hooks, then review them so they fail loud and never leak secrets.
Read guide - · 10 min read
Bash Exit Codes, pipefail, and PIPESTATUS for Reliable Pipelines
A failing command in the middle of a Bash pipe can be invisible by default. Learn pipefail, PIPESTATUS, and exit-code conventions to stop silent failures.
Read guide - · 9 min read
Bash Here-Documents and Config Templating Without the Mess
Generate config files, SQL, and multi-line payloads from Bash cleanly. A practical guide to here-docs, here-strings, and safe variable expansion in templates.
Read guide - · 11 min read
Bash trap Cleanup and Temp File Management for Safe Scripts
Stop leaving stale temp files and half-finished state behind. Use Bash trap and mktemp to build automation that cleans up after itself, even when it crashes.
Read guide - · 9 min read
Better Terminal Output for Python Ops Tools with rich
Tables, progress bars, colored logs, and readable tracebacks. How the rich library turns a wall of print() statements into a CLI your team enjoys using.
Read guide - · 9 min read
Python dataclasses for Modeling Ops Data Cleanly
Stop passing dicts and tuples around your automation. Python dataclasses give your ops scripts typed, self-documenting records with almost no boilerplate.
Read guide - · 9 min read
Python pathlib for Filesystem Automation the Modern Way
Stop gluing paths with string concatenation and os.path. Here is how pathlib makes filesystem automation cleaner, safer, and far less error-prone in ops.
Read guide - · 11 min read
Python subprocess Done Right: shlex, Timeouts, and check
Most subprocess bugs come from shell=True, missing timeouts, and ignored exit codes. Here is how I run external commands from Python ops scripts safely.
Read guide - · 10 min read
Watching Files and Directories in Python with watchdog
React to config changes, new log lines, and dropped files in real time. A practical guide to the watchdog library for event-driven Python automation.
Read guide - · 10 min read
Writing Bash Completion Scripts with complete and compgen
Give your ops CLIs tab completion for subcommands, flags, and dynamic values. A practical guide to complete and compgen, with AI doing the boilerplate.
Read guide - · 10 min read
AI-Assisted argparse CLI Design for Python Ops Tools
Design clean, discoverable argparse CLIs with AI help — subcommands, sane defaults, dry-run flags, and validation that stops bad invocations before they run on prod.
Read guide - · 11 min read
AI-Assisted Secret Handling in Bash and Python Automation
AI will hardcode tokens and log secrets if you let it. Learn safe patterns for env vars, secrets managers, and redaction in bash and Python automation scripts.
Read guide - · 10 min read
AI-Generated Error Handling for Python Automation Scripts
AI loves bare except clauses and swallowed errors. Learn to prompt for precise exception handling, useful failure messages, and clean exits in Python automation.
Read guide - · 11 min read
Debugging a Flaky Automation Script with AI Step by Step
A flaky bash or Python script that fails one run in ten is the worst kind. Use AI to form hypotheses, add instrumentation, and pin down race conditions and timeouts.
Read guide - · 11 min read
Hardening a Bash Script with AI: Strict Mode, Traps, and Back-Out
Use AI to turn a fragile bash script into a production-grade one — strict mode, error traps, cleanup handlers, and a back-out path you can trust under load.
Read guide - · 11 min read
Refactoring a Monolithic Bash Script into Functions with AI
Turn a 500-line wall of bash into clean, testable functions with AI help — extracting units, passing arguments safely, and keeping behavior identical throughout.
Read guide - · 11 min read
Translating a Bash Script to Python with AI Without Breaking It
When a bash script outgrows itself, AI can port it to Python fast — but quoting, exit codes, and subprocess pitfalls hide subtle bugs. Here's how to translate safely.
Read guide - · 12 min read
Using AI to Add Tests to a Crufty Python Automation Script
A practical workflow for wrapping an untested, legacy Python automation script in pytest using AI — characterization tests, dependency seams, and safe refactors.
Read guide - · 10 min read
Using AI to Review a Cron Job Before It Runs in Prod
Cron jobs fail silently at 3am. Use AI to review scheduling, locking, logging, and error handling in your bash and Python cron scripts before they cause an incident.
Read guide - · 9 min read
Automating GitHub with Python and the REST API
From auto-labeling PRs to bulk repo audits, GitHub's API turns tedious org-wide chores into a script. Here's how to do it without getting rate-limited or leaking tokens.
Read guide - · 8 min read
Building Bash TUI Menus with dialog and whiptail
Not every ops tool needs a web UI. A dialog-based menu turns a pile of bash scripts into something a tired teammate can run at 3am without memorizing flags.
Read guide - · 8 min read
Distributing Python CLI Tools with pipx So They Stop Breaking
pip install for a CLI tool pollutes environments and breaks on dependency conflicts. pipx gives every tool its own isolated venv with the command on your PATH.
Read guide - · 8 min read
Instrumenting Python Scripts with prometheus_client
Your automation script runs fine until it silently doesn't. Adding Prometheus metrics turns invisible cron jobs into things you can actually alert on.
Read guide - · 8 min read
Per-Project Environments with direnv for Ops Work
Stop exporting AWS_PROFILE by hand and forgetting to unset it. direnv loads the right env vars when you cd in and unloads them when you leave.
Read guide - · 8 min read
Processing Huge Files with awk and Streaming, Not RAM
When a log file is bigger than your memory, loading it into a list is the wrong move. Here's how to stream multi-gigabyte files with awk and Python generators.
Read guide - · 8 min read
Remote Automation in Python with Paramiko and Fabric
When Ansible is too heavy and a bash for-loop over SSH is too fragile, Paramiko and Fabric hit the sweet spot. Here's how to drive remote hosts from Python safely.
Read guide - · 8 min read
Resilient HTTP in Python with requests and httpx Retry Sessions
A bare requests.get against a flaky API will eventually page you. Connection pooling, timeouts, and retry transports turn fragile scripts into reliable ones.
Read guide - · 9 min read
Scripting AWS with boto3 Without the Rough Edges
boto3 makes the AWS API one import away, which is exactly why it's easy to write slow, fragile, or expensive scripts. Here are the patterns that keep them sane.
Read guide - · 8 min read
Bash Arrays and Associative Arrays: The Right Way to Hold State in Ops Scripts
Most flaky Bash scripts fall apart the moment they handle a list with a space in it. Indexed and associative arrays fix that — here's how to use them properly.
Read guide - · 9 min read
File Locking and Graceful Shutdown: The Two Habits That Separate Hobby Scripts from Production Ones
A cron job that overlaps itself or dies mid-write causes outages. flock and signal handling are the cheap fixes — here's how to do both in Bash and Python.
Read guide - · 9 min read
jq for JSON: Stop Grepping API Responses Like It's 2009
Every modern CLI and API speaks JSON, and grep can't parse it. jq is the missing tool — here's the practical subset that handles real DevOps work.
Read guide - · 8 min read
Packaging Python Ops Tools with uv: From 'Works on My Machine' to 'Runs Anywhere'
The handoff from a single script to a shareable tool is where most ops Python rots. uv handles environments, dependencies, and distribution fast — here's how.
Read guide - · 8 min read
Parallel Execution in the Shell: xargs and GNU parallel Without Melting Your Servers
Running ops tasks one at a time wastes hours. xargs -P and GNU parallel fan them out — here's how to do it safely with concurrency limits and clean output.
Read guide - · 9 min read
Python asyncio for Ops: Checking 500 Endpoints in the Time It Takes to Check One
When your script spends all its time waiting on the network, asyncio turns a 10-minute job into a 5-second one. A practical asyncio guide for DevOps work.
Read guide - · 8 min read
Config Management in Python: Stop Sprinkling os.environ Across Your Codebase
Scattered os.environ calls and silent type bugs make ops scripts fragile. Pydantic Settings gives you typed, validated, fail-fast config — here's the pattern.
Read guide - · 9 min read
sed and awk Mastery: The Two Tools That Replace 80% of Your Throwaway Scripts
Most DevOps text munging doesn't need a script — it needs one well-aimed sed or awk command. Here's the practical subset that covers nearly everything.
Read guide - · 9 min read
Building Python CLI Tools with Typer and Click
When a bash script outgrows its argument parsing, move it to Python. Here's how to build real CLI tools with Typer and Click, including subcommands and validation.
Read guide - · 9 min read
Calling APIs from Bash and Python Scripts Without the Footguns
curl and httpx make API calls easy and easy to get wrong. Here's how to handle auth, timeouts, errors, pagination, and rate limits in automation scripts.
Read guide - · 8 min read
Parsing Arguments in Bash Scripts the Right Way
Positional args break the moment someone passes flags out of order. Here's how to parse bash arguments with getopts and a hand-rolled loop that handles long options.
Read guide - · 9 min read
Parsing Logs with Bash and Python: A Practical Guide
From a quick grep one-liner to a structured Python parser, here's how to extract signal from log files at any scale, plus where AI speeds up writing the parser.
Read guide - · 9 min read
Retry and Backoff Patterns for Reliable Automation Scripts
Networks blip, APIs rate-limit, services restart. Here's how to add retry with exponential backoff and jitter to bash and Python so transient failures don't page you.
Read guide - · 9 min read
Scheduling Scripts: systemd Timers vs Cron, and When to Use Each
cron is everywhere but logs nowhere. Here's a practical comparison of systemd timers and cron for scheduling automation scripts, with config examples for both.
Read guide - · 8 min read
Structured Logging in Bash and Python Automation Scripts
echo statements don't scale past one machine. Here's how to add leveled, structured JSON logging to bash and Python so your automation is searchable and debuggable.
Read guide - · 9 min read
Testing Your Scripts with Bats and pytest Before They Hit Production
Untested automation scripts fail in production where it hurts most. Here's how to test bash with bats and Python with pytest, including mocking risky commands.
Read guide - · 9 min read
Writing Idempotent Automation Scripts You Can Re-Run Safely
An automation script you can't safely run twice isn't automation, it's a one-shot. Here's how to make bash and Python scripts idempotent so re-runs are no-ops.
Read guide - · 6 min read
How to Use AI Safely with Bash Commands
A practical safety guide for using AI assistants to generate Bash commands in production — the patterns, prompts, and pitfalls that keep you out of trouble.
Read guide
Recommended tools
-
Claude
by Anthropic
4.8The most cautious and context-aware AI assistant for infrastructure work.
- Best for
- Production troubleshooting, postmortems, IaC review
- Pricing
- Free tier; Pro $20/mo; Team & Enterprise tiers
Read review -
Cursor
by Anysphere
4.7The AI-first code editor that understands your whole repo.
- Best for
- Editing real IaC repos — Helm charts, Terraform modules, K8s operators
- Pricing
- Free tier (limited); Pro $20/mo; Business $40/seat/mo
Read review -
ChatGPT
by OpenAI
4.6The broadest AI ecosystem with deep plugin support and the largest user community.
- Best for
- Ansible/Terraform generation, fast scaffolding, plugin-heavy workflows
- Pricing
- Free tier; Plus $20/mo; Team & Enterprise tiers
Read review -
GitHub Copilot
by GitHub / Microsoft
4.5The lowest-friction AI completion in your existing editor.
- Best for
- Inline completion while writing YAML, Bash, Python, Terraform — plus agent mode for scoped multi-file changes
- Pricing
- Free tier (limited); Pro $10/mo; Business $19/seat/mo; Enterprise $39/seat/mo
Read review -
Gemma
by Google DeepMind
4.4Open-weights LLM family that runs locally — for air-gapped ops, on-prem inference, and privacy-sensitive infrastructure work.
- Best for
- Air-gapped incident response, on-prem log analysis, cost-controlled bulk processing
- Pricing
- Free — open weights under Gemma terms of use; commercial use permitted
Read review -
Amazon Q Developer
by Amazon Web Services
4.3AWS's AI assistant for building and operating on AWS — IaC, CLI, and resource Q&A grounded in your account.
- Best for
- Building & operating on AWS — CloudFormation/CDK/Terraform, CLI, and AWS resource troubleshooting
- Pricing
- Free tier (generous); Pro $19/user/mo
Read review -
Warp
by Warp
4.3An AI-native terminal that suggests commands in natural language.
- Best for
- Terminal-native workflows where context-switching kills focus
- Pricing
- Free tier; Pro $15/mo; Team & Enterprise tiers
Read review