Lelu logo
LeluEngine
CLI Reference

CLI Commands

Complete reference for the Lelu CLI commands available in all SDK packages. View audit logs and manage authorization policies directly from your terminal.

Installation

The CLI is included with all Lelu SDK packages. Choose your preferred language:

npm install -g lelu-agent-auth

Available Commands

# Launch visual UI (Lelu Studio)
npx lelu-agent-auth studio

# Launch on custom port
npx lelu-agent-auth studio -p 4000

# View audit logs
npx lelu-agent-auth audit-log

# List all policies
npx lelu-agent-auth policies list

# View specific policy
npx lelu-agent-auth policies get auth

# Create/update policy from file
npx lelu-agent-auth policies set auth ./auth.rego

# Delete policy
npx lelu-agent-auth policies delete old-policy

# Show help
npx lelu-agent-auth help

Command Reference

Visual UI Command

Lelu Studio

Launch a visual UI for managing policies and viewing audit logs. Works like Prisma Studio - just install and run! The UI is bundled in the npm package and starts immediately. No Docker required.

CommandDescription
studioLaunch visual UI (bundled in package, no Docker needed)
studio -p <port>Launch on custom port (default: 3002)
studio --no-browserLaunch without opening browser
studio -b <browser>Open in specific browser (chrome, firefox, safari)
studio --dockerUse Docker mode (starts all services with docker-compose)

Audit Log Commands

CommandDescription
audit-logView recent authorization events and audit trail data

Policy Management Commands

CommandDescription
policies listList all policies with metadata
policies get <name>View a specific policy's content and details
policies set <name> <file>Create or update a policy from a Rego file
policies delete <name>Delete a policy by name

Environment Variables

Configure CLI behavior using these environment variables:

VariableDefaultDescription
LELU_PLATFORM_URLhttp://localhost:9091Platform API URL
LELU_PLATFORM_API_KEYplatform-dev-keyPlatform API key for authentication
LELU_ENGINE_URLhttp://localhost:8083Engine API URL
LELU_TENANT_IDdefaultTenant ID for multi-tenant setups
LELU_AUDIT_LIMIT20Number of audit events to fetch
BROWSER-Browser to open Studio in (chrome, firefox, safari)

Examples

Launch Visual UI

terminal
# Launch Lelu Studio (auto-starts with Docker)
lelu studio

# Launch on custom port
lelu studio -p 4000

# Launch without opening browser
lelu studio --no-browser

# Open in specific browser
lelu studio -b firefox
BROWSER=chrome lelu studio

Basic Usage

terminal
# View recent audit events
lelu audit-log

# List all policies
lelu policies list

# View a specific policy
lelu policies get auth

Policy Management

terminal
# Create a new policy from file
lelu policies set auth ./auth.rego

# Update existing policy
lelu policies set auth ./updated-auth.rego

# Delete policy
lelu policies delete old-policy

Custom Configuration

terminal
# Use custom platform URL
LELU_PLATFORM_URL=https://your-platform.com lelu audit-log

# Use different tenant
LELU_TENANT_ID=prod lelu policies list

# Fetch more audit events
LELU_AUDIT_LIMIT=50 lelu audit-log

Error Handling

The CLI provides helpful error messages and troubleshooting guidance:

Platform Service Required

All CLI commands require the Lelu platform service to be running. If the service is not available, the CLI will:

  • • Display clear error messages
  • • Provide Docker setup instructions
  • • Show the current connection URL
  • • Suggest troubleshooting steps