@gorules/cli
v0.2.1
Published
Command-line tool for the GoRules BRMS platform
Downloads
84
Readme
@gorules/cli
Command-line tool for GoRules — a business rules management system (BRMS) for decision tables, decision graphs, and expressions.
Installation
npm install -g @gorules/cliOr run directly with npx (e.g. mcp start):
npx @gorules/cli mcp startMCP Bridge
2 The CLI includes an MCP (Model Context Protocol) bridge that connects AI tools like Claude, Cursor, and Windsurf to the GoRules decision graph editor.
Quick Start
gorules mcp startThis starts a local server on localhost:41919 that:
- Exposes an MCP endpoint (
/mcp) for AI tool integration - Connects to the GoRules editor via WebSocket
- Provides REST endpoints for evaluating decisions and fetching files
Options
| Flag | Description | Default |
| ------------ | --------------------- | ----------- |
| -p, --port | Server port | 41919 |
| -h, --host | Server host | localhost |
| -u, --url | GoRules server URL | — |
| --open | Open browser on start | false |
Connecting
- Run
gorules mcp start - Open the GoRules editor and click Connect MCP
- Enter the connection token displayed in your terminal
REST Endpoints
The bridge exposes REST endpoints for local development:
Evaluate a decision graph:
curl -X POST http://localhost:41919/evaluate/my-decision \
-H "Content-Type: application/json" \
-d '{"context": {"customer": {"tier": "premium"}, "orderTotal": 150}}'Retrieve a decision file:
curl http://localhost:41919/file/my-decisionThese endpoints can also be used as a loader for ZenEngine:
const engine = new ZenEngine({
loader: async (key) => {
const res = await fetch(`http://localhost:41919/file/${key}`);
return res.json();
},
});AI Tool Configuration
Add the MCP server to your AI tool's configuration:
Claude Desktop / Claude Code:
{
"mcpServers": {
"gorules": {
"command": "gorules",
"args": ["mcp", "start"]
}
}
}Development
pnpm install
pnpm dev # Build and run
pnpm build # Production build
pnpm lint # Lint
pnpm format:fix # Format