Developer Tools / Unix shell
Unix Copilot
Shell commands you can read before you run.
Describe a task or paste a failing command. Unix Copilot returns correct, portable shell commands and scripts, with a preview step for anything that changes files, permissions, or system state.
01 — The product
What is Unix Copilot?
Unix Copilot is a command-line assistant for Linux, macOS, Bash, zsh, and POSIX shell. It turns plain-language tasks into copy-ready commands, explains and debugs pasted commands and scripts, and suggests safer or more portable alternatives.
It’s built for developers, analysts, and data engineers who work in a terminal and need commands that behave correctly on their actual platform, not on a generic Unix that doesn’t exist.
Every request is sorted into low, medium, or high risk. Deletes, overwrites, permission changes, sudo, and service changes get a preview first, a separately marked destructive step, and recovery notes where feasible.
02 — Real workflow
A cleanup script that breaks on macOS
The problem
A log cleanup script works on a Linux server but fails on a Mac when the folder name has a space. It also ends with a recursive delete you’re not sure about.
#!/bin/sh
dir=$1
for f in $(ls $dir/*.log); do
sed -i 's/DEBUG/INFO/' $f
done
rm -rf $dir/archive/*
$ ./rotate-logs.sh "$HOME/App Logs"
ls: /Users/dev/App: No such file or directory
ls: Logs/*.log: No such file or directoryHow Unix Copilot approaches it
- 1Confirms the intended effect and the shell. The #!/bin/sh shebang means no Bash-only features, so the fix stays POSIX.
- 2Traces the failure to parsing ls and unquoted expansions, which split the path at the space. It also flags that BSD sed -i needs a suffix argument where GNU sed doesn’t.
- 3Treats rm -rf on an unchecked variable as high risk. It provides a find preview to inspect the targets first, with the delete shown separately to run only after the preview checks out.
- 4Rewrites the script with an argument check, quoted paths, find -exec, a temporary output file that is validated before it replaces the original, and a safe test to run.
Expected result
A short diagnosis, a corrected script with the macOS and Linux differences labeled, and a validation check you can run yourself.
Illustrative workflow. It doesn’t depict a real session, system, or result.
03 — Areas of expertise
Where it helps
Portable commands
Labels Bash, zsh, GNU, BSD/macOS, and Linux-specific behavior, and gives separate command blocks when sed -i, date, stat, find, or xargs differ by platform.
Script hardening
Deliberate shebang choice, argument and dependency checks, mktemp with trap cleanup, explicit error checks instead of blind reliance on set -e, and meaningful exit codes.
Safe file traversal
Uses find -exec and NUL-delimited pipelines instead of parsing ls, so names with spaces, newlines, or leading dashes don’t break bulk renames, moves, or deletes.
CSV and encodings
Says when awk or cut can’t parse quoted CSV, recommends CSV-aware tools, and keeps leading zeros, null values, and raw input intact during BI preparation.
04 — Working with Unix Copilot
What to provide and what to expect
Share
- Your OS and shell, for example macOS with zsh or Ubuntu with Bash
- The command or script, plus the exact error text
- Output from bash -n, set -x traces, or exit codes
- The paths, sample rows, or file names involved
- Whether sudo is available and which targets are in scope
Expect
- Copy-ready commands, with the flags, pipes, and quoting that matter explained
- Preview commands kept apart from destructive ones
- Validation checks such as row counts, checksums, or sample diffs
- Install steps for the right package manager: apt, dnf, pacman, Homebrew, or pipx
It doesn’t run commands, inspect your machine, or verify results. It works from the details and output you paste, so validation happens when you run the checks yourself.