Skip to main content

Command Structure

lexq <group> <action> [options]

Auth

CommandDescription
lexq auth loginStore API key interactively
lexq auth logoutRemove stored credentials
lexq auth whoamiShow current authentication info (tenant, role, key mask)

Status

CommandDescription
lexq statusCheck API connectivity and measure latency
lexq status verifies that the API is reachable and your key is valid by calling the whoami endpoint and reporting latency. lexq auth whoami returns the full authentication details. Use status for quick health checks; use whoami for identity verification.

Groups

CommandDescription
lexq groups listList all policy groups
lexq groups get --id <gid>Get group detail
lexq groups create --json '{...}'Create a new group
lexq groups update --id <gid> --json '{...}'Update group
lexq groups delete --id <gid>Delete group
lexq groups ab-test start --group-id <gid> --json '{...}'Start A/B test
lexq groups ab-test stop --group-id <gid>Stop A/B test
lexq groups ab-test adjust --group-id <gid> --json '{...}'Adjust traffic rate

Versions

CommandDescription
lexq versions list --group-id <gid>List versions
lexq versions get --group-id <gid> --id <vid>Get version detail
lexq versions create --group-id <gid> --json '{...}'Create DRAFT
lexq versions update --group-id <gid> --id <vid> --json '{...}'Update version
lexq versions delete --group-id <gid> --id <vid>Delete version
lexq versions clone --group-id <gid> --id <vid>Clone to new DRAFT

Rules

CommandDescription
lexq rules list --group-id <gid> --version-id <vid>List rules
lexq rules get --group-id <gid> --version-id <vid> --id <rid>Get rule detail
lexq rules create --group-id <gid> --version-id <vid> --json '{...}'Create rule
lexq rules update --group-id <gid> --version-id <vid> --id <rid> --json '{...}'Update rule
lexq rules delete --group-id <gid> --version-id <vid> --id <rid>Delete rule
lexq rules reorder --group-id <gid> --version-id <vid> --rule-ids "a,b,c"Set priority order
lexq rules toggle --group-id <gid> --version-id <vid> --id <rid> --enabled trueEnable/disable
Example:
lexq rules create --group-id <gid> --version-id <vid> --json '{
  "name": "VIP 10% Discount",
  "priority": 0,
  "condition": {
    "type": "GROUP", "operator": "AND",
    "children": [
      { "type": "SINGLE", "field": "customer_tier", "operator": "EQUALS", "value": "VIP", "valueType": "STRING" },
      { "type": "SINGLE", "field": "payment_amount", "operator": "GREATER_THAN_OR_EQUAL", "value": 100000, "valueType": "NUMBER" }
    ]
  },
  "actions": [{ "type": "DISCOUNT", "parameters": { "method": "PERCENTAGE", "rate": 10, "refVar": "payment_amount" } }]
}'

Facts

CommandDescription
lexq facts listList all fact definitions
lexq facts create --key <key> --name <n> --type <type>Create fact
lexq facts update --id <fid> --name <n>Update fact
lexq facts delete --id <fid>Delete fact

Deploy

CommandDescription
lexq deploy publish --group-id <gid> --version-id <vid> --memo "..."DRAFT → ACTIVE
lexq deploy live --group-id <gid> --version-id <vid> --memo "..."Deploy to production
lexq deploy rollback --group-id <gid> --memo "..."Revert to previous version
lexq deploy undeploy --group-id <gid> --memo "..."Remove live version
lexq deploy history --group-id <gid>List deployment history
lexq deploy detail --deployment-id <id>Get deployment detail
lexq deploy overviewAll groups’ deployment status

Analytics — Dry Run

CommandDescription
lexq analytics dry-run --version-id <vid> --json '{...}'Execute dry run
lexq analytics dry-run-compare --json '{...}'Compare two versions
lexq analytics requirements --group-id <gid> --version-id <vid>Check required facts

Analytics — Batch Simulation

CommandDescription
lexq analytics simulation start --json '{...}'Start simulation
lexq analytics simulation status --id <simId>Poll for results
lexq analytics simulation list [--status <s>]List simulations
lexq analytics simulation cancel --id <simId>Cancel
lexq analytics simulation export --id <simId> --format json|csvExport results

History

CommandDescription
lexq history list [--group-id <gid>]List execution history
lexq history get --id <eid>Get execution detail
lexq history stats [--group-id <gid>]Aggregate statistics

Integrations

CommandDescription
lexq integrations listList all integrations
lexq integrations get --id <iid>Get integration detail
lexq integrations save --json '{...}'Create or update
lexq integrations delete --id <iid>Delete
lexq integrations config-spec --type <type>Show required config

Logs

CommandDescription
lexq logs list [filters]List failure logs
lexq logs get --id <lid>Get detail
lexq logs action --id <lid> --action <a>Retry, skip, resolve
lexq logs bulk-action --json '{...}'Bulk action

Serve

CommandDescription
lexq serve --mcpStart stdio MCP server (53 tools)
MCP Server Setup Guide

Standard Workflow

# 1. Create group       → lexq groups create --json '{...}'
# 2. Create version      → lexq versions create --group-id <gid> --json '{...}'
# 3. Register facts      → lexq facts create --key ... --name ... --type ...
# 4. Add rules           → lexq rules create --group-id <gid> --version-id <vid> --json '{...}'
# 5. Validate (dry run)  → lexq analytics dry-run --version-id <vid> --debug --mock --json '{...}'
# 6. Publish             → lexq deploy publish --group-id <gid> --version-id <vid> --memo "..."
# 7. Deploy              → lexq deploy live --group-id <gid> --version-id <vid> --memo "..."
Cannot create rules without a DRAFT version. Cannot publish without rules. Cannot deploy a DRAFT. Always dry-run before publishing.