Skip to main content

Lua AI CLI v3.0.0

Build and deploy AI agents with superpowers
lua [options] [command]
New in v3.1.0 (Marketplace): - 🛒 Lua Marketplace - Discover, install, and publish skills directly from the CLI with lua marketplace.
New in v3.0.0 (lua-cli package): - 🤖 LuaAgent - Unified agent configuration with persona, skills, webhooks, jobs, and processors - 🪝 LuaWebhook - HTTP endpoints for external integrations (Stripe, Shopify, etc.) - ⏰ LuaJob - Scheduled tasks with cron patterns - 📥 PreProcessor - Filter and route messages before they reach your agent - 📤 PostProcessor - Transform and format agent responses - 🔄 Jobs API - Dynamically create scheduled tasks from tools
New in v2.6.0 (CLI commands): - 🎯 Direct environment access for all commands - ⌨️ Shell autocomplete support (Bash, Zsh, Fish) - 🚀 New lua skills command for production skill management - ⚡ New lua features command for managing agent capabilities - ⚡ Faster workflows with lua push skill, lua env production, etc.

Options

-V, --version   # Output the version number
-h, --help      # Display help for command

All Commands

CommandCategoryDescription
lua auth🔐 AuthenticationManage API keys and authentication
lua init🚀 Project SetupInitialize a new Lua skill project
lua env⚙️ ConfigurationManage environment variables (sandbox/production)
lua persona🤖 ConfigurationManage agent persona (sandbox/production)
lua features⚡ ConfigurationManage agent capabilities and features
lua resources📚 ConfigurationManage agent knowledge base
lua marketplace🛒 EcosystemDiscover, install, and publish skills
lua skills🔧 DevelopmentView and manage skills (sandbox/production)
lua compile📦 DevelopmentCompile skill to deployable format
lua sync🔄 DevelopmentDetect and resolve drift between server and local code
lua test💬 TestingTest skill tools interactively
lua chat💬 TestingInteractive chat with your agent
lua push☁️ DeploymentPush components to server
lua deploy🚀 DeploymentDeploy version to production
lua mcp🔌 IntegrationManage MCP (Model Context Protocol) servers
lua production🚀 DeploymentView and manage production environment
lua channels🔌 IntegrationManage communication channels
lua logs🐛 DebuggingView and filter agent logs by component type (Skills, Jobs, Webhooks, etc.)
lua completion⌨️ UtilitiesGenerate shell autocomplete scripts
lua admin🛠️ UtilitiesOpen admin dashboard in browser
lua evals📊 UtilitiesOpen evaluations dashboard in browser
lua docs📖 UtilitiesOpen documentation in browser

Quick Examples

# Authentication & Setup
lua auth configure      # 🔑 Set up your API key
lua init               # 🚀 Initialize a new project

# Configuration (Interactive or Direct)
lua env                # ⚙️ Manage environment variables
lua env sandbox        # 🎯 Direct: manage sandbox .env file
lua env production     # 🎯 Direct: manage production env vars
lua persona            # 🤖 Manage agent persona
lua persona sandbox    # 🎯 Direct: edit sandbox persona
lua persona production # 🎯 Direct: deploy persona version
lua features           # ⚡ Manage agent capabilities (tickets, RAG, etc.)
lua resources          # 📚 Manage knowledge base
lua marketplace        # 🛒 Access skills marketplace

# Development
lua skills             # 🔧 View and manage skills
lua skills sandbox     # 🎯 Direct: view local skills
lua skills production  # 🎯 Direct: manage production skills
lua compile            # 📦 Compile your skills
lua sync               # 🔄 Check for drift between server and local
lua test               # 🧪 Test tools interactively
lua chat               # 💬 Start interactive chat

# Deployment (Interactive or Direct)
lua push               # ☁️ Push to server (choose component)
lua push skill         # 🎯 Direct: push skill
lua push persona       # 🎯 Direct: push persona
lua push mcp           # 🎯 Direct: push MCP server
lua push all --force   # 🎯 Push all components
lua deploy             # 🚀 Deploy to production

