> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heylua.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Lua - Build AI Agents That Do Anything

> Create AI agents with custom capabilities by connecting to any API using TypeScript

## Get started in 5 minutes

**Lua is the Agent OS that abstracts the technical complexities and helps engineers focus on business logic.** Ship your first agent without touching infra—just write TypeScript tools and go live.

***

### 1. Install the CLI

<CodeGroup>
  ```bash npm theme={null}
  npm install -g lua-cli
  ```

  ```bash yarn theme={null}
  yarn global add lua-cli
  ```

  ```bash pnpm theme={null}
  pnpm add -g lua-cli
  ```
</CodeGroup>

*Node 16+ recommended.* [Installation Guide →](/getting-started/installation)

***

### 2. Authenticate (one-time)

```bash theme={null}
lua auth configure
```

Enter your email, confirm the 6-digit code, and we'll securely store your API key for you. [Auth Guide →](/cli/authentication)

***

### 3. Create your project

```bash theme={null}
mkdir my-agent && cd my-agent
lua init
```

Pick **Create new agent** and follow the prompts. The template includes ready-to-run examples. [Quick Start Guide →](/getting-started/quick-start)

***

### 4. Run it locally

```bash theme={null}
lua test
```

Select a tool and try different inputs. The starter includes **30+ working tools** (e.g., a no-API-key weather tool) so you can see the pattern right away. [Template Overview →](/template/overview)

***

### 5. Deploy & chat

```bash theme={null}
lua push && lua deploy   # ship to production
lua chat                 # chat in sandbox or production
```

Use `lua chat` for an interactive CLI session; sandbox chat auto-bundles your local skills after a quick push. [Chat Command →](/cli/chat-command)

<Card title="✨ Test on Real Channels Instantly" icon="mobile" href="/channels/quick-testing" horizontal>
  Test your agent on WhatsApp, Facebook, Instagram, Email, or Slack without setting up channels
</Card>

***

## Add your first business-logic tool

Here's all the code you need to add a custom capability:

<CodeGroup>
  ```typescript src/tools/SayHello.ts theme={null}
  import { LuaTool } from 'lua-cli';
  import { z } from 'zod';

  export class SayHello implements LuaTool {
    name = 'say_hello';
    description = 'Greets a user by name';
    inputSchema = z.object({ name: z.string() });
    
    async execute(input: { name: string }) {
      return { message: `Hello, ${input.name}!` };
    }
  }
  ```

  ```typescript src/index.ts theme={null}
  import { LuaAgent, LuaSkill } from 'lua-cli';
  import { SayHello } from './tools/SayHello';

  const helloSkill = new LuaSkill({
    name: 'hello-skill',
    description: 'Greeting capabilities',
    context: 'Use say_hello to greet users by name',
    tools: [new SayHello()]
  });

  export const agent = new LuaAgent({
    name: 'hello-agent',
    persona: 'You are a friendly assistant. Be warm and concise.',
    skills: [helloSkill]
  });
  ```
</CodeGroup>

**That's it.** This mirrors the agent/skill/tool pattern—focus purely on your domain logic. [Build Your First Skill →](/getting-started/first-skill)

***

## Add chat to your website (1 line)

```html theme={null}
<script src="https://lua-ai-global.github.io/lua-pop/lua-pop.umd.js"></script>
<script>
  window.LuaPop.init({ 
    agentId: "your-agent-id", 
    position: "bottom-right"
  });
</script>
```

Drop this on any page to embed AI chat instantly. [LuaPop Widget Guide →](/chat-widget/quick-start)

***

## Focus on Business Logic, Not Infrastructure

Lua abstracts away all the complexity so you can ship faster:

