TopRank Skills

Home / Claw Skills / 机器人 / macos-launchdaemon
Official OpenClaw rules 38%

macos-launchdaemon

Run OpenClaw as a system-level LaunchDaemon on macOS for 24/7 operation, surviving screen lock, logout, and user switching. Uses caffeinate to prevent sleep. Verified working for long-term locked screen scenarios.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 macos-launchdaemon 技能。 若已安装,则直接安装 macos-launchdaemon 技能。

Overview

Skill Key
happydog-intj/openclaw-macos-always-on
Author
happydog-intj
Source Repo
openclaw/skills
Version
-
Source Path
skills/happydog-intj/openclaw-macos-always-on
Latest Commit SHA
92b948aff9ce533f32bbcae2c9bd77e6b67eb4a6

Extracted Content

SKILL.md excerpt

# macOS LaunchDaemon Setup for OpenClaw

Run OpenClaw as a system-level service (LaunchDaemon) with `caffeinate` to ensure 24/7 operation. This configuration has been **tested and verified** to work even after extended screen lock periods (30+ minutes).

**Ensures OpenClaw continues running when:**

- 🔒 Screen is locked (short or long duration)
- 👤 User is logged out
- 🔄 Switching between user accounts
- 💤 Display sleeps (system stays awake)

## When to Use This

**Use LaunchDaemon if:**
- You need 24/7 bot availability
- You lock your Mac regularly but want messages to still work
- Multiple users on the same Mac need to access the bot
- Running on a home server/always-on Mac

**Use LaunchAgent if:**
- Only need bot while logged in
- Prefer simpler setup (no sudo)
- Security-conscious about system-level services

## Quick Setup

### One-Command Installation

```bash
curl -fsSL https://raw.githubusercontent.com/YOUR_USERNAME/clawd/master/skills/macos-launchdaemon/install.sh | bash
```

Or manual setup below ⬇️

## Manual Setup

### Step 1: Create LaunchDaemon Configuration

Create the plist file with your actual username. This configuration uses **caffeinate** and has been **tested and verified** to work even after 30+ minutes of screen lock:

```bash
cat > /tmp/ai.openclaw.gateway.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>ai.openclaw.gateway</string>
    
    <key>Comment</key>
    <string>OpenClaw Gateway (System Daemon - Network Always On)</string>
    
    <key>RunAtLoad</key>
    <true/>
    
    <!-- Enhanced KeepAlive for network services -->
    <key>KeepAlive</key>
    <dict>
      <key>SuccessfulExit</key>
      <false/>
      <key>NetworkState</key>
      <true/>
      <key>Crashed</key>
      <true/>
    </dict>
    
    <!-- Prevent ANY throttling -->
    <key>ThrottleInterv...

README excerpt

# OpenClaw macOS Always-On

**Keep OpenClaw running 24/7 on macOS - even when your screen is locked for hours!**

[![macOS](https://img.shields.io/badge/macOS-10.15+-blue.svg)](https://www.apple.com/macos/)
[![Tested](https://img.shields.io/badge/tested-macOS%2014.4-success.svg)](https://github.com/happydog-intj/openclaw-macos-always-on)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

English | [简体中文](README.zh-CN.md)

## 🎯 Problem Solved

By default, macOS suspends user processes when you lock your screen, causing your OpenClaw bot to stop responding to messages. This project provides a **tested and verified** solution using LaunchDaemon + caffeinate.

**Verified Working:**
- ✅ Screen locked for 30+ minutes
- ✅ macOS 14.4 (and earlier versions)
- ✅ Both Intel and Apple Silicon Macs

## 🚀 Quick Install

One-line installation:

```bash
curl -fsSL https://raw.githubusercontent.com/happydog-intj/openclaw-macos-always-on/master/install.sh | bash
```

Or manual installation - see [SKILL.md](./SKILL.md) for detailed instructions.

## ✨ What This Does

Converts OpenClaw from a user-level LaunchAgent to a system-level LaunchDaemon with these enhancements:

| Feature | Before (LaunchAgent) | After (LaunchDaemon + caffeinate) |
|---------|---------------------|----------------------------------|
| **Screen locked** | ❌ Suspends after ~10min | ✅ Runs indefinitely |
| **User logged out** | ❌ Stops | ✅ Continues running |
| **Boot startup** | At login | At system boot |
| **Priority** | User-level | System-level |
| **Sleep prevention** | None | `caffeinate -s` |

## 🔧 How It Works

The solution uses three key components:

1. **LaunchDaemon** - System-level service (runs as your user but managed by system launchd)
2. **caffeinate** - macOS utility that prevents system sleep while keeping display sleep enabled
3. **Enhanced KeepAlive** - Network-aware restart with crash recovery

```xml
<!-- Key configuration -->
<key>ProgramArguments</ke...

Related Claw Skills