Skip to content

docs: Add subprocess integration guide with permission workarounds#97

Open
hnshah wants to merge 1 commit intosteipete:mainfrom
hnshah:docs/subprocess-integration
Open

docs: Add subprocess integration guide with permission workarounds#97
hnshah wants to merge 1 commit intosteipete:mainfrom
hnshah:docs/subprocess-integration

Conversation

@hnshah
Copy link

@hnshah hnshah commented Mar 23, 2026

Summary

Adds comprehensive integration guide for using Peekaboo from subprocess contexts (Node.js, OpenClaw, etc.) with workarounds for Bridge permission issues.

Fixes #77

Problem

Users report permission errors when running Peekaboo capture commands from subprocess contexts, despite macOS permissions being granted. This occurs because:

  1. Peekaboo v3 routes commands through a Bridge daemon
  2. Bridge doesn't inherit TCC grants when spawned from subprocesses
  3. ScreenCaptureKit requires per-process Screen Recording permission
  4. Users aren't aware of the --no-remote flag workaround

Solution

Created docs/integrations/subprocess.md documenting:

  • Why it happens: Bridge architecture + macOS TCC per-process grants
  • How to fix it: Use --no-remote --capture-engine cg flags
  • Code examples: Node.js wrappers with error handling
  • Performance notes: CoreGraphics vs ScreenCaptureKit tradeoffs
  • Complete workflow: Capture → Find element → Click example
  • Troubleshooting: Common errors and solutions

Changes

  • ✅ New docs/integrations/subprocess.md (235 lines)
  • ✅ New docs/integrations/README.md (integration hub)
  • ✅ Tested workaround in Node.js subprocess context
  • ✅ All code examples verified working

Testing

# Verified workaround works from subprocess
node -e "
const { execSync } = require('child_process');
const result = execSync('peekaboo see --app Finder --no-remote --capture-engine cg --json', {encoding: 'utf8'});
console.log(JSON.parse(result).success);
"
# Output: true

Impact

  • Solves peekaboo no permission in openclaw. #77 (OpenClaw permission errors)
  • Helps all users running Peekaboo from subprocesses
  • Provides reusable Node.js integration patterns
  • Documents performance tradeoffs clearly

Future Work (Optional)

Happy to implement in follow-up PRs if desired:

  1. Auto-detection: CLI detects subprocess context and auto-uses local mode
  2. Flag alias: --local--no-remote --capture-engine cg
  3. Better errors: Suggest --no-remote when Bridge fails
  4. Environment variable: PEEKABOO_FORCE_LOCAL=1

Let me know if any of these would be helpful!


Checklist:

  • Created comprehensive integration guide
  • Tested all code examples
  • Verified workaround solves reported issue
  • Added troubleshooting section
  • Documented performance considerations

Fixes steipete#77

Adds comprehensive guide for using Peekaboo from subprocess contexts
(Node.js, OpenClaw, etc.) with workarounds for Bridge permission issues.

Changes:
- New docs/integrations/subprocess.md with detailed guide
- New docs/integrations/README.md as integration hub
- Explains why Bridge routing fails in subprocess contexts
- Provides tested workarounds (--no-remote --capture-engine cg)
- Includes Node.js wrapper examples
- Documents performance considerations
- Adds troubleshooting section

Tested in Node.js subprocess context - workaround confirmed working.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

peekaboo no permission in openclaw.

1 participant