> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lexq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Overview

> Command-line interface for the LexQ Decision Operations Platform. Manage policies, run Impact Simulation, and deploy from your terminal. Built for humans and AI agents.

## 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.

```bash theme={null}
npm install -g @lexq/cli
```

## Key Features

<CardGroup cols={2}>
  <Card title="Full Policy Lifecycle" icon="arrows-spin">
    Create, test, publish, and deploy policies entirely from the terminal.
  </Card>

  <Card title="AI Agent Ready" icon="robot">
    Includes agent skills, schemas, and MCP Server mode for AI-powered automation.
  </Card>

  <Card title="Dry Run & Impact Simulation" icon="flask-vial">
    Validate rules with Dry Run (single input) or Impact Simulation (historical data) before deploying.
  </Card>

  <Card title="JSON & Table Output" icon="table-columns">
    Machine-readable JSON (default) or human-readable table format.
  </Card>
</CardGroup>

## 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:

```bash theme={null}
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:

```bash theme={null}
lexq serve --mcp
```

Both methods expose the same **full toolset**. See the [MCP Server Setup Guide](/cli/mcp-server).

## 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

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/cli/installation">
    Install the CLI and authenticate.
  </Card>

  <Card title="Command Reference" icon="terminal" href="/cli/commands">
    Full list of all commands.
  </Card>

  <Card title="MCP Server" icon="plug" href="/cli/mcp-server">
    Connect Claude.ai, VS Code, and other AI tools.
  </Card>
</CardGroup>
