Skip to main content

Overview

Skill management commands help you build, test, and deploy your AI skills.

lua init

Create new skill project

lua compile

Compile TypeScript code

lua test

Test tools interactively

lua push

Upload version to server

lua deploy

Deploy to production

lua init

Initialize a new Lua skill project in the current directory.
mkdir my-skill && cd my-skill
lua init                    # Minimal project (recommended)
lua init --with-examples    # Include 30+ example tools

Options

OptionDescription
--with-examplesInclude example skills, tools, jobs, webhooks, and processors
--agent-id <id>Use existing agent by ID (non-interactive)
--agent-name <name>Name for new agent (requires —org-id or —org-name)
--org-id <id>Use existing organization by ID
--org-name <name>Create new organization with this name
--forceSkip confirmations / overwrite existing project
--restore-sourcesAutomatically restore project source files from backup (requires —agent-id)

Non-Interactive Mode

# Use existing agent
lua init --agent-id abc123

# Create agent in existing organization
lua init --agent-name "My Bot" --org-id org456

# Create agent + new organization
lua init --agent-name "My Bot" --org-name "Acme Corp"

# Override existing project
lua init --agent-id abc123 --force

# With example code
lua init --agent-id abc123 --with-examples

# Restore from backup
lua init --agent-id abc123 --restore-sources

What It Does

1

Choose Agent

Select existing agent or create new one
2

Configure Agent (if new)

  • Enter business name
  • Enter agent name
  • Select business type
  • Select brand personality
  • Enter brand traits
  • Configure features
3

Create Project

  • Copies template files
  • Creates lua.skill.yaml
  • Installs dependencies
  • Ready to customize!

Interactive Prompts

$ lua init
? What would you like to do? Create new agent
? Enter business name: My Coffee Shop
? Enter agent name: CoffeeBot
? Select business type: Food & Beverage
? Select brand personality: Friendly
? Enter brand traits: Warm, welcoming, knowledgeable
🔄 Creating agent...
 Agent created successfully!
 Created lua.skill.yaml
 Copied template files
 Updated LuaAgent configuration
📦 Installing dependencies...
 Lua skill project initialized successfully!
💡 Tip: Use `lua init --with-examples` to include example code

What Gets Created

your-skill/
├── src/
│   └── index.ts              # Empty agent ready to customize
├── lua.skill.yaml            # Configuration (auto-managed)
├── package.json              # Dependencies
├── tsconfig.json             # TypeScript config
├── .env.example              # Environment variables template
└── README.md                 # Quick start guide
A clean slate - build your agent from scratch!

Configuration File

lua.skill.yaml is created with:
agent:
  agentId: agent_abc123
  orgId: org_xyz789

skills: []  # Auto-populated during compilation
The lua.skill.yaml file is auto-managed by the CLI. Do not manually edit it except for incrementing version numbers. All configuration belongs in your code (src/index.ts).
Persona is stored in your LuaAgent code (in src/index.ts), not in YAML. The YAML file is state-only and tracks IDs and versions.

lua compile

Compile TypeScript skill into deployable JavaScript bundles.
lua compile

What It Does

1

Analyze Code

Detects all tools from your src/index.ts file
2

Bundle Tools

Uses esbuild to create optimized JavaScript bundles
3

Extract Metadata

Extracts tool names, descriptions, and schemas
4

Create Deployment

Generates deployment artifacts in dist/ directory
5

Update Config

Creates/updates skills in lua.skill.yaml

Output

dist/
├── deployment.json          # Deployment metadata
├── index.js                 # Main skill bundle
└── tools/                   # Individual tool bundles
    ├── GetWeatherTool.js
    ├── UserDataTool.js
    └── ...

.lua/
├── deploy.json              # Legacy format
├── get_weather.js           # Uncompressed (debugging)
└── ...

Example Output

$ lua compile
🔨 Compiling Lua skill...
📦 Found 15 tools to bundle...
📦 Bundling GetWeatherTool...
📦 Bundling UserDataTool...
📦 Bundling ProductsTool...
... (more tools)
📦 Bundling main index...
 Skill compiled successfully - 15 tools bundled

Features

  • Automatic Detection - Finds all tools in your code
  • Fast Bundling - Uses esbuild for speed
  • Type Safety - Validates TypeScript
  • Dependency Management - Bundles all dependencies
  • Skill Creation - Auto-creates skills in config
  • Drift Detection - Checks for server/local differences

Compile Options

lua compile              # Default: compile without drift check
lua compile --sync       # Enable drift detection and prompt if found
lua compile --verbose    # Show detailed compilation output
FlagDescription
--syncEnable drift detection during compile (prompts if drift found)
--verboseShow detailed compilation output

Learn More

