# Osascript Network

> Inspect macOS network state. Use when getting current WiFi SSID, signal strength, and channel; listing all network interfaces with IP/MAC addresses; or watching for network connect/disconnect events via Darwin notifications.

- Skill: `damionrashford/osascript-network` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add damionrashford/osascript-network`
- Raw SKILL.md: https://api.skillmd.com/api/skills/damionrashford/osascript-network/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: damionrashford (https://skillmd.com/u/damionrashford)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/damionrashford/osascript-network

---


# osascript-network

Network inspection via `airport`, `networksetup`, `ifconfig`, and Darwin notifications.
All scripts are pure Python using stdlib + subprocess — no JXA needed.

## Scripts

Get current WiFi info — SSID, BSSID, signal (dBm), channel, band, security:
```bash
uv run scripts/wifi-info.py
```

List all network interfaces with IPv4, IPv6, MAC address, and active state:
```bash
uv run scripts/network-interfaces.py
```

Block until the next network change event, then print what changed — `--count N` to watch N events:
```bash
uv run scripts/watch-network.py
uv run scripts/watch-network.py --count 5
```

## Key Tools

| Tool | Path | Purpose |
|------|------|---------|
| `airport` | `/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport` | WiFi details |
| `networksetup` | `/usr/sbin/networksetup` | Interface enumeration |
| `ifconfig` | `/sbin/ifconfig` | IP/MAC per interface |
| `notifyutil` | `/usr/bin/notifyutil` | Darwin notification watcher |

## Darwin Network Change Notification

`com.apple.system.config.network_change` fires when:
- WiFi connects or disconnects
- VPN connects or disconnects
- Ethernet plugged/unplugged
- IP address changes (DHCP renewal)

## Reference

- [reference/11-notifications.md](reference/11-notifications.md) — Darwin notifications, notifyutil patterns, NSDistributedNotificationCenter

