Overview
The Lua CLI creates a clean, minimal project structure by default. You can optionally include examples with --with-examples.
Minimal (Default)
With Examples
After You Build
your-project/
βββ src/
β βββ index.ts # Agent configuration (LuaAgent)
βββ lua.skill.yaml # Configuration (auto-managed)
βββ package.json # Dependencies
βββ tsconfig.json # TypeScript config
βββ .env.example # Environment template
βββ README.md # Quick start guide
your-project/
βββ src/
β βββ index.ts # Agent configuration
βββ examples/ # Example code (reference only)
β βββ skills/ # Example skills & tools
β β βββ tools/ # Tool implementations
β β βββ *.skill.ts # Skill definitions
β βββ webhooks/ # HTTP endpoint examples
β βββ jobs/ # Scheduled task examples
β βββ preprocessors/ # Message filter examples
β βββ postprocessors/ # Response formatter examples
β βββ services/ # Helper utilities
βββ lua.skill.yaml
βββ package.json
βββ tsconfig.json
βββ README.md
your-project/
βββ src/
β βββ index.ts # Agent configuration
β βββ skills/ # Your skills
β β βββ tools/ # Your tools
β β βββ my.skill.ts
β βββ webhooks/ # Your webhooks (optional)
β βββ jobs/ # Your jobs (optional)
β βββ services/ # Your utilities (optional)
βββ dist/ # Compiled output (auto-generated)
βββ .lua/ # CLI cache (auto-generated)
βββ node_modules/ # Dependencies
βββ lua.skill.yaml
βββ package.json
βββ tsconfig.json
βββ .env # Your environment variables
Core Files
src/index.ts
Your agentβs main configuration file.
import { LuaAgent } from "lua-cli" ;
const agent = new LuaAgent ({
name: `my-agent` ,
persona: `You are a helpful assistant...` ,
skills: [], // Add your skills here
// Optional components:
// webhooks: [],
// jobs: [],
// preProcessors: [],
// postProcessors: [],
});
lua.skill.yaml
Auto-managed configuration file. Created during lua init, updated automatically by CLI commands.
agent :
agentId : agent_abc123
orgId : org_xyz789
skills :
- name : my-skill
version : 1.0.0
skillId : skill_xyz # Auto-created during compile
Do not manually edit this file! The lua.skill.yaml is managed by the CLI and stores state only (IDs and versions). All configuration belongs in your code:
Persona β LuaAgent in src/index.ts
Tool definitions β Your tool files
Skill configuration β LuaSkill in code
Environment variables β .env file or lua env command
The only exception: you may manually increment the version number before pushing a new release.
IDs like skillId, webhookId, and jobId are auto-generated during compilation. Never edit these manually.
package.json
Standard Node.js package configuration:
{
"name" : "lua-skill" ,
"type" : "module" ,
"dependencies" : {
"lua-cli" : "^3.1.0" ,
"zod" : "^3.24.1"
}
}
Building Your Project
Recommended Structure
As your project grows, organize it like this:
src/
βββ index.ts # Agent configuration
βββ skills/
β βββ tools/ # Tool implementations
β β βββ WeatherTool.ts
β β βββ ProductTools.ts # Multiple related tools
β β βββ OrderTool.ts
β βββ weather.skill.ts # Weather skill
β βββ ecommerce.skill.ts # E-commerce skill
βββ webhooks/ # (Optional) HTTP endpoints
β βββ PaymentWebhook.ts
βββ jobs/ # (Optional) Scheduled tasks
β βββ DailyReportJob.ts
βββ services/ # (Optional) Shared utilities
βββ ApiClient.ts
File Naming Conventions
Type Pattern Example Tools *Tool.ts or *Tools.tsWeatherTool.ts, ProductTools.tsSkills *.skill.tsweather.skill.tsWebhooks *Webhook.tsPaymentWebhook.tsJobs *Job.tsDailyReportJob.tsPreprocessors *.preprocessor.tsfilter.preprocessor.tsPostprocessors *.postprocessor.tsformat.postprocessor.ts
Auto-Generated Directories
Compiled JavaScript output. Created by lua compile.
dist/
βββ deployment.json # Deployment metadata
βββ index.js # Compiled main file
βββ tools/ # Compiled tool bundles
CLI cache directory. Safe to delete - will be regenerated.
Environment Files
Your local environment variables (create this file):
# External API Keys
STRIPE_API_KEY = sk_test_abc123
OPENAI_API_KEY = sk-...
# Configuration
API_BASE_URL = https://api.example.com
Add .env to .gitignore - never commit secrets!
.env.example
Template for environment variables (commit this):
STRIPE_API_KEY = your_stripe_key_here
OPENAI_API_KEY = your_openai_key_here
Git Configuration
β
Commit These
.gitignore
.env.example
lua.skill.yaml
package.json
tsconfig.json
README.md
src/
β Donβt Commit These
.env
node_modules/
dist/
.lua/
Sample .gitignore
# Dependencies
node_modules/
# Build output
dist/
.lua/
# Environment
.env
.env.local
.env.*.local
# OS
.DS_Store
# IDE
.vscode/
.idea/
Project Size Patterns
Next Steps
Building Skills Learn how to build custom skills
Best Practices Follow recommended patterns
API Reference Available platform APIs
Examples See working code examples