webcam-cli
Agent and CLI for USB webcam and microphone access: enumerate attached devices, capture stills and video clips, and record audio, with agent-friendly verbs and safe-by-default writes.
Status
Scaffold. The agent-first CLI skeleton, mesh identity, CI, and skill kit are in place and green. The capture surface — list, describe, capture, record — is not implemented yet. The design brief and the questions still to settle live in
issue #1.
Scope
webcam-cli owns local USB capture devices — video and audio input — and the act of getting frames and samples off them. It produces an artifact plus honest metadata about it, and stops there.
It does not own interpreting what is in a frame (a vision model's job), sound out (harmonics-cli), browser or screen capture (webglass-cli), the general file-and-shell surface (shell-cli), or mesh event semantics (events-cli).
Quickstart
uv sync
uv run pytest -n auto # run the test suite
uv run webcam whoami # identity from culture.yaml
uv run webcam learn # self-teaching prompt (add --json)
uv run teken cli doctor . --strict # the agent-first rubric gate CI runs
The console command is webcam. The import package is webcam_cli and the PyPI distribution is webcam-cli — deliberately decoupled, so the ergonomic thing you type stays short while the import cannot shadow a generic webcam module in a consumer's environment.
Known defect: the CLI does not yet call itself by its installed name.
webcam --helpprintsusage: webcam-cli, and error hints,learn, andexplainall tell you to runwebcam-cli …— which is not installed and fails withFailed to spawn. Wherever the CLI sayswebcam-cli, typewebcam. Tracked in issue #3; the fix lands with the self-description rewrite, since the same strings are also still describing this repo as a template.
CLI
Today's surface is the agent-first template baseline:
| Verb | What it does |
|---|---|
whoami |
Report this agent's nick, version, backend, and model from culture.yaml. |
learn |
Print a structured self-teaching prompt. |
explain <path> |
Markdown docs for any noun/verb path. |
overview |
Read-only descriptive snapshot of the agent. |
doctor |
Check the agent-identity invariants (prompt-file-present, backend-consistency). |
cli overview |
Describe the CLI surface itself. |
Planned, per the build brief:
| Verb | What it will do |
|---|---|
list |
Attached capture devices, video and audio, keyed by stable id, reporting the ephemeral node alongside it, collapsing multi-node devices into one logical entry. |
describe <device> |
The actually-enumerated capabilities: pixel formats, resolutions, frame rates. |
capture <device> |
A still. Emits the resolved device identity, the negotiated format/resolution/fps, the output path, and a timestamp. |
record <device> |
A clip and/or an audio recording, with an explicit duration. |
Every command supports --json. Results go to stdout, errors/diagnostics to stderr (never mixed). Exit codes: 0 success, 1 user error, 2 environment error, 3+ reserved.
Why device identity is the hard part
/dev/videoN numbering is plug order, not identity. On the operator's host the two attached cameras swapped indices between the brief being written and being re-checked — the C270 moved from video2 to video0 and the Arducam the other way, with their ALSA cards swapping to match. A UVC camera also commonly exposes two /dev/video* nodes, only one of which yields frames, so counting nodes overcounts cameras. Stable handles come from /dev/v4l/by-id/, which carries vendor, product, and serial.
Access is the other trap: on that host the operator is not in the video group at all — read/write comes from a seat ACL granted by logind. An agent running headless, in a container, or as a systemd unit will not receive it and will fail to open a camera that works fine from a desktop session.
See issue #1 for the full evidence and the open questions it raises.
What this repo carries
- An agent-first CLI cited from teken
(
afi-cli) — the runtime package has no third-party dependencies. - A mesh identity —
culture.yaml(suffix+backend) and the matching resident prompt file (AGENTS.colleague.md, since this agent runsbackend: colleague). - The canonical guildmaster skill kit under
.claude/skills/, vendored cite-don't-import. Seedocs/skill-sources.md. - A build + deploy baseline — pytest, lint, the agent-first rubric gate, and PyPI Trusted Publishing wired into GitHub Actions.
See CLAUDE.md for the architecture, the domain constraints, and the conventions (version-bump-every-PR, the cicd PR lane, worktree layout, deploy setup).
License
Apache 2.0 — see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file webcam_cli-0.7.0.tar.gz.
File metadata
- Download URL: webcam_cli-0.7.0.tar.gz
- Upload date:
- Size: 161.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a1c32e572e6ff2ef1a1cdb545013055c6ad9385cfa4221fce35dec9bf89e026
|
|
| MD5 |
4ed057e4469e5555f14249b52285ee0c
|
|
| BLAKE2b-256 |
512885eccad1c7825bbd16be3848172fc4bb67252704d57adf66e42e10a1121d
|
File details
Details for the file webcam_cli-0.7.0-py3-none-any.whl.
File metadata
- Download URL: webcam_cli-0.7.0-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d18fa206f874f1f372c1fd1cf346e6aece38412b24f915e207e5fda34247e97
|
|
| MD5 |
79e11702ce7ee560fc67056378925373
|
|
| BLAKE2b-256 |
ecdfdac4b9718cd37cf3a49f69a503e904e452ef8573faaef7ecca1e11795b7d
|