This file is for AI coding agents working on AgentShot.
AgentShot is a local-first screenshot bridge for terminal AI agents. It helps users capture or copy a screenshot, save it as a local image file, render an AI-tool-specific prompt that references the image path, and copy that prompt to the clipboard.
The primary user workflow is:
install AgentShot -> daemon watches clipboard -> user takes screenshot -> AgentShot saves image and copies prompt -> user pastes into Claude Code, Codex CLI, or another terminal AI tool
AgentShot should not upload screenshots, call AI APIs, or inject text into terminal windows by default.
Primary distribution is npm:
npm install -g jcagentshotThe package uses postinstall only to print daemon setup guidance. It must not start background processes or register startup services during package installation.
Current product phases:
- Robust local screenshot bridge.
- Resident startup daemon by default.
- Read-only AI session detection for future explicit injection workflows.
Direct terminal injection is not a default behavior. Keep the safe default as "copy prompt to clipboard, user pastes manually".
- Runtime: Node.js 18+
- Module system: ESM
- CLI entrypoint:
bin/agentshot.js - Tests: Node built-in test runner
- Package manager: npm
- Platforms: Windows and macOS first, limited Linux clipboard fallback
- No runtime npm dependencies currently
bin/agentshot.js: main CLI implementation.scripts/postinstall.mjs: npm postinstall guidance. It must not start the daemon.scripts/validate.mjs: local validation runner.tests/agentshot.test.js: unit tests.README.md: English user-facing README.README.zh-CN.md: Chinese user-facing README.docs/PRODUCT_SPEC.md: product scope, platform strategy, and roadmap.docs/NPM_RELEASE.md: npm publishing checklist.docs/QUALITY.md: quality and validation baseline.
Run full validation:
npm run validateRun tests:
npm testSyntax check:
npm run checkSmoke test:
npm run smokePackage dry run:
npm pack --dry-runManual CLI examples:
node bin/agentshot.js --help
node bin/agentshot.js daemon status
node bin/agentshot.js sessionsSupported commands:
jcshot [capture]jcshot clipboardjcshot watchjcshot daemonjcshot daemon runjcshot daemon installjcshot daemon statusjcshot daemon uninstalljcshot sessionsjcshot lastjcshot dir
Supported tool templates:
claudecodexaidergeminiopencodegeneric
The daemon is a clipboard watcher.
- macOS startup integration uses
~/Library/LaunchAgents/com.junchenmeteor.agentshot.plist. - Windows startup integration uses a user logon scheduled task named
AgentShot. - Logs are written to
~/.agentshot/daemon.log. - Config is written to
~/.agentshot/daemon.json. AGENTSHOT_SKIP_POSTINSTALL=1skips postinstall guidance during npm install.
Daemon registration must be explicit through jcshot daemon install. Do not start background processes during npm installation.
Screenshots are local only.
Default candidate directories:
AGENTSHOT_DIRif set.~/.agentshot/shots.~/Pictures/agent-shots.- System temp directory.
Do not add cloud upload, telemetry, remote image hosting, or third-party accounts without explicit product approval.
- Keep source code comments and internal code text in English.
- Keep README content bilingual: update both
README.mdandREADME.zh-CN.mdfor user-facing behavior changes. - Prefer zero runtime dependencies unless a dependency clearly reduces platform risk.
- Keep OS integration conservative and failure-tolerant.
- Avoid direct terminal injection as a default behavior.
- Do not add a GUI, tray app, or global hotkey without updating product docs first.
- Preserve existing CLI compatibility where practical. For example,
jcshot daemonshould remain a foreground watcher alias. - Use structured APIs for OS integration where practical. Avoid brittle string parsing when an OS command can return JSON.
- Do not upload screenshots or send image data to AI providers.
When changing CLI parsing, prompt rendering, path conversion, daemon lifecycle parsing, or session detection helpers, add or update unit tests.
Before considering work complete, run:
npm run validateReal screenshot capture and OS startup registration require manual acceptance testing on Windows and macOS. Do not pretend these are covered by unit tests.
Update docs when behavior changes:
- User-facing install or workflow changes: update both READMEs.
- Product scope or roadmap changes: update
docs/PRODUCT_SPEC.md. - Publishing changes: update
docs/NPM_RELEASE.md. - Quality process changes: update
docs/QUALITY.md.
Primary package name:
jcagentshot
First public publish:
npm login
npm run validate
npm publish --access publicVersion bumps:
- Patch: bug fixes.
- Minor: new features.
- Major: breaking changes.
Always run validation before publish.
- The project currently has no runtime dependencies.
- The current implementation is optimized for Windows and macOS.
--pasteis best-effort and depends on focus and OS permissions.sessionsis read-only and should remain non-invasive.- Global daemon install behavior can vary by OS permissions and npm environment.