openclaw hooks

에이전트 훅(이벤트 기반 자동화, /new, /reset 및 gateway 시작과 같은 명령용)을 관리합니다.

관련 항목:

모든 훅 나열

openclaw hooks list

워크스페이스, 관리 및 번들 디렉토리에서 디스커버리된 모든 훅을 나열합니다.

옵션:

  • --eligible: 적격 훅만 표시 (요구 사항 충족)
  • --json: JSON으로 출력
  • -v, --verbose: 누락된 요구 사항을 포함한 세부 정보 표시

예시 출력:

Hooks (4/4 ready)

Ready:
  🚀 boot-md ✓ - Run BOOT.md on gateway startup
  📝 command-logger ✓ - Log all command events to a centralized audit file
  💾 session-memory ✓ - Save session context to memory when /new command is issued
  😈 soul-evil ✓ - Swap injected SOUL content during a purge window or by random chance

예시 (verbose):

openclaw hooks list --verbose

적격하지 않은 훅의 누락된 요구 사항을 표시합니다.

예시 (JSON):

openclaw hooks list --json

프로그래밍 방식 사용을 위한 구조화된 JSON을 반환합니다.

훅 정보 가져오기

openclaw hooks info <name>

특정 훅에 대한 세부 정보를 표시합니다.

인수:

  • <name>: 훅 이름 (예: session-memory)

옵션:

  • --json: JSON으로 출력

예시:

openclaw hooks info session-memory

출력:

💾 session-memory ✓ Ready

Save session context to memory when /new command is issued

Details:
  Source: openclaw-bundled
  Path: /path/to/openclaw/hooks/bundled/session-memory/HOOK.md
  Handler: /path/to/openclaw/hooks/bundled/session-memory/handler.ts
  Homepage: https://docs.openclaw.ai/hooks#session-memory
  Events: command:new

Requirements:
  Config: ✓ workspace.dir

훅 적격성 확인

openclaw hooks check

훅 적격성 상태 요약을 표시합니다 (준비된 것과 그렇지 않은 것의 개수).

옵션:

  • --json: JSON으로 출력

예시 출력:

Hooks Status

Total hooks: 4
Ready: 4
Not ready: 0

훅 활성화

openclaw hooks enable <name>

config(~/.openclaw/config.json)에 추가하여 특정 훅을 활성화합니다.

참고: 플러그인이 관리하는 훅은 openclaw hooks list에서 plugin:<id>로 표시되며 여기서 활성화/비활성화할 수 없습니다. 대신 플러그인을 활성화/비활성화하세요.

인수:

  • <name>: 훅 이름 (예: session-memory)

예시:

openclaw hooks enable session-memory

출력:

✓ Enabled hook: 💾 session-memory

수행 작업:

  • 훅이 존재하고 적격한지 확인
  • config의 hooks.internal.entries.<name>.enabled = true 업데이트
  • config를 디스크에 저장

활성화 후:

  • 훅이 다시 로드되도록 gateway를 재시작합니다 (macOS의 메뉴 바 앱 재시작, 또는 개발 환경에서 gateway 프로세스 재시작).

훅 비활성화

openclaw hooks disable <name>

config를 업데이트하여 특정 훅을 비활성화합니다.

인수:

  • <name>: 훅 이름 (예: command-logger)

예시:

openclaw hooks disable command-logger

출력:

⏸ Disabled hook: 📝 command-logger

비활성화 후:

  • 훅이 다시 로드되도록 gateway를 재시작합니다

훅 설치

openclaw hooks install <path-or-spec>

로컬 폴더/아카이브 또는 npm에서 훅 팩을 설치합니다.

수행 작업:

  • 훅 팩을 ~/.openclaw/hooks/<id>에 복사
  • hooks.internal.entries.*에서 설치된 훅 활성화
  • hooks.internal.installs에 설치 기록

옵션:

  • -l, --link: 복사 대신 로컬 디렉토리 링크 (hooks.internal.load.extraDirs에 추가)

지원 아카이브: .zip, .tgz, .tar.gz, .tar

예시:

# 로컬 디렉토리
openclaw hooks install ./my-hook-pack

# 로컬 아카이브
openclaw hooks install ./my-hook-pack.zip

# NPM 패키지
openclaw hooks install @openclaw/my-hook-pack

# 복사 없이 로컬 디렉토리 링크
openclaw hooks install -l ./my-hook-pack

훅 업데이트

openclaw hooks update <id>
openclaw hooks update --all

설치된 훅 팩 업데이트 (npm 설치만).

옵션:

  • --all: 추적된 모든 훅 팩 업데이트
  • --dry-run: 작성하지 않고 변경 사항 표시

번들 훅

session-memory

/new를 실행할 때 세션 컨텍스트를 메모리에 저장합니다.

활성화:

openclaw hooks enable session-memory

출력: ~/.openclaw/workspace/memory/YYYY-MM-DD-slug.md

참고: session-memory 문서

command-logger

모든 명령 이벤트를 중앙 감사 파일에 로깅합니다.

활성화:

openclaw hooks enable command-logger

출력: ~/.openclaw/logs/commands.log

로그 보기:

# 최근 명령
tail -n 20 ~/.openclaw/logs/commands.log

# 예쁘게 출력
cat ~/.openclaw/logs/commands.log | jq .

# 액션별 필터
grep '"action":"new"' ~/.openclaw/logs/commands.log | jq .

참고: command-logger 문서

soul-evil

퍼지 창 동안 또는 무작위 확률로 주입된 SOUL.md 콘텐츠를 SOUL_EVIL.md로 교체합니다.

활성화:

openclaw hooks enable soul-evil

참고: SOUL Evil Hook

boot-md

gateway가 시작될 때 BOOT.md를 실행합니다 (채널 시작 후).

이벤트: gateway:startup

활성화:

openclaw hooks enable boot-md

참고: boot-md 문서