admin-unix
Native macOS and Linux administration (non-WSL). Profile-aware - reads preferencesfrom ~/.admin/profiles/{hostname}.json.Use when: macOS/Linux system admin, Homebrew (macOS), apt (Linux), services.NOT for WSL - use admin-wsl instead.
When & Why to Use This Skill
The Unix Administration skill is a powerful tool designed for native macOS and Linux system management. It enables Claude to perform profile-aware administrative tasks, including package management via Homebrew and apt, service control through systemd, and streamlined SSH connectivity. By leveraging host-specific configurations, it ensures precise environment setup and maintenance, making it an essential utility for developers and system administrators looking to automate routine OS-level operations.
Use Cases
- Automated System Setup: Quickly install, update, and manage system packages using Homebrew on macOS or apt on Linux based on predefined user preferences.
- Service Lifecycle Management: Monitor, start, stop, and restart system services or background daemons using platform-specific tools like systemctl or brew services.
- Environment Consistency: Maintain host-specific settings for Python (uv, pip, conda) and Node.js (npm, pnpm, yarn) managers to ensure development environments match local requirements.
- Streamlined Remote Access: Simplify SSH connections to multiple servers by automatically retrieving host, user, and key information from local JSON profiles.
- System Health & Auditing: Check system capabilities and update local profiles with current tool versions and configurations for better environment tracking.
| name | admin-unix |
|---|---|
| description | | |
| Use when | macOS/Linux system admin, Homebrew (macOS), apt (Linux), services. |
| license | MIT |
Unix Administration (macOS + Linux)
Requires: macOS or native Linux (NOT WSL)
Profile-First Approach
Profile location:
ADMIN_ROOT="${HOME}/.admin"
PROFILE_PATH="${ADMIN_ROOT}/profiles/$(hostname).json"
Load profile:
source /path/to/admin/scripts/load-profile.sh
load_admin_profile
show_admin_summary
Platform Detection
OS=$(uname -s)
case "$OS" in
Darwin) echo "macOS" ;;
Linux)
if grep -qi microsoft /proc/version 2>/dev/null; then
echo "WSL - use admin-wsl instead"
else
echo "Native Linux"
fi
;;
esac
Package Management (Profile-Aware)
Check Preference
PKG_MGR=$(jq -r '.preferences.packages.manager' "$PROFILE_PATH")
macOS (Homebrew)
# Install
brew install $package
# Update
brew upgrade $package
# List
brew list
# Search
brew search $package
Linux (apt)
# Update index
sudo apt update
# Install
sudo apt install -y $package
# Upgrade all
sudo apt upgrade -y
# Search
apt search $package
Python Commands (Profile-Aware)
PY_MGR=$(get_preferred_manager python)
case "$PY_MGR" in
uv) uv pip install "$package" ;;
pip) pip3 install "$package" ;;
conda) conda install "$package" ;;
esac
Node Commands (Profile-Aware)
NODE_MGR=$(get_preferred_manager node)
case "$NODE_MGR" in
npm) npm install "$package" ;;
pnpm) pnpm add "$package" ;;
yarn) yarn add "$package" ;;
bun) bun add "$package" ;;
esac
Services
Linux (systemd)
# Status
sudo systemctl status $service
# Start/Stop/Restart
sudo systemctl start $service
sudo systemctl stop $service
sudo systemctl restart $service
# Enable/Disable on boot
sudo systemctl enable $service
sudo systemctl disable $service
# View logs
journalctl -u $service -f
macOS (Homebrew services)
# List
brew services list
# Start/Stop
brew services start $service
brew services stop $service
brew services restart $service
SSH to Servers
Use profile server data:
ssh_to_server "cool-two" # Helper from load-profile.sh
Or manually:
SERVER=$(jq '.servers[] | select(.id == "cool-two")' "$PROFILE_PATH")
HOST=$(echo "$SERVER" | jq -r '.host')
USER=$(echo "$SERVER" | jq -r '.username')
KEY=$(echo "$SERVER" | jq -r '.keyPath')
ssh -i "$KEY" "$USER@$HOST"
Update Profile
After installing a tool:
PROFILE=$(cat "$PROFILE_PATH")
PROFILE=$(echo "$PROFILE" | jq --arg ver "$(python3 --version | cut -d' ' -f2)" \
'.tools.python.version = $ver | .tools.python.present = true')
echo "$PROFILE" | jq . > "$PROFILE_PATH"
Capabilities Check
has_capability "hasDocker" && docker info
has_capability "hasGit" && git --version
Scope Boundaries
| Task | Handle Here | Route To |
|---|---|---|
| Homebrew (macOS) | ✅ | - |
| apt (Linux) | ✅ | - |
| systemd services | ✅ | - |
| Python/Node | ✅ | - |
| WSL operations | ❌ | admin-wsl |
| Windows operations | ❌ | admin-windows |
| Server provisioning | ❌ | admin-devops |
References
references/OPERATIONS.md- Common operations, troubleshooting