Bash & Python Automation AI Prompts
144 free, production-ready Bash & Python Automation AI prompts — copy-paste ready for ChatGPT, Claude, or Cursor. Every prompt ships with fill-in placeholders, a worked example, and production-safety notes, so you get a usable answer on the first try.
- Bash & Python Automation Intermediate
Bash Multi-Repo Git Bulk Command Runner Prompt
Build a Bash script that runs the same git or shell command across many local repositories with per-repo isolation, dirty-tree guards, and an aggregated pass/fail summary
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Advanced
Bash GPG Secrets Encrypt/Decrypt Workflow Prompt
Build a Bash workflow that encrypts and decrypts secret files with GPG for git-committable storage, with strict permissions, no plaintext left on disk, and safe handling in automation
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Intermediate
Bash Safe In-Place sed Edit Wrapper Prompt
Build a Bash wrapper around sed -i that backs up, validates, and atomically applies in-place edits so a bad expression can never corrupt or truncate config files
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Advanced
Bash Health-Gated Service Restart Orchestrator Prompt
Build a Bash script that restarts services one at a time, waits for each to pass a health check before moving on, and rolls back or aborts on failure to avoid taking a whole fleet down at once
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Intermediate
Bash TCP Port Connectivity Diagnostic Prompt
Build a Bash script that checks TCP reachability to a set of host:port dependencies, times each connection, and produces a clear reachable/unreachable report for pre-flight or incident triage
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Intermediate
Python CSV Data-Quality Validator Prompt
Build a Python CLI that validates and cleans CSV/tabular data against declarative quality rules — types, ranges, required fields, uniqueness, referential checks — and emits a structured report of every violation
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Intermediate
Python Environment Config Drift Detector Prompt
Build a Python tool that compares configuration or environment-variable sets across environments (dev/staging/prod) and reports missing, extra, and mismatched keys while masking secret values
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Advanced
Python Multi-Log Merge and Timeline Correlator Prompt
Build a Python tool that merges several log files with different timestamp formats into one time-ordered timeline, tags each line with its source, and correlates events across services for incident analysis
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Intermediate
Python Prometheus Pushgateway Batch-Job Metrics Reporter Prompt
Build a Python module that reports batch-job and cron metrics (success, duration, records processed, last-success timestamp) to a Prometheus Pushgateway with correct grouping keys and failure-safe pushing
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Advanced
Bash Nameref (declare -n) Indirect-Variable Script Prompt
Write a Bash script that uses namerefs (declare -n) to pass arrays and associative arrays into functions by reference and return structured results, replacing brittle eval-based indirection.
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Intermediate
SSH ControlMaster Connection-Multiplexing Bash Script Prompt
Write a Bash automation script that reuses a single SSH connection across many remote commands via ControlMaster/ControlPersist, slashing per-command handshake latency without leaving stale sockets behind.
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Advanced
Asyncio TaskGroup Structured-Concurrency Python Script Prompt
Write a Python 3.11+ automation script that fans work out with asyncio.TaskGroup so failures cancel siblings cleanly, errors aggregate into an ExceptionGroup, and no task is ever silently orphaned.
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Intermediate
Bash Cron-to-systemd-Timer Migration Prompt
Convert legacy crontab entries into equivalent systemd service+timer units with correct scheduling, logging, environment, and failure handling so scheduled jobs become observable and manageable.
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Intermediate
Bash Hung-Process Guard with timeout Prompt
Wrap flaky external commands (curl, ssh, database clients, cloud CLIs) in a Bash timeout/kill guard so a single hung call can never stall a cron job, CI step, or systemd task forever.
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation Advanced
Python SIGHUP Config Hot-Reload Daemon Prompt
Add safe config hot-reloading to a long-running Python daemon so operators can apply new settings with a SIGHUP (or systemctl reload) instead of a full restart that drops in-flight work.
- Claude
- ChatGPT
- Cursor
Open prompt - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation 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 - Bash & Python Automation Intermediate
Ansible Playbook Generator Prompt
Generate idempotent Ansible playbooks with proper handlers, tags, and check-mode support.
- Claude
- ChatGPT
- Cursor
Open prompt
About these Bash & Python Automation AI prompts
This is a free, curated collection of Bash & Python Automation AI prompts for DevOps and platform engineers — prompt templates that turn Claude, ChatGPT, or Cursor into a focused Bash & Python Automation assistant. Instead of re-explaining your setup every time, each prompt has fill-in placeholders, a realistic worked example, and explicit safety and back-out notes, so it's safe to use against production Bash & Python Automation.
Browse all 144 above, or explore the wider Bash & Python Automation prompts and troubleshooting guides, the full DevOps AI prompt library, and run or compare any prompt live in the Prompt Workspace. Hit a production issue instead? Try the free Incident Assistant.