Shell scripts and command lines with AI, safely
A wrong shell command can delete data.
What to do
- Ask for a dry-run mode and set -euo pipefail for bash.
- Ask the bot to flag any command that deletes, overwrites or uses sudo.
- Read every line before running; never pipe unknown scripts from the internet into a shell.
- Test in a temp directory.
Copy this prompt
Write a [bash/PowerShell] script to [task]. Include a --dry-run flag, strict error handling, comments, and a list of any destructive commands it contains.Check the bot's work
Run with --dry-run first.
Questions
Can I trust the bot on shell scripts?
Use it to plan and explain, then verify. Run with --dry-run first.
Which bot works best?
Grok Bot, ChatGPT, Claude and Gemini all handle this prompt. Paste the same prompt into two and compare; disagreements show where to check a source.
Where these facts come from
- OWASP Top 10
- CISA: Secure by Design
- GitHub Docs: Secret scanning
- W3C: WCAG overview
- Open Source Initiative: Licenses
- NIST SP 800-218: Secure Software Development Framework
Tools, features and prices change often. We don't list prices; check each vendor's official pricing page. Never paste secrets into a prompt. Checked Oct 30, 2026.
Coding with bots · Everyday workflows: all lessons →