# Integration & Debugging
lua mcp                # 🔌 Manage MCP servers (list, activate, deactivate)
lua channels           # 🔌 Manage communication channels
lua logs               # 🐛 View and filter execution logs (interactive filtering)

# Utilities
lua completion bash    # ⌨️ Generate bash autocomplete
lua completion zsh     # ⌨️ Generate zsh autocomplete
lua completion fish    # ⌨️ Generate fish autocomplete
lua admin              # 🛠️ Open admin dashboard
lua evals              # 📊 Open evaluations dashboard
lua docs               # 📖 Open documentation
Get help for any command: lua [command] --help or lua help [command]Documentation: https://docs.heylua.ai
Support: https://heylua.ai/support

Quick Command Reference

lua init

Initialize new skill project

lua skills

View and manage skills

lua env

Manage environment variables

lua persona

Configure agent personality

lua features

Manage agent capabilities

lua mcp

Manage MCP servers

lua sync

Detect and resolve drift

lua test

Test tools interactively

lua chat

Interactive chat with your agent

lua push

Upload version to server

lua deploy

Deploy to production

lua completion

Shell autocomplete setup

Shell Autocomplete ⚡ NEW

Enable tab completion for all Lua CLI commands and arguments:
# One-time setup
lua completion bash >> ~/.bashrc
source ~/.bashrc

# Now try:
lua pu<TAB>      # Completes to: lua push
lua push <TAB>   # Shows: skill, persona
lua env <TAB>    # Shows: sandbox, staging, production

Learn More

Direct Mode ⚡ NEW

Skip interactive prompts by specifying your target directly:
# Interactive (old way - still works!)
lua push
? What would you like to push? 
 skill
    persona

# Direct (new way - faster!)
lua push skill      # Push skill directly
lua push persona    # Push persona directly

Command Categories

Authentication

Set up API key authentication
lua auth configure
Choose between:
  • Email: OTP verification
  • API Key: Existing key

Learn More

Skill Management

Create new skill project
mkdir my-skill && cd my-skill
lua init                    # Minimal project (recommended)
lua init --with-examples    # Include 30+ example tools
Default (minimal):
  • Clean agent ready to customize
  • TypeScript configuration
  • lua.skill.yaml config
With —with-examples:
  • 30+ example tools
  • Example webhooks, jobs, processors
  • Complete e-commerce flow examples

Learn More

Common Workflows

New Project Workflow

1

Authenticate

lua auth configure
2

Initialize

mkdir my-skill && cd my-skill
lua init                    # Minimal project (recommended)
# OR
lua init --with-examples    # Include example code
3

Configure Environment

lua env sandbox
Add API keys and configuration to .env file
4

Configure Persona

lua persona sandbox
Define your agent’s personality in local file
5

Test Your Agent

lua chat
Interactive chat in sandbox mode
Optional: Use lua test to test individual tools with specific inputs
6

Deploy

lua push
lua deploy

Development Workflow

1

Configure Environment (if needed)

lua env sandbox      # Update local .env
lua env production   # Update production env vars
Add any new API keys or configuration needed
2

Update Persona (if needed)

lua persona sandbox  # Edit and test locally
Refine agent personality based on feedback
3

Make Changes

