Skip to main content

Overview

The lua chat command provides an interactive command-line interface for conversing with your Lua AI agent in both sandbox and production environments.
lua chat
Want to test on real channels? You can also test your agent on WhatsApp, Facebook, Instagram, Email, and Slack without setting up your own channels. See Quick Testing Channels for instant testing on any platform.

Features

Sandbox Mode

Test with local skill overrides and persona customizations

Production Mode

Chat with your live production agent

Interactive Loop

Continuous conversation until exit

Multi-Skill Support

All skills automatically included in sandbox

Prerequisites

1

Configure API Key

lua auth configure
2

Initialize Project

lua init
Ensures lua.skill.yaml exists
3

Deploy Skills

lua push
Required for sandbox testing

How It Works

1

Authentication

✅ Authenticated
Validates your API key and retrieves user data
2

Environment Selection

? Select environment: 
  🔧 Sandbox (with skill overrides)
  🚀 Production
Choose between sandbox (testing) or production (live)
3

Sandbox Setup (if Sandbox)

🔄 Compiling skill...
🔄 Pushing skills to sandbox...
✅ Pushed 2 skills to sandbox
Compiles and deploys your local skills to sandbox
4

Chat Interface

============================================================
💬 Lua Chat Interface
Environment: 🔧 Sandbox
Press Ctrl+C to exit
============================================================

🤖 Assistant: Hi there! How can I help you today?

👤 You: 
Interactive conversation begins

Sandbox vs Production

For Development & Testing
$ lua chat
? Select environment: 🔧 Sandbox
Features:
  • ✅ Local skill overrides
  • ✅ Persona customization
  • ✅ Environment variables from .env
  • ✅ Test before deploying
Setup time: ~10-30 seconds (includes compilation)Use when:
  • Developing new features
  • Testing skill changes
  • Iterating on persona
  • Before pushing to production

Example Session

Sandbox Mode

$ lua chat
 Authenticated
? Select environment: 🔧 Sandbox (with skill overrides)
🔄 Setting up sandbox environment...
🔄 Compiling skill...
 Skill compiled successfully - 3 tools bundled
🔄 Pushing skills to sandbox...
 Pushed 2 skills to sandbox

============================================================
💬 Lua Chat Interface
Environment: 🔧 Sandbox
Press Ctrl+C to exit
============================================================

🤖 Assistant: Hi there! How can I help you today?

👤 You: What's the weather in London?
🤖 Assistant: ...
🤖 Assistant: The current weather in London is 15°C and cloudy with light wind.

👤 You: Search for laptops
🤖 Assistant: ...
🤖 Assistant: I found 5 laptops in our catalog:
1. MacBook Pro - $1999
2. Dell XPS 13 - $1299
3. ThinkPad X1 - $1499
...

👤 You: ^C

👋 Goodbye!

Persona Override

Configuration

In lua.skill.yaml:
agent:
  agentId: "agent_abc123"
  organizationId: "org_xyz789"
  persona: |
    You are a helpful customer service assistant.
    You help users with product inquiries and order management.
    Be friendly, professional, and concise.
In Sandbox Mode:
  • Persona is automatically loaded and sent with each request
  • Test different persona variations
  • Iterate quickly
In Production Mode:
  • Uses production persona (from server)
  • No local override

Skill Override

How It Works

Sandbox mode automatically:
  1. Compiles all skills in your project
  2. Pushes to sandbox environment
  3. Gets sandbox IDs for each skill
  4. Includes all sandbox IDs in chat requests
Example override:
{
  "skillOverride": [
    {
      "skillId": "skill_abc123",
      "sandboxId": "sandbox_def456"
    }
  ]
}
The AI uses your local sandbox versions instead of production versions.

Keyboard Shortcuts

ShortcutAction
EnterSend message
Ctrl+CExit chat
Ctrl+DExit chat (alternative)

Best Practices

  1. Make changes to your skills
  2. Run lua chat in sandbox mode
  3. Test changes interactively
  4. Iterate until satisfied
  5. Run lua push to deploy
  6. Test again in production mode
  7. Deploy with lua deploy
Start with sandbox:
  • Test happy paths
  • Test error cases
  • Test edge cases
  • Test multi-step flows
Validate with production:
  • Verify deployed changes work
  • Test with production data
  • Confirm no regressions
  1. Update persona in your LuaAgent code (src/index.ts)
  2. Run lua chat in sandbox
  3. Test conversation style
  4. Refine persona
  5. Repeat until satisfied
  6. Deploy to production with lua push persona

Troubleshooting

Error:
❌ No API key found
Solution:
lua auth configure
Error:
❌ No agent ID found in lua.skill.yaml
Solution:
lua init
Error:
❌ Compilation failed
Solution:
  • Fix TypeScript errors in your code
  • Check src/index.ts for syntax errors
  • Verify all imports are correct
Error:
❌ Failed to push skills to sandbox
Solution:
lua push  # Deploy skills first
lua chat  # Then try again
Issue: Long wait times in sandboxCauses:
  • First request after compilation
  • Large skill bundles
  • Network latency
Solution: Subsequent messages will be faster
Issue: Persona override not being appliedCheck:
  • Using sandbox mode (not production)
  • agent.persona exists in lua.skill.yaml
  • Persona is properly formatted YAML

lua test

Test individual tools with specific inputs

lua push

Deploy skills to server

lua deploy

Publish version to production

lua compile

Compile TypeScript code

Next Steps