See lua sync for details on drift detection

lua test

Test individual tools locally in a sandboxed environment.
lua test

Options

OptionDescription
--name <name>Entity name to test (non-interactive)
--input <json>JSON input string for testing

Non-Interactive Mode

# Test a skill/tool
lua test skill --name get_weather --input '{"city": "London"}'

# Test a webhook
lua test webhook --name payment-hook --input '{"query": {}, "headers": {}, "body": {"type": "payment"}}'

# Test a job
lua test job --name daily-report

# Test preprocessor
lua test preprocessor --name filter --input '{"message": "hello", "channel": "web"}'

# Test postprocessor
lua test postprocessor --name formatter --input '{"message": "hi", "response": "hello", "channel": "web"}'

How It Works

1

Compile

Compiles your skill first
2

List Tools

Shows all available tools
3

Select Tool

Choose which tool to test
4

Enter Inputs

Dynamic prompts based on tool’s schema
5

Execute

Runs tool in secure VM sandbox
6

View Results

Shows output or error messages

Example Session

$ lua test
🧪 Testing Lua skill...
📦 Compiling code first...
 Skill compiled successfully
📄 Loaded environment variables from .env file

? 🔧 Select a tool to test:
 get_weather - Get the weather for a given city
  create_product - Create a new product
  search_products - Search products
  get_user_data - Get user data
  
 Selected tool: get_weather

📝 Enter input values:
? city (required): London

🚀 Executing tool...
Input: {
  "city": "London"
}
 Tool execution successful!
Output: {
  "weather": "3",
  "city": "London",
  "temperature": 15.2,
  "description": "Windspeed 12.3 km/h"
}

Features

  • Dynamic Prompts - Based on Zod schema
  • Type Validation - Validates inputs automatically
  • Environment Loading - Loads .env and lua.skill.yaml variables
  • Secure Sandbox - Isolated VM execution
  • Detailed Errors - Clear error messages

Testing Complex Inputs

# Nested objects
? shippingAddress.street (required): 123 Main St
? shippingAddress.city (required): New York
? shippingAddress.zip (required): 10001

# Arrays
? items[0].id (required): product_123
? items[0].quantity (required): 2
? Add another item? No

# Optional fields
? description (optional): [Press Enter to skip]

lua push

Push your compiled components to the Lua server.
lua push                 # Interactive selection
lua push skill           # Push a skill
lua push persona         # Push persona
lua push webhook         # Push a webhook
lua push job             # Push a job
lua push preprocessor    # Push a preprocessor
lua push postprocessor   # Push a postprocessor
lua push mcp             # Push an MCP server
lua push all --force     # Push all components

Options

OptionDescription
--name <name>Entity name to push (non-interactive)
--set-version <ver>Version to set (e.g., 1.0.5)
--forceSkip all confirmation prompts
--auto-deployAutomatically deploy to production after push

Non-Interactive Mode

# Push specific skill with version
lua push skill --name mySkill --set-version 1.0.5

# Push all components
lua push all --force

# Push and auto-deploy to production
lua push all --force --auto-deploy

# Push webhook with version
lua push webhook --name payment-hook --set-version 2.0.0

# Push job with version
lua push job --name daily-report --set-version 1.0.0
Push All: Use lua push all --force to push all components at once. Add --auto-deploy to also activate/deploy them.

Usage Modes

Default behavior - prompts for selection
$ lua push
? What would you like to push?
 skill
    persona
Best for: When you’re not sure or want to see options

What It Does (Skills)

1

Select Skill (if interactive)

Choose which skill to push (if multiple)
2

Enter Version

Enter new version number (auto-suggests next patch)
Current version: 1.0.0
? Enter new version to push: (1.0.1)
3

Update Configuration

Updates version in lua.skill.yaml
4

Authenticate

Validates your API key
5

Compile

Automatically compiles the skill
6

Upload

Uploads bundles to server
7

Optional Deploy

Choose to deploy immediately or later
? Would you like to deploy this version to production now? (y/N)

Example: Push Only (Interactive)

$ lua push
? What would you like to push?
 skill
    persona

📦 Pushing skill: customer-service

Current version: 1.0.0
? Enter new version to push: (1.0.1) ⏎

📝 Updating version from 1.0.0 to 1.0.1
 Authenticated
🔄 Compiling skill...
 Skill compiled successfully - 10 tools bundled
🔄 Pushing version to server...
 Version 1.0.1 of "customer-service" pushed successfully

? Would you like to deploy this version to production now? No

[Version pushed, use 'lua deploy' to deploy later]

Example: Push Only (Direct Mode)

$ lua push skill
📦 Pushing skill: customer-service

Current version: 1.0.0
? Enter new version to push: (1.0.1) ⏎

