日本語 | English
An automated operation agent for macOS (desktop application). Provides a foreground control panel with Electron and executes OS operations in collaboration with a Python Executor.
dev.sh is an integrated CLI that handles everything from setup to startup, build, and distribution. It displays a status panel (Bun / node_modules / venv / build artifacts, etc.) and allows you to safely operate from a color-coded menu.
# Interactive menu (with status display)
./dev.sh
# Status check and suggestions for next steps
./dev.sh doctorIf your terminal cannot display emojis, you can switch to text display using an environment variable.
MIKI_DEV_NO_EMOJI=1 ./dev.shThe same functions as number selection are also available as subcommands. If you are familiar with them, you can call them directly.
./dev.sh install # Install Node dependencies
./dev.sh setup-python # Create/regenerate Python virtual environment
./dev.sh build-all # Build renderer, backend, and executor all at once
./dev.sh start --debug # Start in debug mode
./dev.sh dist # Distribution buildInitial setup procedure (all can be executed from dev.sh):
# 1. Check status (follow instructions if warnings appear)
./dev.sh doctor
# 2. Install Node dependencies
./dev.sh install
# 3. Setup Python virtual environment (regenerate if broken)
./dev.sh setup-python
# 4. Build including backend/executor
./dev.sh build-all
# 5. Start the application
./dev.sh startstart/start --debug- Start the app (development/debug)start-fresh- Reset setup flags and startbuild-all- Build renderer, backend, and executor all at oncebuild-renderer- Build frontend (renderer)build-backend/build- Build backendbuild-executor- Build Python executor (venv required)dist- Build distribution packageinstall- Install Node dependenciessetup-python- Setup/regenerate Python virtual environmentdoctor/status- Check status and display recommended actionsclean- Delete build artifacts (with confirmation)reset-setup- Reset setup flagslogs- Open app log directoryhelp/menu- Display help or interactive menu
dev.sh is structured to register small tasks.
- Add one line to
MENU_ITEMS:key|label|execution_function|kindkindis one ofsafe/slow/info/danger(used for color coding and icons. Unknown values are displayed assafeequivalent)
- Define the added function body in the same file (call
preflight_node/preflight_pythonif there are environment prerequisites) - If you want to call it from a subcommand, add
key)to thecaseat the bottom
Example: my-task|📝 My Custom Task|my_function|safe
key is a guideline for subcommand names and identifiers. Since the interactive menu uses label / kind for display, adding to case is necessary when treating it as a subcommand.
You can integrate new tasks with minimal editing, so please also consolidate project-specific processing in dev.sh.
If you want to check the agent's behavior in detail, use the --debug flag:
./dev.sh start --debug
# or
bun run dev -- --debugIn debug mode, the following information is output:
- Details of tools called by the agent (
elementsJson,webElements, etc.) - Tool execution results
- Content sent to AI (prompts, history, screenshots)
- Responses from AI
- Screenshots of each step are saved in
desktop/backend/.screenshot/
bun --cwd desktop installbun --cwd desktop run devThe Controller is bundled for Node, and the Executor is bundled with PyInstaller.
bun --cwd desktop run build:backendPython Executor example:
source venv/bin/activate
pyinstaller --name miki-executor --onedir src/executor/main.py --distpath desktop/backend/executorDistribution builds can be executed all at once using dev.sh.
The project includes comprehensive tests for core functionality using Vitest.
# Run all tests once
npm test
# Run tests in watch mode (auto-rerun on file changes)
npm run test:watch
# Run tests with UI
npm run test:ui
# Run tests with coverage report
npm run test:coverageTests are located alongside source files with the .test.ts extension:
src/core/python-bridge.test.ts- Tests for Python bridge communication logicsrc/adk/tools/macos-tool-suite.test.ts- Tests for macOS tool suite and coordinate normalizationsrc/adk/orchestrator.test.ts- Tests for agent orchestrator event handling
The test suite covers:
- Coordinate normalization for different screen sizes
- PythonBridge retry mechanisms and timeout handling
- MacOSAgentOrchestrator event emission patterns
- Tool execution logic and response formatting
To add tests for a new module:
- Create a new file with
.test.tsextension next to the source file - Import testing utilities from Vitest:
import { describe, it, expect, vi } from 'vitest';
- Write test cases using Vitest's familiar API (similar to Jest)
- Run
npm testto verify your tests pass
- Command + Shift + Space: Open/close chat window
You can send requests directly to AI from the chat window.
desktop/: Main Electron apprenderer/index.html: Main control panelrenderer/chat.html: Chat window
src/controller/: LLM control logicsrc/executor/: MacOS operations (Python)venv/: Python virtual environment
For a detailed explanation of the system architecture, see the Architecture documentation.
Please read CONTRIBUTING.md for setup steps, coding standards, and PR guidelines.
This project is licensed under the MIT License.
desktop/renderer/index.htmlanddesktop/renderer/chat.htmluse Tailwind CDN, so CSP includesstyle-src 'unsafe-inline'.- For production distribution, either switch Tailwind to build-time compilation to avoid
unsafe-inline, or document this risk.