clawcam
v0.0.3
Published
CLI for ClawCam — use phone cameras as IP cameras via WebRTC
Readme
clawcam
Turn a Phone Camera into an Agent's Eyes
ClawCam lets AI agents see the real world by turning any phone into a WebRTC camera. Take snapshots for vision models, record clips, or stream live video — all from a single CLI command.
Getting Started
Method 1: Claude Code Skill (Recommended)
The easiest way to use ClawCam is as an agent skill. One command to install, then interact in natural language:
/install-skill https://clawcam.dev/skill.mdThen just ask:
"Set up a new camera called office-cam"
"Take a snapshot of my desk"
"Record 30 seconds of video"
"Start an RTSP stream from my camera"
The agent auto-installs the CLI, sets up devices, captures images, records video, and manages streams. It parses JSON output automatically and can pass snapshots directly to vision models for analysis.
Method 2: npm CLI
For direct command-line usage without an agent:
npm install -g clawcam
# One-time setup: creates a device and prints the phone URL
clawcam setup my-camera
# Open the printed nodeUrl on your phone, grant camera permission, then:
clawcam snapshot # capture a JPEG frame
clawcam record --duration 60 # record 60s of video
clawcam rtsp # start an RTSP streamAll commands output a single line of JSON to stdout. Logs go to stderr.
How It Works
- Setup —
clawcam setup <name>generates a unique camera URL - Connect — Open that URL on a phone's browser and grant camera permission
- Use —
snapshot,stream,record, orrtspto capture from the phone
Under the hood, signaling flows over WebSocket and media travels peer-to-peer via WebRTC (H.264 + Opus), encrypted end-to-end.
Commands
| Command | Description | Key output |
|---------|-------------|------------|
| setup [name] | Create a new camera device | nodeUrl |
| snapshot | Capture a single JPEG frame | path |
| stream | Forward live RTP to local UDP ports | sdpFile |
| record | Record MP4 segments via ffmpeg | outputDir |
| rtsp | Serve camera as a standard RTSP stream | rtspUrl |
| device list | List all saved devices | devices |
| device remove <name> | Delete a saved device | removed |
For full option details, output schemas, and agent usage patterns, see the skill reference.
Requirements
- Node.js 18.20+
- ffmpeg on PATH (required for
record,stream, andrtsponly) - A phone with a modern browser and camera
