Skip to main content

What is LexQ CLI?

LexQ CLI (@lexq/cli) is a command-line tool for managing the full policy lifecycle — from creating policy groups to deploying versions to production. It covers everything the Console does, plus it works as an MCP Server for AI agent integration.
npm install -g @lexq/cli

Key Features

Full Policy Lifecycle

Create, test, publish, and deploy policies entirely from the terminal.

AI Agent Ready

Includes agent skills, schemas, and MCP Server mode for AI-powered automation.

Dry Run & Simulation

Validate rules with single-input dry runs or batch simulations against historical data.

JSON & Table Output

Machine-readable JSON (default) or human-readable table format.

Architecture

The CLI exclusively calls module-partner-api via API Key authentication.
LexQ CLI ──► module-partner-api (api.lexq.io:8080) ──► PostgreSQL / Redis

                 API Key
The CLI does not call module-admin-api (Console only), module-engine-api (runtime execution), or module-batch (internal scheduler).

Two Modes

1. CLI Mode

Standard command-line usage:
lexq groups list --format table
lexq analytics dry-run --version-id <vid> --debug --mock \
  --json '{"facts": {"payment_amount": 100000}}'

2. MCP Server Mode

Run as a Model Context Protocol server for AI agent integration:
lexq serve --mcp
This exposes 53 tools over stdio — every CLI command becomes an MCP tool that Claude, Gemini, Copilot, and other AI agents can call directly. See the MCP Server Setup Guide.

For AI Agent Developers

The npm package includes agent-readable documentation:
node_modules/@lexq/cli/
├── skills/              # 6 skill files — structured how-to guides
├── AGENTS.md            # Universal agent onboarding guide
├── CONTEXT.md           # Platform architecture & glossary
└── schemas/             # JSON schemas for validation

Next Steps

Installation

Install the CLI and authenticate.

Command Reference

Full list of all 61 commands.

MCP Server

Set up MCP for Claude, VS Code, and other AI tools.