# How to show a Mac notification after a Terminal task

Use the built-in osascript command for a simple completion notification, keep private command output out of the message and check notification permissions.

By [Rudra Satani](https://tapnoise.com/about/#maker), who makes TapNoise · 11 October 2026

In this post

You can ask macOS to display a simple notification from Terminal using `osascript`. Whether it appears or sounds depends on notification settings, Focus and the app macOS attributes it to.

## Test a fixed message

Run a harmless notification before attaching it to important work:

`osascript -e 'display notification "The task has finished." with title "Terminal task"'` 

Use a fixed message like this rather than interpolating command output into AppleScript. Logs can contain private paths or secrets, and shell quoting mistakes can turn data into code.

## Attach it to the intended outcome

For an interactive success-only message, place the notification after your known command with `&&`. If you want different results for failure, save the original status first and handle the two cases explicitly.

A notification failure should not disguise the task’s outcome. See [preserving command status](https://tapnoise.com/blog/terminal-sound-success-failure/) before turning a one-line experiment into a reusable script.

## Check delivery without flooding it

Look in notification settings for the sender identified by macOS and inspect your current Focus mode. A missing banner can be a presentation rule rather than proof the command never ran.

This sends a local macOS notification; it is not an email or a push message to another device. For a simple audible cue, [afplay](https://tapnoise.com/blog/play-sound-when-terminal-command-finishes/) uses the selected local audio path. TapNoise’s agent cues provide another option for supported local agents.

Sources: macOS `man osascript`; [Apple’s Terminal guide](https://support.apple.com/guide/terminal/welcome/mac).

**About the author**

Rudra Satani makes TapNoise. Spotted a mistake? Email [support@tapnoise.com](mailto:support@tapnoise.com?subject=Blog%20correction), or reach out at [@rudraxx13](https://x.com/rudraxx13).

## Related guides

- [**What the agent sounds and reactions mean**Claude Code, Codex and Cursor each play a cue when they finish, need you or hit an error. Here is what each sound means and how to hear it.](https://tapnoise.com/docs/agent-sound-cues/)

## Hear TapNoise on your Mac

Every sound is made by TapNoise itself. Try the sounds on the homepage first, then download the app.

[Download TapNoise](https://tapnoise.com/download/) · [Try the sounds](https://tapnoise.com/#try)

## More from the blog

- [**Local vs remote coding-agent alerts: where does the sound play?**A hook runs in the agent's environment. Understand why SSH, containers and cloud jobs do not automatically send a local Mac sound to your speakers.](https://tapnoise.com/blog/local-vs-remote-agent-sounds/)

- [**What a local coding-agent sound hook can see**Hooks can receive rich event data even when a sound helper only uses status. Review the command, payload handling and network behaviour before connecting one.](https://tapnoise.com/blog/agent-hooks-privacy-mac/)

- [**Why agent alerts can need repair after moving TapNoise**Keep TapNoise in Applications, inspect its Agents connection state and use Repair to update the helper path while preserving other agent settings.](https://tapnoise.com/blog/repair-agent-hooks-after-moving-app/)

- [**How to get a sound when Claude Code finishes**Hear when Claude Code is done or needs you. Use its built-in hooks with a macOS sound, or let TapNoise connect it for you in Settings > Agents.](https://tapnoise.com/blog/claude-code-sound-when-done/)

Source: https://tapnoise.com/blog/terminal-notification-without-extra-app/