<CardGroup cols={2}>
  <Card title="Infrastructure" icon="server">
    **We handle:** Hosting, auto-scaling, load balancing, CDN delivery, uptime monitoring

    **You focus on:** Writing functions that solve business problems
  </Card>

  <Card title="LLM Complexity & Cost" icon="brain">
    **We handle:** Model selection, prompt engineering, token optimization, API rate limits, cost management

    **You focus on:** What your agent should do, not how AI models work
  </Card>

  <Card title="Multi-Channel Orchestration" icon="layer-group">
    **We handle:** Web, mobile, WhatsApp, Slack, Instagram, Facebook Messenger—all channels managed

    **You focus on:** Building capabilities once, deploy everywhere instantly
  </Card>

  <Card title="Agent Orchestration" icon="gears">
    **We handle:** Tool calling logic, context management, conversation flow, error recovery, retries

    **You focus on:** Simple functions that fetch and return data
  </Card>
</CardGroup>

<Note>
  **Build in hours, not months.** Skip the months of infrastructure work, LLM integration complexity, and channel management. Just write TypeScript functions that connect to your APIs, and we handle everything else.
</Note>

***

## Integrate With ANY API

Connect to your existing systems or any third-party service:

<Tabs>
  <Tab title="Your APIs">
    **100% Custom Integration**

    ```typescript theme={null}
    class YourCustomTool implements LuaTool {
      async execute(input) {
        const response = await fetch('https://your-backend.com/api/endpoint', {
          headers: { 'X-API-Key': env('YOUR_API_KEY') }
        });
        return processYourData(await response.json());
      }
    }
    ```

    Perfect for existing infrastructure, custom business requirements, or any industry
  </Tab>

  <Tab title="Platform APIs">
    **Optional Built-In Helpers**

    ```typescript theme={null}
    import { Products, Baskets, Data } from 'lua-cli';

    const products = await Products.search('laptop');
    const basket = await Baskets.create({ currency: 'USD' });
    const results = await Data.search('docs', 'query');
    ```

    Great for rapid prototyping, e-commerce MVPs, or when you don't have a backend yet
  </Tab>

  <Tab title="External Services">
    **Third-Party Integrations**

    ```typescript theme={null}
    // Stripe, SendGrid, Shopify, Zendesk, etc.
    const stripe = await fetch('https://api.stripe.com/v1/charges', {
      headers: { 'Authorization': `Bearer ${env('STRIPE_KEY')}` }
    });
    ```

    Connect to any REST/GraphQL API—Stripe, SendGrid, weather, maps, anything
  </Tab>
</Tabs>

<Note>
  **Platform APIs are completely optional!** They're convenience helpers for common e-commerce and data tasks. You can build agents that integrate with ANY system using standard HTTP/REST/GraphQL calls.
</Note>

***

## What You Can Build

<CardGroup cols={2}>
  <Card title="E-commerce" icon="cart-shopping">
    Shopping assistants that integrate with Shopify, WooCommerce, or your custom store
  </Card>

  <Card title="Customer Support" icon="headset">
    24/7 AI support agents connected to your ticketing system and knowledge base
  </Card>

  <Card title="SaaS Products" icon="window-maximize">
    In-app assistants that access your product APIs and user management
  </Card>

  <Card title="Internal Tools" icon="building">
    AI-powered operations connecting to your ERP, CRM, and databases
  </Card>

  <Card title="Finance & Banking" icon="building-columns">
    Account management, transactions, and reporting with your banking systems
  </Card>

  <Card title="Healthcare" icon="heart-pulse">
    Patient portals integrated with your EMR and appointment systems
  </Card>
</CardGroup>

***

## Advanced Features

Beyond basic tools and skills, Lua provides enterprise-grade automation:

