Camsnap

Take webcam snapshots with path validation, safe resource handling, and flexible output options.

Audits

Pass

Install

openclaw skills install camsnap-snap

Camsnap

Camera snapshot utility for AI agents.

Features

  • Safe webcam capture with guaranteed resource release
  • Path traversal protection and extension validation
  • Configurable camera index and output directory
  • Structured logging (no print statements)
  • Type-annotated API

Usage

python3 camsnap.py
python3 camsnap.py --output-dir ./photos
python3 camsnap.py snapshot.png --camera 1

As a module

from camsnap import take_snapshot

path = take_snapshot(output_dir="snapshots", camera_index=0)