Edit your tools in src/tools/*.ts
4

Test Your Agent

lua chat
Select sandbox mode to test with local changes
Pro tip: Use lua test to debug specific tool logic if needed
5

Push Persona to Production (if changed)

lua persona production  # Deploy persona version
Or use: lua push persona
6

Push Skill When Ready

lua push skill
Upload new skill version
7

Deploy to Production

lua deploy
Make available to all users

Quick Fix Workflow

# Edit the tool
vim src/tools/MyTool.ts

# Test the tool
lua test

# Test conversationally
lua chat

# Push and deploy (direct mode - faster!)
lua push skill && lua deploy

Global Flags

All commands support:
--help       Show command help
--version    Show CLI version

Environment Variables

Commands automatically load environment variables from:
1

System Environment

Variables from your shell
2

.env File

Variables from project .env
3

lua.skill.yaml

Variables from skill config

Learn More

Error Handling

All commands include:
  • ✅ Descriptive error messages
  • ✅ Exit codes (0 = success, 1 = error)
  • ✅ Troubleshooting hints

Common Errors

❌ No API key found. Run `lua auth configure` first.
Solution: Run lua auth configure
❌ No lua.skill.yaml found. Please run this command from a skill directory.
Solution: Run command from skill directory or run lua init first
❌ Version 1.0.0 already exists on the server
Solution: Increment the version number in lua.skill.yaml (this is the only field you should manually edit)
❌ No index.ts found in current directory or src/ directory
Solution: Create index.ts or src/index.ts with skill definition

More Troubleshooting

v3.0.0 Agent Structure

Project Code Pattern

The v3.0.0 pattern uses LuaAgent for unified configuration:
// src/index.ts
import { LuaAgent, LuaSkill, LuaWebhook, LuaJob, LuaMCPServer } from "lua-cli";
import { mySkill } from "./skills/my-skill";
import paymentWebhook from "./webhooks/payment";
import dailyReportJob from "./jobs/daily-report";
import filesystemServer from "./mcp/filesystem";

// Export agent (v3.0.0 pattern)
export const agent = new LuaAgent({
  name: "my-agent",

  // Define personality and behavior
  persona: `You are a helpful assistant for Acme Corp.
  
Your role:
- Help customers with orders and support
- Answer product questions
- Process payments

Communication style:
- Professional yet friendly
- Clear and concise
- Patient and understanding`,

  // Skills with tools
  skills: [mySkill],

  // HTTP endpoints (optional)
  webhooks: [paymentWebhook],

  // Scheduled tasks (optional)
  jobs: [dailyReportJob],

  // MCP servers for external tools (optional)
  mcpServers: [filesystemServer],
});

Project Structure

my-agent/
├── src/
│   ├── index.ts              # Agent configuration (LuaAgent)
│   ├── skills/               # Skill definitions
│   │   └── my-skill.ts
│   ├── tools/                # Tool implementations
│   │   ├── OrderLookupTool.ts
│   │   └── CreateTicketTool.ts
│   ├── webhooks/             # Webhook handlers (v3.0.0)
│   │   └── payment.ts
│   ├── jobs/                 # Scheduled jobs (v3.0.0)
│   │   └── daily-report.ts
│   ├── mcp/                  # MCP server configurations
│   │   └── filesystem.ts
│   ├── preprocessors/        # Message filters (v3.0.0)
│   │   └── profanity-filter.ts
│   └── postprocessors/       # Response formatters (v3.0.0)
│       └── add-disclaimer.ts
├── lua.skill.yaml            # Auto-synced configuration
├── package.json
├── tsconfig.json
└── .env                      # Local environment variables

Configuration File

lua.skill.yaml

Auto-managed state manifest (IDs and versions only):
# Agent configuration
agent:
  agentId: agent_abc123
  orgId: org_xyz789

# Multi-skill support
skills:
  - name: my-skill
    version: 1.0.0
    skillId: skill_abc123 # Auto-created

# Webhooks (v3.0.0)
webhooks:
  - name: payment-webhook
    webhookId: webhook_abc123 # Auto-created

# Jobs (v3.0.0)
jobs:
  - name: daily-report
    jobId: job_abc123 # Auto-created (version tracked on server)

# MCP Servers
mcpServers:
  - name: filesystem
    mcpServerId: mcp_abc123 # Auto-created
Auto-managed fields:
  • skillId - Created during compilation
  • webhookId - Created during compilation
  • jobId - Created during compilation
  • mcpServerId - Created during compilation
  • skills, webhooks, jobs, mcpServers arrays - Populated from code
  • Versions/IDs are tracked here; persona/env/schedule live in code (sandbox) or server (production)
Manual fields:
  • agentId - Set during lua init
  • orgId - Set during lua init
  • version - Update when releasing (for each component)

System Requirements

Node.js

Version 16.0.0 or higher

npm

Version 7.0.0 or higher

TypeScript

Included in template (knowledge helpful)

Git

Optional but recommended

Storage Locations

System Keychain
  • macOS: Keychain
  • Windows: Credential Vault
  • Linux: libsecret

Next Steps