📝 Updating version from 1.0.0 to 1.0.1
 Authenticated
🔄 Compiling skill...
 Skill compiled successfully - 10 tools bundled
🔄 Pushing version to server...
 Version 1.0.1 of "customer-service" pushed successfully

? Would you like to deploy this version to production now? No

[Version pushed, use 'lua deploy' to deploy later]

Example: Push and Deploy

$ lua push
📦 Pushing skill: order-management

Current version: 0.5.0
? Enter new version to push: 1.0.0

📝 Updating version from 0.5.0 to 1.0.0
 Authenticated
🔄 Compiling skill...
 Skill compiled successfully - 8 tools bundled
🔄 Pushing version to server...
 Version 1.0.0 of "order-management" pushed successfully

? Would you like to deploy this version to production now? Yes

⚠️  WARNING: You are about to deploy to PRODUCTION!
⚠️  This will affect ALL users immediately.

? Are you absolutely sure you want to deploy? Yes

🔄 Publishing version...
 Version 1.0.0 deployed successfully to production

Version Management

The command auto-suggests the next patch version:
Current: 1.0.0  → Suggests: 1.0.1
Current: 1.5.9  → Suggests: 1.5.10
Current: 2.0.0  → Suggests: 2.0.1
Press Enter to accept or type your own version
Version Conflict Avoidance: When using --force, the CLI automatically checks the server for the highest existing version and suggests the next available version. This prevents “Version already exists” errors during automated deployments.

Deploy Now or Later?

Important Notes

Version Management:
  • Always increments version (cannot overwrite)
  • Version is updated in lua.skill.yaml
  • All versions are preserved on server
  • Can deploy any previous version
Immediate Deployment:
  • Requires two confirmations for safety
  • Affects all users immediately
  • Have rollback plan ready
  • Monitor after deployment

Version Management

The version number is the only field in lua.skill.yaml you should manually edit:
skills:
  - name: my-skill
    version: 1.0.1  # Increment this before pushing
Then push:
lua push

Requirements

  • Must be in skill directory with lua.skill.yaml
  • Must have valid API key (lua auth configure)
  • Version must not already exist on server

lua deploy

Deploy a specific version to production (all users).
lua deploy

Options

OptionDescription
--skill-name <name>Skill to deploy (non-interactive)
--skill-version <ver>Version to deploy, or ‘latest’
--forceSkip confirmation prompt

Non-Interactive Mode

# Deploy specific version
lua deploy --skill-name mySkill --skill-version 1.0.5 --force

# Deploy latest version
lua deploy --skill-name mySkill --skill-version latest --force

What It Does

1

Fetch Versions

Lists all pushed versions from server
2

Select Version

Choose which version to deploy
3

Confirm

Shows warning about production deployment
4

Deploy

Publishes selected version
5

Live!

Version is immediately available to all users

Example

$ lua deploy
 Authenticated
🔄 Fetching available versions...

? Select a version to deploy:
  1.0.2 - Created: Oct 3, 2025 by [email protected]
  1.0.1 - Created: Oct 2, 2025 by [email protected]
 1.0.0 (CURRENT) - Created: Oct 1, 2025 by [email protected]

? ⚠️  Warning: This version will be deployed to all users. Do you want to proceed? Yes
🔄 Publishing version...
 Version 1.0.0 deployed successfully

Features

  • Shows all available versions
  • Indicates currently deployed version
  • Requires explicit confirmation
  • Immediate deployment (no rollback delay)
Deployment is immediate!All users will get the new version right away. Test thoroughly with lua chat first!

lua push backup

New in v3.5.0: Backup your project source files to cloud storage for disaster recovery and team collaboration.
Push your project source files to cloud storage for safekeeping. Uses content-addressed storage with automatic deduplication for efficient backups.
lua push backup                 # Backup project sources
lua push backup --force         # Force backup even if up-to-date
lua push backup --skip-compile  # Skip compilation (assume already compiled)

Options

OptionDescription
--forceForce backup even if hash matches previous backup
--skip-compileSkip compilation step (assumes dist/ already exists)

What Gets Backed Up

The backup includes all source files tracked in your compilation manifest:
  • Source Code: src/ directory (TypeScript files)
  • Configuration: lua.skill.yaml, tsconfig.json, package.json
  • Environment Template: .env.example (if exists)
  • Documentation: README.md (if exists)
NOT backed up: node_modules/, dist/, .env (secrets), .git/ (use Git for version control)

How It Works

1

Compile Project

Ensures manifest is fresh (runs lua compile if needed)
2

Calculate Project Hash

Creates a content hash of all source files for deduplication
3

Check Existing Backup

Verifies if this exact project state already exists on server
4

Upload New Files

