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 & Impact Simulation

Validate rules with Dry Run (single input) or Impact Simulation (historical data) before deploying.

JSON & Table Output

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

Architecture

The CLI calls the LexQ API via API Key authentication.
LexQ CLI ──► api.lexq.io (API Key auth)


          LexQ Policy Engine

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

Connect AI agents to LexQ. Two connection methods available: Cloud (Claude.ai) — No install required. Add https://mcp.lexq.io as a Custom Integration in Claude.ai settings. OAuth handles authentication automatically. Local (stdio) — For Claude Desktop, VS Code, Cursor, and other desktop tools:
lexq serve --mcp
Both methods expose the same full toolset. 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 commands.

MCP Server

Connect Claude.ai, VS Code, and other AI tools.