Skip to main content

Requirements

  • Node.js 18 or later
  • An active LexQ account with an API key

Installation

npm install -g @lexq/cli
Verify: lexq --version

Authentication

Step 1: Get Your API Key

  1. Log in to the LexQ Console
  2. Navigate to Management → API Keys
  3. Click Generate New Key
  4. Copy the key (format: sk_live_xxxxxxxxxxxxx)
API keys grant full access to your organization’s policy engine. Store them securely and never commit them to version control.

Step 2: Log In

lexq auth login
# Enter your API Key: sk_live_xxxxxxxxxxxxx
# ✓ Authenticated successfully
The key is persisted at ~/.lexq/config.json.

Step 3: Verify

lexq auth whoami

Configuration

Config is stored at ~/.lexq/config.json:
{
  "apiKey": "sk_live_xxxxxxxxxxxxx",
  "baseUrl": "https://api.lexq.io/api/v1/partners",
  "format": "json"
}

Global Options

Every command accepts these flags:
FlagDescription
--format <json|table>Output format (default: json)
--api-key <key>Override stored API key
--base-url <url>Override API base URL
--dry-runPreview the HTTP request without executing
--verboseShow full request/response details
--no-colorDisable colored output
For AI agents: Always use --format json (the default). Parse JSON output programmatically. Use --format table only for human-readable display.

Next Steps

Command Reference

Browse all 61 available commands.

MCP Server

Set up AI agent integration via MCP.