Uploads only new/changed files (content-addressed storage)
  • Compares file hashes with server
  • Uploads missing blobs in batches
  • Deduplicates identical files across backups
5

Save Manifest

Saves the project structure and file references to MongoDB
6

Update Local Tracking

Updates lua.skill.yaml with backup hash for drift detection

Example Output

$ lua push backup
ℹ️  Project hash: 8f3d4a2b1c9e...
🔄 Checking server for existing backup...
🔄 Checking which files need upload...
ℹ️  Files: 42 total, 38 already stored, 4 to upload
ℹ️  Upload size: 12.3 KB (base64)
🔄 Uploading 4 new files to storage...
🔄 Uploaded 4/4 files...
🔄 Saving backup manifest...
 Backup pushed successfully!
   Files: 42
   New uploads: 4
   Deduplicated: 38
   Hash: 8f3d4a2b1c9e...

Restoring from Backup

To restore a backed-up project on a new machine:
# Initialize with restore flag
lua init --agent-id abc123 --restore-sources
This will:
  1. Create a new project directory
  2. Download all source files from cloud storage
  3. Restore the exact project state from backup
  4. Install dependencies
Interactive restore:
$ lua init --agent-id abc123
? Would you like to restore project sources from backup? Yes
🔄 Fetching backup manifest...
 Found backup with 42 files
🔄 Downloading source files...
🔄 Downloaded 42/42 files...
 Sources restored successfully!
💡 Run 'lua compile' to rebuild from restored sources

Use Cases

Recover from lost laptop or corrupted files:
# On new machine
lua init --agent-id abc123 --restore-sources
npm install
lua compile
lua test
All your source code is back!

Content-Addressed Storage

Backups use content-addressed storage (like Git):
  • Each file is stored by its SHA-256 hash
  • Identical files are stored only once
  • Subsequent backups only upload changed files
  • Extremely efficient for large projects with small changes
Example: If you change one line in one file, only that file is re-uploaded. The other 99 files reference existing blobs.

Best Practices

lua push backup  # Safety checkpoint
# Make risky changes
lua test
lua push skill
If something breaks, restore from backup.
Backup ≠ Version Control
  • Backup: Disaster recovery, single snapshot
  • Git: Full history, branching, collaboration
Use both:
git commit -m "Add feature"  # Version control
lua push backup              # Disaster recovery snapshot
lua push backup --force
lua push all --force --auto-deploy
Always have a recovery point before production changes.
Add to your deployment pipeline:
- name: Backup sources
  run: lua push backup --force

- name: Deploy
  run: lua push all --force --auto-deploy

Complete Workflow

New Project Workflow

# 1. Authenticate
lua auth configure

# 2. Initialize
mkdir my-skill && cd my-skill
lua init

# 3. Test
lua test

# 4. Push
lua push

# 5. Deploy
lua deploy

Development Workflow

# Configure environment if needed
lua env sandbox        # Add new API keys locally
lua env production     # Update production env vars

# Make changes to src/tools/*.ts

# Test your agent
lua chat  # Choose sandbox mode

# Optional: Test specific tools
lua test  # For debugging individual tools

# When satisfied, push (direct mode - faster!)
lua push skill

# Update production persona if needed
lua persona production # Or: lua push persona

# Deploy to production
lua deploy

Quick Fix Workflow

# 1. Edit file
vim src/tools/MyTool.ts

# 2. Test
lua test

# 3. Push and deploy (direct mode)
lua push skill
lua deploy

Troubleshooting

Error: ❌ No lua.skill.yaml foundSolution: Run command from skill directory or run lua init first
Error: ❌ Version 1.0.0 already exists on the serverSolution: Increment version in lua.skill.yaml:
skills:
  - version: 1.0.1  # Increment this
Error: ❌ No index.ts foundSolution: Create src/index.ts with skill definition:
import { LuaSkill } from "lua-cli";
const skill = new LuaSkill({...});
Error: ❌ Tool name invalidSolution: Tool names can only contain: a-z, A-Z, 0-9, -, _
// ✅ Good
name = "get_weather"

// ❌ Bad
name = "get weather"  // No spaces
Error: ❌ Cannot find module 'lua-cli'Solution: Install dependencies:
npm install

Best Practices

Always test locally first:
lua test     # Test individual tools
lua chat     # Test conversationally
lua push     # Then push
  • PATCH (1.0.1): Bug fixes
  • MINOR (1.1.0): New features
  • MAJOR (2.0.0): Breaking changes
lua push     # Upload version
lua chat     # Test in sandbox
# If good, then:
lua deploy   # Deploy to production
Don’t delete old versions - they serve as rollback points

Next Steps

Development Mode

Learn about live development with auto-reload

Build Your First Skill

Follow a complete tutorial