This repository is the source-available public release of OpenGUI.
server/comes from the originalcorematebackend and is now the public NestJS serviceclient/comes from the originalhaomaiAndroid app and is now the public mobile clientdocs/contains public-facing architecture and evaluation materials
In the maintainer workspace there may also be sibling directories such as ../coremate and ../haomai_v0.0.1. Treat them as reference-only source snapshots. Unless the user explicitly asks otherwise, all public changes should land in this repository only.
- Reply to the user in Chinese.
- Use UTF-8 when creating or editing files.
- Treat this repository as the source of truth for current behavior. If README/comments conflict with code, trust code first and then fix docs.
- Keep every change public-release-safe. Never reintroduce private endpoints, production IPs, commercial SDKs, hardcoded credentials, internal dashboards, or company-only workflows.
- Do not edit generated or dependency directories such as
server/node_modules,server/.turbo,client/build,client/.gradle, orclient/.kotlin. - The root
.gitignoreis intentionally minimal. Be proactive about not committing local env files, generated output, APKs, logs, or cache directories.
OpenGUI is a two-part system:
server/is the brain. It plans tasks, runs the LangGraph-based agent pipeline, owns task/execution state, and dispatches work to devices over WebSocket.client/is the hands. It runs on Android, keeps a standby connection, executes GUI actions through accessibility services, uploads screenshots, and shows task state in the app / floating windows.
The main public flow is:
Task/API/IM request -> server task execution -> standby device pickup -> execution WebSocket -> Android action loop -> summarizer result
opengui-release/
├── server/ # NestJS monorepo + Prisma database package
├── client/ # Android multi-module app
├── docs/ # Public docs / images / reports
└── CLAUDE.md # This file
server/
├── apps/backend/
│ └── src/
│ ├── modules/
│ │ ├── graph-agent/ # Core IP: planning / execution / summarization graph
│ │ ├── task/ # Task + execution lifecycle
│ │ ├── creator-agent/ # Content generation helper module
│ │ ├── im-channel/ # Feishu / Telegram remote dispatch
│ │ ├── credits/ # Stub
│ │ ├── knowledge/ # Stub
│ │ ├── tos/ # Stub, local filesystem storage
│ │ ├── device-log/ # Device log ingestion / retry flow
│ │ ├── apk/
│ │ ├── app-config/
│ │ ├── tenant/
│ │ └── user/
│ ├── common/ws/ # Standby / execution socket protocol
│ └── prisma/
├── packages/database/ # Prisma schema + generated client package
└── start.sh # One-command local bootstrap
client/
├── app/ # Application shell, SplashActivity, PromotorApplication
├── feature_promotor/ # Main UI, task list, execution windows, settings
├── automation/ # Automation framework and task logic
├── core_accessibility/ # GestureService and action execution
├── core_network/ # Retrofit + WebSocket managers
├── core_common/ # Android shared utilities, stubs, local logging
├── core_common_jvm/ # Cross-module shared models / interfaces
└── core_aop/ # JVM support code
This repository is a cleaned public release, not the original internal product. Preserve that boundary.
- Internal admin app is not part of this repo
- OTP/auth module is not part of the current public backend surface
- Payment / recharge logic is not part of the public release
- Private push / cloud integrations must not be reintroduced
server/apps/backend/src/modules/credits/credits.service.tsserver/apps/backend/src/modules/credits/billing.service.tsserver/apps/backend/src/modules/knowledge/knowledge.service.tsserver/apps/backend/src/modules/tos/tos.service.ts
These stubs exist because other modules still inject them. Do not delete them just because the public version no longer uses the original commercial behavior.
Rules:
credits/must continue to behave as unlimited / no-deduction unless there is a deliberate product decision to add a real public billing systemknowledge/currently returns empty results; do not remove the service contract blindlytos/writes to local filesystem under./uploads; keep the API shape stable for graph / device-log callers- If you replace a stub with a real implementation, keep the public interface and verify all callers
SplashActivitybypasses authentication and jumps directly toHomeActivityPushManageris a no-op stubStatisticsManageris a no-op stubLogManagerwrites locally and logs withLog.d, without cloud log shipping
Do not reintroduce UMeng, Bugly, Aliyun SLS, or any other commercial/mobile tracking SDKs without explicit user approval.
The public release is GUI/vision-first. The server-side A11y tree reasoning path from older versions is gone. The Android client still uses accessibility services to perform actions, but do not casually resurrect old executor_a11y / A11y-tree routing ideas from private code.
server/apps/backend/src/modules/graph-agent/This is the crown jewel. Small changes here can break planning, loop control, token accounting, or execution semantics.server/apps/backend/src/modules/task/Owns execution creation, resume/fork/cancel, queueing, and state transitions.server/apps/backend/src/common/ws/Defines standby/execution socket contracts used by Android.server/apps/backend/src/modules/creator-agent/Separate feature area, but it shares agent config plumbing and has incomplete placeholder tools.server/apps/backend/src/modules/im-channel/Feishu/Telegram are optional and only activate when credentials are present.
client/core_accessibility/Real device actions and accessibility service lifecycle live here.client/automation/Automation logic and service helpers.client/feature_promotor/common/MessageController.ktCentral execution wiring between app state, action handler, SSE/WS, and floating windows.client/core_network/src/main/java/com/coremate/opengui/network/websocket/Socket protocol implementation; keep this aligned withserver/common/ws.client/feature_promotor/ui/home/HomeActivity.ktStandby service startup and remote-dispatch entry point.
If a change touches both task/common/ws on the server and websocket/action code on Android, treat it as a protocol change and verify both ends.
- The client runtime default backend URL is currently
http://127.0.0.1:7777, defined inclient/core_network/.../ServerConstant.kt - The Settings page stores an override in MMKV key
BaseUrl; restart is required after changing it - Older docs and
client/local.properties.examplestill mention10.0.2.2; do not assume those are the runtime source of truth server/start.shcopies.env.exampleto.envand exits on first run; after filling keys you must run it againcreator-agentexists in the public repo, but its web search tool is still placeholder-levelknowledge-related UI and docs still contain TODOs; do not assume that surface is completetosreturns/uploads/...URLs; if you build a feature that depends on serving uploaded files externally, verify the HTTP serving path end-to-end
cd server
./start.shUseful commands:
pnpm build
pnpm test
pnpm backend
pnpm format-and-lint
pnpm format-and-lint:fix
pnpm --filter @repo/db db:generatestart.sh is the preferred bootstrap path because it:
- checks Node / pnpm / Docker
- starts PostgreSQL and Redis
- creates
.envfrom.env.exampleif missing - generates Prisma client
- pushes schema and imports seed data
- starts the backend on port
7777
cd client
./gradlew assembleDebugFor local server access with the current runtime default:
adb reverse tcp:7777 tcp:7777If adb reverse is not available or you use a different network setup, change the server URL in the app Settings page or update the runtime config accordingly.
When you change code, verify at the right level.
- Always run
cd server && pnpm build - If you touched
graph-agent,task,common/ws, or DTO/controller logic, run relevant tests too - If you changed Prisma schema or DB package code, regenerate client and verify build again
- Always run
cd client && ./gradlew assembleDebug - If you changed accessibility / execution flow, verify the affected screen or service path manually when possible
At minimum verify:
- backend starts successfully
- Android app launches to
HomeActivity - standby connection can come up
- task execution protocol still works from server to client
- summarizer / completion flow still returns cleanly
If you cannot run device-level verification, say so explicitly instead of pretending the flow was tested.
- Prefer small, public-safe changes over importing large chunks from private source trees
- If you use sibling
../coremateor../haomai_v0.0.1for reference, diff carefully and port only the public-release-safe subset - Keep comments and docs consistent with actual file paths and current behavior
- When behavior changes, update
README,README_CN, or this file if the change affects onboarding or agent guidance - Never change protocol/event names on one side only
- Never delete a module just because it looks unused before checking dependency injection and Android references
- The repo root is
opengui-release, not the larger maintainer workspace CLAUDE.mdis the repository-wide instruction source of truthAGENTS.mdonly points back here; if there is any ambiguity, follow this file- The main mission is to keep the public repo buildable, understandable, and safe for the source-available public release