Get up and running in 5 minutes!
# 1. Test the examples
lua test
# 2. Start dev mode
lua dev
# 3. Chat at http://localhost:3000
# Try: "What's the weather in London?"
# 4. Customize src/index.ts
# 5. Deploy
lua push
lua deployDone! 🎉
lua testTry these:
-
Select:
get_weather- Input: city:
London - Output: Temperature, wind speed, conditions
- Input: city:
-
Select:
search_products- Input: query:
laptop - Output: Product list
- Input: query:
-
Select:
search_movies- Input: query:
thriller - Output: Movies with similarity scores
- Input: query:
What you learned: How tools work!
lua devBrowser opens at http://localhost:3000
Try chatting:
- "What's the weather in Tokyo?"
- "Show me your products"
- "Create a movie called Inception directed by Christopher Nolan in 2010"
- "Search for movies about dreams"
- "Create a shopping basket and add a laptop"
What you learned: How AI uses your tools!
Open src/index.ts and simplify:
import { LuaSkill } from "lua-cli";
import GetWeatherTool from "./tools/GetWeatherTool";
// Keep only what you need
const mySkill = new LuaSkill({
name: "my-skill",
description: "My custom AI assistant",
context: "Use get_weather when users ask about weather.",
tools: [
new GetWeatherTool()
]
});Save the file - dev mode auto-reloads!
Chat again: "What's the weather in Paris?"
What you learned: How to customize!
- Read each tool in
src/tools/ - Try modifying them
- Test your changes
- Build confidence
Time: A few hours
Best for: Visual learners
Pick a use case:
- Knowledge Base → Use CustomDataTool.ts as template
- E-commerce → Use ProductsTool.ts + BasketTool.ts
- Booking System → Modify CustomDataTool.ts
- CRM → Create customer management tools
Time: 1-2 hours
Best for: Goal-oriented builders
Read README.md in this directory for:
- Detailed tool explanations
- Customization recipes
- Multi-skill projects
- Best practices
Time: 30 minutes reading, 1 hour building
Best for: Thorough learners
# Delete what you don't need
rm src/tools/BasketTool.ts
rm src/tools/OrderTool.ts
# Update src/index.ts to remove imports- Create
src/tools/MyTool.ts:
import { LuaTool } from "lua-cli";
import { z } from "zod";
export default class MyTool implements LuaTool {
name = "my_tool";
description = "What it does";
inputSchema = z.object({ param: z.string() });
async execute(input: any) {
return { result: "Hello " + input.param };
}
}- Add to
src/index.ts:
import MyTool from "./tools/MyTool";
const skill = new LuaSkill({
tools: [new MyTool()]
});- Test:
lua test
# Select "my_tool" → Enter param → See resultExample: Call a REST API
async execute(input: any) {
const response = await fetch('https://api.example.com/data', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(input)
});
const data = await response.json();
return data;
}Example: Save user preferences
import { Data } from "lua-cli";
async execute(input: any) {
// Create
await Data.create('preferences', {
theme: input.theme,
language: input.language
});
// Later: Get
const prefs = await Data.get('preferences');
return prefs;
}Every common pattern is demonstrated:
- ✅ External API calls
- ✅ Platform API usage
- ✅ Vector search
- ✅ CRUD operations
- ✅ Multi-step workflows
- ✅ Error handling
- ✅ Input validation
- ✅ User - User data management
- ✅ Data - Custom data with search
- ✅ Products - Product catalog
- ✅ Baskets - Shopping carts
- ✅ Orders - Order processing
- ✅ TypeScript configured
- ✅ Type-safe
- ✅ Error handling
- ✅ Validation
- ✅ Ready to deploy
"How do I test?"
lua test # Interactive testing"How do I see it work?"
lua dev # Chat interface at http://localhost:3000"How do I deploy?"
lua push # Upload
lua deploy # Go live"Which tool should I start with?"
- Simple:
CreatePostTool.ts - External API:
GetWeatherTool.ts - Platform API:
UserDataTool.ts - Complex:
BasketTool.ts
- README.md (this directory) - Complete project guide
- TOOL_EXAMPLES.md - Detailed tool explanations
- ../API_REFERENCE.md - Full API docs
- ../CLI_REFERENCE.md - All commands
- ../GETTING_STARTED.md - Complete tutorial
- Start with
lua dev- See everything in action - Copy, don't write from scratch - Modify examples
- Test often -
lua testafter every change - Read the code - Examples are well-commented
- Ask the AI - Use dev mode to test edge cases
Can you:
- Run
lua dev - Chat: "What's the weather in your city?"
- Edit
GetWeatherTool.tsto add a fun fact about the city - Save and see it auto-reload
- Chat again and see your change
If yes, you're ready to build! 🚀
For more details, see README.md in this directory