A local proxy service that enables OpenClaw to interact with the Gemini CLI. This proxy handles TTY simulation, automated CLI execution, file management, and scheduled tasks.
- Automated CLI Interaction: Launches the Gemini CLI in non-interactive mode using
-pand--yoloflags. - TTY Simulation: Uses
node-ptyto simulate a terminal environment for the CLI. - Local Service: Provides a RESTful API for OpenClaw to send messages and receive CLI output.
- File Management: Endpoint to upload markdown files directly into the proxy's workspace.
- Scheduled Tasks: Built-in cron job support to run CLI commands at specific intervals.
- TDD Backed: Developed with Test-Driven Development, achieving 100% code coverage.
npm installnpm startThe service will listen on port 3000 by default (configurable via PORT environment variable).
-
POST
/message: Send a prompt to the Gemini CLI.- Body:
{ "content": "your prompt here" } - Response:
{ "response": "CLI output here" }
- Body:
-
POST
/files: Upload a file to the workspace.- Body:
{ "name": "filename.md", "content": "file content here" } - Response:
{ "success": true }
- Body:
-
POST
/cron: Schedule a recurring task.- Body:
{ "schedule": "* * * * *", "message": "prompt to run" } - Response:
{ "success": true, "schedule": "* * * * *" }
- Body:
Run tests:
npm testRun tests with coverage:
npm run test:coverage