How jaredrhod/barehands works
Purpose and Entry Points
barehands is a local, webcam-driven spatial board: hand gestures manipulate rendered markdown cards, images, and 3D media. It is also a controlled visual interface for an AI or other local automation.
Primary startup is server.py, then Chrome loads stage.html at http://127.0.0.1:8794/stage.html. stage.html?role=render is the transparent render-only mirror for OBS. Installation/configuration guidance for AI agents lives in barehands.md; user config begins from barehands.json.example.
Local Server and Trust Boundary
server.py is the stdlib-Python local HTTP/API server. It serves the stage and likely mediates filesystem and board-action access rather than exposing arbitrary local filesystem control.
Two explicit safety boundaries define the integration:
• Configured notes directories are readable as markdown vault sources.
• Board media is constrained to media/; the server enforces this media jail and an action allowlist for agent-issued commands.
Relevant paths: server.py, barehands.json.example, media/.
Browser Spatial Runtime
The browser application in stage.html owns webcam interaction, gesture interpretation, scene state, and visual rendering. It loads Google MediaPipe hand tracking and three.js from public CDNs, avoiding a bundled frontend dependency/runtime.
The tracker recognizes pinch/tap, drag, rotate, scale, throw, clap clear, claw force-pull, and exploded-view scrubbing. Query parameters select rendering role, cursor visibility, resolution/scaling, and portrait orientation. The render role mirrors the same scene without camera ownership for capture workflows.
Relevant path: stage.html.
Content Ingestion: Notes and Media
Orbs configured in barehands.json expose either markdown folders (kind: "notes") or media (kind: "media"). Markdown is treated as a vault hierarchy and displayed as glass cards; an Obsidian vault is compatible without conversion.
Media is categorized by directory: ordinary images/props, transparent effects, conventional models, and holographic-model rendering. This provides a narrow, predictable asset pipeline rather than arbitrary file display.
Relevant paths: barehands.json.example, sample-notes/, media/fx/, media/holo/, media/models/, media/misc/.
AI / Automation Control Plane
An external brain does not run inside barehands. Any program capable of writing files or calling localhost can control it through two protocols:
• Presence state: write idle, thinking, listening, or speaking to a state file; the on-screen ring reflects it.
• Board commands: send JSON actions through the board script/API to present or compose cards, images, hand cues, explosions, yanks, and hover behavior.
The reverse path is board inspection: an agent calls the state script before deciding what to present. This makes AI integration a bounded local command interface, not browser automation.
Relevant paths: state/README.md, bin/board.sh, bin/board-state.sh, barehands.md.
State and Operating Model
Runtime presence data is filesystem-based under state/, allowing simple integration with Claude Code hooks, local LLMs, cron jobs, or hardware buttons. Board commands cross into the localhost server, which validates them before they affect the browser scene.
The application is intentionally local-first: Python stdlib server, Chrome webcam permissions, CDN-delivered MediaPipe/three.js, optional OBS as an external render consumer, and no required hosted backend.
Relevant paths: state/, server.py, stage.html.
Onboarding and Maintenance
Embedded sample notes teach interaction from within the product and are suitable as the initial notes orb. Troubleshooting focuses on gesture calibration/debugging. Update scripts pull product changes while intended user-owned config, notes, and media can remain outside tracked files.
Relevant paths: sample-notes/Getting Started/, TROUBLESHOOTING.md, update.sh, update.bat.
Main entry points: server.py Local HTTP/API server · stage.html Spatial board · barehands.json.example Orb configuration · board.sh Board command API
Components 22
Local Control Plane
- Local startup · Starts the local server and opens Chrome.
server.py - Local HTTP/API server · Serves the stage and validates local board operations.
server.py - Board command API · Applies an allowlisted command set.
bin/board.sh - Board inspection · Lets an external controller inspect board state.
bin/board-state.sh - Presence state files · Stores idle, thinking, listening, or speaking presence.
- State protocol
state/README.md
Browser Spatial Runtime
- Spatial board · Owns scene state, interaction, and rendering.
stage.html - Webcam input
- Hand gesture tracking · Interprets pinch, drag, rotate, scale, throw, clap, claw, and scrub gestures.
stage.html - 3D scene renderer · Renders cards, images, media, and presence cues.
stage.html - OBS render mirror · Uses stage.html?role=render without camera ownership.
stage.html
Content Sources
- Orb configuration · Configures notes and media sources.
barehands.json.example - Markdown notes vault · Markdown hierarchy becomes glass cards; Obsidian-compatible.
- Board media jail · Server constrains board media to this directory.
- Transparent effects
- Holographic models
- 3D models
- Images and props
Operations
- AI integration guide
barehands.md - Embedded onboarding · Teaches interaction from the initial notes orb.
- Gesture troubleshooting
TROUBLESHOOTING.md - Update scripts · Updates product files while user-owned content can remain external.
update.sh
Connections 24
- Local startup → Local HTTP/API server: starts
- Local HTTP/API server → Spatial board: serves
- Webcam input → Hand gesture tracking: hand frames
- Hand gesture tracking → Spatial board: scene gestures
- Spatial board → 3D scene renderer: renders through
- Spatial board → OBS render mirror: shared scene role
- Presence state files → Local HTTP/API server: presence input
- Local HTTP/API server → Spatial board: presence and actions
- Board command API → Local HTTP/API server: JSON board commands
- Board inspection → Local HTTP/API server: queries state
- State protocol → Presence state files: defines writes
- Orb configuration → Markdown notes vault: configures notes orb
- Orb configuration → Board media jail: configures media orb
- Markdown notes vault → Local HTTP/API server: readable markdown source
- Board media jail → Local HTTP/API server: jail-enforced assets
- Transparent effects → Board media jail: contained in
- Holographic models → Board media jail: contained in
- 3D models → Board media jail: contained in
- Images and props → Board media jail: contained in
- Local HTTP/API server → Spatial board: content delivery
- AI integration guide → Board command API: documents control
- Embedded onboarding → Markdown notes vault: initial content
- Gesture troubleshooting → Hand gesture tracking: calibration guidance
- Update scripts → Local HTTP/API server: updates product