mgi_prepall
v0.0.5
Published
MGI Prepall 开发调试 CLI — 一键拉起 device-driver-simulator 与 robot-server
Downloads
161
Readme
mgi_prepall
The CLI for PrepAll™ — run the PrepAll stack locally for simulation and testing (no physical robot required), with a live split-pane log view.
Use it to:
- Exercise the
robot-serverREST API against a software-onlydevice-driver-simulator - Reproduce protocol runs and reproduce bugs on your own machine
- Validate client integrations (Studio, web UIs, scripts) without hardware
Requirements
- Node.js >= 20.11
- macOS or Linux (Windows works but requires Developer Mode for symlink support)
Installation
npm install -g mgi_prepallQuick start
Start the simulator stack directly:
mgi_prepall simulatorOr run without arguments to enter interactive mode, then type / to open the command palette and select /simulator:
mgi_prepallWhat it runs
mgi_prepall simulator starts two processes in sequence and streams their logs side-by-side in your terminal. The simulator replaces the real hardware driver so the full stack runs purely in software:
| Pane | Service | Role | Listens on |
| --- | --- | --- | --- |
| Left (cyan) | device-driver-simulator | Pretends to be the robot hardware (gRPC server) | gRPC :50000, admin HTTP :50002 |
| Right (magenta) | robot-server | Real PrepAll backend (REST API + protocol engine) | HTTP :41960 |
Once both services are ready, point your client / tests at:
- REST API: http://localhost:41960/v1
- Swagger UI (interactive API explorer for testing): http://localhost:41960/doc
Hotkeys
| Key | Action |
| --- | --- |
| q or Ctrl+C | Exit (gracefully stops both services) |
| l | Clear both log panes |
| / | Open the command palette (interactive mode) |
Runtime directory
On first run the CLI seeds ~/.mgi_prepall/ as the working directory for the simulated stack:
~/.mgi_prepall/
├── .env # Auto-generated on first run (random JWT_SECRET)
├── db/ # SQLite database (prepall.db)
├── logs/ # Runtime logs
├── config/
│ ├── default/ # Read-only preset, tracks the installed CLI version
│ └── user/ # Your overrides (never overwritten on upgrade)
└── assets/ # Read-only preset, tracks the installed CLI versionassets/ and config/default/ are re-linked to the installed package on every launch, so npm update -g mgi_prepall automatically picks up preset changes. Your data in db/, logs/, config/user/, and .env is never touched.
Isolating test runs
Override the runtime root with MGI_PREPALL_HOME to keep test data out of your default profile — useful for parallel test sessions or for resetting state between scenarios:
MGI_PREPALL_HOME=/tmp/mgi-test-run-1 mgi_prepall simulatorEdit ~/.mgi_prepall/.env to change PORT, JWT_SECRET, etc.
Troubleshooting
Port in use — check lsof -i :50000 -i :41960 -i :50002 and stop any conflicting process before starting.
Database issues — delete ~/.mgi_prepall/db/prepall.db to start fresh (your test protocols and data will be lost).
Reset everything between test runs — remove ~/.mgi_prepall/ entirely; the next launch re-seeds it from scratch.
License
UNLICENSED — internal use only.