<CardGroup cols={2}>
  <Card title="Webhooks" icon="webhook">
    **HTTP endpoints** for external events

    Stripe payments, Shopify orders, GitHub deployments—react to events in real-time

    [Learn More →](/overview/webhooks)
  </Card>

  <Card title="Scheduled Jobs" icon="clock">
    **Automated tasks** with cron patterns

    Daily reports, cleanup tasks, monitoring—automate recurring operations

    [Learn More →](/overview/jobs)
  </Card>

  <Card title="PreProcessors" icon="filter">
    **Message filtering** before your agent

    Spam detection, profanity filters, routing, validation—control what reaches your agent

    [Learn More →](/overview/preprocessors)
  </Card>

  <Card title="PostProcessors" icon="paper-plane">
    **Response formatting** after generation

    Disclaimers, branding, translation—enhance every response automatically

    [Learn More →](/overview/postprocessors)
  </Card>
</CardGroup>

***

## Production-Ready Examples

See complete implementations across business, healthcare, and **IoT/edge computing**:

<CardGroup cols={3}>
  <Card title="E-commerce Assistant" icon="cart-shopping" href="/demos/ecommerce-assistant">
    Shopping experience with cart and checkout using Platform APIs
  </Card>

  <Card title="Customer Support" icon="headset" href="/demos/customer-support">
    Zendesk integration with AI knowledge base + webhooks + jobs
  </Card>

  <Card title="Financial Onboarding" icon="building-columns" href="/demos/financial-onboarding">
    KYC verification with Stripe Identity + webhooks + processors
  </Card>

  <Card title="HR Assistant" icon="user-tie" href="/demos/hr-assistant">
    Employee management with BambooHR + scheduled reports
  </Card>

  <Card title="IoT Smart Light" icon="lightbulb" href="/demos/iot-smart-light">
    Control GPIO relays on Raspberry Pi via chat + automation
  </Card>

  <Card title="View All 15 Demos" icon="layer-group" href="/demos/overview">
    Business, healthcare, logistics, and IoT/edge computing
  </Card>
</CardGroup>

***

## Why Developers Choose Lua

<AccordionGroup>
  <Accordion title="🔓 No Vendor Lock-In">
    Integrate with any API you choose. Your infrastructure, your choice. Not tied to our Platform APIs—they're completely optional. Your data stays with your systems.
  </Accordion>

  <Accordion title="⚡ Ship in Hours, Not Months">
    Live reload during development means instant feedback. TypeScript autocomplete guides you. Test with `lua chat` immediately. Deploy with one command. Skip months of infrastructure work.
  </Accordion>

  <Accordion title="🎯 Full Control">
    Your code, your logic, your data. Complete control over authentication, business rules, error handling, and integrations. Not limited by platform constraints.
  </Accordion>

  <Accordion title="🚀 Production Ready from Day One">
    Version management built-in. Sandbox for testing. Environment variables for secrets. One-command deployment. Monitoring and logs. Everything you need for enterprise production use.
  </Accordion>
</AccordionGroup>

***

## Helpful Resources

<CardGroup cols={2}>
  <Card title="Quick Start Guide" icon="rocket" href="/getting-started/quick-start">
    Complete tutorial—install to deploy in 5 minutes
  </Card>

  <Card title="Key Concepts" icon="book" href="/overview/agent">
    Understand agents, skills, tools, webhooks, and jobs
  </Card>

  <Card title="API Reference" icon="code" href="/api/overview">
    Complete API documentation with examples
  </Card>

  <Card title="30+ Examples" icon="layer-group" href="/examples/overview">
    Working code for external APIs, Platform APIs, and hybrid
  </Card>

  <Card title="CLI Commands" icon="terminal" href="/cli/overview">
    Complete command reference
  </Card>

  <Card title="Chat Widget" icon="comments" href="/chat-widget/quick-start">
    Add AI chat to your website
  </Card>
</CardGroup>

## Join the Community

<Card title="Discord Community" icon="discord" href="https://discord.gg/SRPEuwCzaD" horizontal>
  Connect with other Lua builders! Get help, share your projects, report bugs, and stay up to date with announcements.
</Card>

***

<Card title="Ready to Build Your First Agent?" icon="rocket" href="/getting-started/quick-start" horizontal>
  Complete tutorial with step-by-step instructions →
</Card>
