This script installs a voice alert for the Codex CLI by inserting a notify command into ~/.codex/config.toml. When Codex finishes a task, macOS will speak “Your task has finished.” using the Samantha voice.
- Checks that
~/.codex/config.tomlexists and already contains amodel_reasoning_effortline. - Skips installation if a
notify = ...entry is already present. - Inserts
notify = ["bash", "-lc", "say -v Samantha 'Your task has finished.'"]right after themodel_reasoning_effortline. - Writes through a temporary file (
config.toml.tmp) to avoid partial edits.
- macOS with the
saycommand available. - Existing Codex CLI config at
~/.codex/config.tomlthat includesmodel_reasoning_effort.
Run from this directory:
bash alert.sh- On success, you will see
🎉 notify installed!. - If
notifyalready exists, the script prints✔ notify already exists.and makes no changes. - If the config file or
model_reasoning_effortentry is missing, the script exits with an error message.
- Edit
NOTIFYinsidealert.shto change the spoken phrase or voice, e.g.say -v Alex 'Task done.'. - To use a different notifier (e.g. a desktop notification), swap out the
saycommand inNOTIFY.
- The script edits your Codex config in place. If you keep a custom setup, consider backing up
~/.codex/config.tomlbefore running. - It intentionally avoids adding duplicate
notifyentries.