Manage launchd agent for dotfiles auto-sync. Check status, start/stop agent, view logs, and troubleshoot sync issues.
Manage and monitor the launchd agent that automatically syncs dotfiles to GitHub every hour.
This skill helps you manage the `auto-sync` launchd agent that monitors dotfiles changes and syncs them to GitHub automatically.
**Key Components:**
When the user asks about launchd, auto-sync, dotfiles sync, or related keywords:
First, verify the agent is running:
```bash
launchctl list | grep dotfiles
```
If output shows PID and exit code, the agent is loaded. If no output, agent is not running.
Show the last 20 log entries:
```bash
tail -20 ~/Library/Logs/dotfiles-sync.log
```
Inform the user of:
Check the plist file exists and is valid:
```bash
plutil -lint ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
If needed, show the plist contents:
```bash
cat ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
**Stop the agent:**
```bash
launchctl unload ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
**Start the agent:**
```bash
launchctl load ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
**Restart the agent:**
```bash
launchctl unload ~/Library/LaunchAgents/com.user.dotfiles-sync.plist && \
launchctl load ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
If the user wants to sync immediately without waiting:
```bash
/Users/snkrheadz/ghq/github.com/snkrheadz/laptop/scripts/auto-sync.sh
```
Monitor output for success/failure.
If sync is failing:
1. Check agent status with `launchctl list | grep dotfiles`
2. Review full log with `cat ~/Library/Logs/dotfiles-sync.log | tail -50`
3. Verify script exists with `ls -l /Users/snkrheadz/ghq/github.com/snkrheadz/laptop/scripts/auto-sync.sh`
4. Test manual execution of the script
5. Check network connectivity
6. Verify Git credentials are configured
7. Restart agent if needed
The `auto-sync.sh` script performs these steps:
1. Navigate to dotfiles directory
2. Update Brewfile with `brew bundle dump --force`
3. Stage all changes with `git add -A`
4. Commit only if changes exist
5. Push to remote repository
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/launchd-auto-sync-manager-z01no0/raw