Take a snapshot from the default webcam using the camsnap utility.
Usage
python {{SKILL_DIR}}/camsnap.py [output_path] [--preview] [--output-dir DIR]
- output_path — optional path to save the snapshot (must be within cwd; extensions: .jpg/.jpeg/.png/.bmp/.webp)
- --preview — show a preview window (GUI environments only)
- --output-dir — directory for auto-generated filenames (default:
snapshots)
If no output path is provided, the snapshot will be saved to ./snapshots/ with a timestamp filename.
Steps
- Run the snapshot script:
python {{SKILL_DIR}}/camsnap.py {{ $ARGUMENTS }}
- Confirm the snapshot was saved successfully and return the file path.
Security
- Output paths are validated to stay within the working directory (no path traversal).
- Only safe image extensions are accepted.