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.
| Command | Description |
|---|---|
| studio | Launch visual UI (bundled in package, no Docker needed) |
| studio -p <port> | Launch on custom port (default: 3002) |
| studio --no-browser | Launch without opening browser |
| studio -b <browser> | Open in specific browser (chrome, firefox, safari) |
| studio --docker | Use Docker mode (starts all services with docker-compose) |
Audit Log Commands
| Command | Description |
|---|---|
| audit-log | View recent authorization events and audit trail data |
Policy Management Commands
| Command | Description |
|---|---|
| policies list | List 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:
| Variable | Default | Description |
|---|---|---|
| LELU_PLATFORM_URL | http://localhost:9091 | Platform API URL |
| LELU_PLATFORM_API_KEY | platform-dev-key | Platform API key for authentication |
| LELU_ENGINE_URL | http://localhost:8083 | Engine API URL |
| LELU_TENANT_ID | default | Tenant ID for multi-tenant setups |
| LELU_AUDIT_LIMIT | 20 | Number 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
