{"id":50948762,"url":"https://github.com/jinshuju/agent-miniprogram","last_synced_at":"2026-06-17T23:04:06.569Z","repository":{"id":341974781,"uuid":"1172221502","full_name":"jinshuju/agent-miniprogram","owner":"jinshuju","description":"A CLI tool that helps AI agents test and operate WeChat Mini Programs.","archived":false,"fork":false,"pushed_at":"2026-05-22T07:37:53.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-22T15:31:50.818Z","etag":null,"topics":["ai-agent","automation","cli","jinshuju","testing","typescript","wechat-mini-program"],"latest_commit_sha":null,"homepage":"https://github.com/jinshuju/agent-miniprogram#readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jinshuju.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-04T04:11:56.000Z","updated_at":"2026-05-22T07:37:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jinshuju/agent-miniprogram","commit_stats":null,"previous_names":["jinshuju/agent-miniprogram"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jinshuju/agent-miniprogram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinshuju%2Fagent-miniprogram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinshuju%2Fagent-miniprogram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinshuju%2Fagent-miniprogram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinshuju%2Fagent-miniprogram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jinshuju","download_url":"https://codeload.github.com/jinshuju/agent-miniprogram/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinshuju%2Fagent-miniprogram/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34468774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agent","automation","cli","jinshuju","testing","typescript","wechat-mini-program"],"created_at":"2026-06-17T23:04:05.118Z","updated_at":"2026-06-17T23:04:06.563Z","avatar_url":"https://github.com/jinshuju.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agent Miniprogram\n\nA CLI tool that helps AI agents test and operate WeChat Mini Programs. Designed for use with AI agents like Claude Code.\n\n## Who is this for?\n\n- Developers who build and test WeChat Mini Programs\n- Teams exploring AI-assisted UI testing for Mini Programs\n- AI agents that need a stable CLI interface for Mini Program snapshots and interactions\n\n## Project status\n\nThis project is maintained by the Jinshuju team. It is suitable for internal automation, AI-assisted testing workflows, and early developer adoption.\n\nIssues and suggestions are welcome in this repository.\n\nInspired by [Agent Browser](https://github.com/vercel/agent-browser) (ref system, token-efficient snapshots) and [Agent Device](https://github.com/callstack/agent-device) (daemon architecture, SKILL.md, .amp recordings).\n\n## Install\n\n```bash\nnpm install -g agent-miniprogram\n```\n\n## Prerequisites\n\n1. [WeChat Developer Tools](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html) installed\n2. In Developer Tools: **Settings → Security → Enable CLI/HTTP calls**\n3. Node.js 18+\n\n## Quick Start\n\n```bash\n# Start the daemon\nagent-mp daemon\n\n# Launch DevTools and connect\nagent-mp launch /path/to/miniprogram\n\n# Get snapshot (ref-annotated WXML tree)\nagent-mp snapshot\n\n# Tap an element by ref\nagent-mp tap @e5\n\n# Type into an input\nagent-mp input @e3 \"13800138000\"\n```\n\n## Snapshot Format\n\n`agent-mp snapshot` outputs a compact, ref-annotated tree (~200-400 tokens):\n\n```text\nPage: /pages/index/index\n\n[view @e1]\n  [image @e2] src=\"/img/logo.png\"\n  [text @e3] \"欢迎登录\"\n[form @e4]\n  [input @e5] placeholder=\"手机号\" (bindinput=onPhoneInput)\n  [input @e6] type=\"password\" placeholder=\"密码\" (bindinput=onPasswordInput)\n  [button @e7] \"登录\" (bindtap=onLogin)\n[navigator @e8] → /pages/register/index \"注册账号\"\n```\n\n- `@eN` refs are assigned per snapshot call and persist in `~/.agent-miniprogram/refs.json`\n- Only semantically meaningful nodes are shown (text, events, attributes)\n- Pure layout containers are folded\n\n## Commands\n\nSee [skills/agent-miniprogram/SKILL.md](skills/agent-miniprogram/SKILL.md) for the full reference.\n\n| Command | Description |\n|---------|-------------|\n| `launch \u003cpath\u003e` | Launch DevTools and connect |\n| `connect` | Connect to running DevTools |\n| `close` | Close connection |\n| `status` | Show daemon status |\n| `snapshot [--data]` | WXML tree with refs |\n| `screenshot` | Take screenshot |\n| `navigate \u003curl\u003e` | Navigate to page |\n| `back` | Go back |\n| `tap \u003cref\u003e` | Tap element |\n| `input \u003cref\u003e \u003ctext\u003e` | Type text |\n| `scroll \u003cref\u003e` | Scroll element |\n| `long-press \u003cref\u003e` | Long press |\n| `swipe \u003cref\u003e \u003cdir\u003e` | Swipe gesture |\n| `wait \u003cref\\|ms\u003e` | Wait for element or time |\n| `data [path]` | Read page.data |\n| `eval \u003ccode\u003e` | Run JS in AppService |\n| `mock \u003capi\u003e \u003cjson\u003e` | Mock wx.* API |\n| `diff snapshot` | Diff vs last snapshot |\n| `record start/stop` | Record interactions |\n| `replay \u003cfile.amp\u003e` | Replay recording |\n\n## Claude Code Integration\n\nCopy or symlink `skills/agent-miniprogram/SKILL.md` to your Claude Code skills directory, or reference it in your project's `CLAUDE.md`.\n\n## Development\n\n```text\nagent-mp \u003ccommand\u003e\n    │\n    ▼ HTTP POST /rpc (localhost:9430)\n┌─────────────────────────┐\n│   Daemon (Node.js)       │  ~/.agent-miniprogram/daemon.json\n│   - session state        │  ~/.agent-miniprogram/refs.json\n│   - ref registry         │\n└────────┬────────────────┘\n         │ WebSocket\n         ▼\n  微信开发者工具 (miniprogram-automator)\n         │\n         ▼\n    小程序（模拟器）\n```\n\n```bash\ngit clone https://github.com/jinshuju/agent-miniprogram\ncd agent-miniprogram\nnpm install\n\n# Start daemon (dev mode)\nnpm run daemon\n# or\nnpx tsx src/daemon/server.ts\n\n# Run tests\nnpm test\n```\n\n### File Paths\n\n- `~/.agent-miniprogram/daemon.json` — daemon runtime state\n- `~/.agent-miniprogram/refs.json` — element ref registry\n- `~/.agent-miniprogram/last-snapshot.txt` — last snapshot (for diff)\n- `~/.agent-miniprogram/screenshot.png` — default screenshot path\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinshuju%2Fagent-miniprogram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjinshuju%2Fagent-miniprogram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinshuju%2Fagent-miniprogram/lists"}