generate_ssh_config
Generate SSH config host blocks for Tailscale nodes, using MagicDNS names or IP addresses. Supports dry-run mode and optional writing to a dedicated file or your SSH config with managed markers.
Instructions
Generate ssh-config Host blocks for tailnet nodes (MagicDNS name preferred, Tailscale IP fallback). Dry-run by default: returns the generated config text only and writes nothing. With write=true it writes a dedicated file (~/.ssh/tailscale_dev_config) and returns instructions for adding an Include line to ~/.ssh/config (never applied automatically). Direct editing of ~/.ssh/config itself additionally requires target="user_ssh_config" and is idempotent between managed markers, never touching content outside them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user | No | Remote user to set on every Host block | |
| write | No | Actually write the config (default: false = dry-run, text only) | |
| target | No | Write target: "dedicated_file" (default, ~/.ssh/tailscale_dev_config) or "user_ssh_config" (edit ~/.ssh/config between managed markers) | |
| onlineOnly | No | Only include peers that are currently online (default: false) |