lua-cli 2.2.8-alpha.1 → 2.3.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/API_REFERENCE.md +1408 -0
  2. package/CLI_REFERENCE.md +818 -0
  3. package/GETTING_STARTED.md +1040 -0
  4. package/README.md +738 -424
  5. package/TEMPLATE_GUIDE.md +1398 -0
  6. package/dist/api/agent.api.service.d.ts +45 -0
  7. package/dist/api/agent.api.service.js +57 -0
  8. package/dist/api/auth.api.service.d.ts +48 -0
  9. package/dist/api/auth.api.service.js +54 -0
  10. package/dist/api/basket.api.service.d.ts +85 -0
  11. package/dist/api/basket.api.service.js +164 -0
  12. package/dist/api/chat.api.service.d.ts +21 -0
  13. package/dist/api/chat.api.service.js +24 -0
  14. package/dist/api/credentials.d.ts +24 -0
  15. package/dist/api/credentials.js +46 -0
  16. package/dist/api/custom.data.api.service.d.ts +69 -0
  17. package/dist/api/custom.data.api.service.js +125 -0
  18. package/dist/api/lazy-instances.d.ts +49 -0
  19. package/dist/api/lazy-instances.js +95 -0
  20. package/dist/api/order.api.service.d.ts +53 -0
  21. package/dist/api/order.api.service.js +95 -0
  22. package/dist/api/products.api.service.d.ts +66 -0
  23. package/dist/api/products.api.service.js +112 -0
  24. package/dist/api/skills.api.service.d.ts +77 -0
  25. package/dist/api/skills.api.service.js +88 -0
  26. package/dist/api/tool.api.service.d.ts +52 -0
  27. package/dist/api/tool.api.service.js +73 -0
  28. package/dist/api/user.data.api.service.d.ts +33 -0
  29. package/dist/api/user.data.api.service.js +59 -0
  30. package/dist/api-exports.d.ts +271 -0
  31. package/dist/api-exports.js +372 -0
  32. package/dist/cli/command-definitions.d.ts +30 -0
  33. package/dist/cli/command-definitions.js +71 -0
  34. package/dist/commands/agents.d.ts +20 -0
  35. package/dist/commands/agents.js +24 -2
  36. package/dist/commands/apiKey.d.ts +23 -0
  37. package/dist/commands/apiKey.js +23 -0
  38. package/dist/commands/compile.d.ts +24 -0
  39. package/dist/commands/compile.js +67 -759
  40. package/dist/commands/configure.d.ts +24 -0
  41. package/dist/commands/configure.js +31 -96
  42. package/dist/commands/deploy.d.ts +31 -19
  43. package/dist/commands/deploy.js +45 -74
  44. package/dist/commands/destroy.d.ts +27 -0
  45. package/dist/commands/destroy.js +27 -1
  46. package/dist/commands/dev.d.ts +25 -62
  47. package/dist/commands/dev.js +58 -873
  48. package/dist/commands/init.d.ts +27 -0
  49. package/dist/commands/init.js +98 -260
  50. package/dist/commands/push.d.ts +24 -21
  51. package/dist/commands/push.js +39 -92
  52. package/dist/commands/test.d.ts +26 -0
  53. package/dist/commands/test.js +41 -188
  54. package/dist/common/basket.instance.d.ts +78 -0
  55. package/dist/common/basket.instance.js +132 -0
  56. package/dist/common/data.entry.instance.d.ts +39 -0
  57. package/dist/common/data.entry.instance.js +76 -0
  58. package/dist/common/http.client.d.ts +64 -0
  59. package/dist/common/http.client.js +133 -0
  60. package/dist/common/order.instance.d.ts +40 -0
  61. package/dist/common/order.instance.js +79 -0
  62. package/dist/common/product.instance.d.ts +33 -0
  63. package/dist/common/product.instance.js +63 -0
  64. package/dist/common/product.pagination.instance.d.ts +43 -0
  65. package/dist/common/product.pagination.instance.js +74 -0
  66. package/dist/common/product.search.instance.d.ts +22 -0
  67. package/dist/common/product.search.instance.js +40 -0
  68. package/dist/common/user.instance.d.ts +41 -0
  69. package/dist/common/user.instance.js +84 -0
  70. package/dist/config/auth.constants.d.ts +11 -0
  71. package/dist/config/auth.constants.js +11 -0
  72. package/dist/config/compile.constants.d.ts +67 -0
  73. package/dist/config/compile.constants.js +99 -0
  74. package/dist/config/constants.d.ts +5 -0
  75. package/dist/config/constants.js +5 -0
  76. package/dist/config/dev.constants.d.ts +65 -0
  77. package/dist/config/dev.constants.js +79 -0
  78. package/dist/config/init.constants.d.ts +23 -0
  79. package/dist/config/init.constants.js +41 -0
  80. package/dist/index.d.ts +19 -3
  81. package/dist/index.js +28 -44
  82. package/dist/interfaces/admin.d.ts +101 -0
  83. package/dist/interfaces/admin.js +5 -0
  84. package/dist/interfaces/agent.d.ts +107 -0
  85. package/dist/interfaces/agent.js +5 -0
  86. package/dist/interfaces/baskets.d.ts +135 -0
  87. package/dist/interfaces/baskets.js +19 -0
  88. package/dist/interfaces/chat.d.ts +61 -0
  89. package/dist/interfaces/chat.js +5 -0
  90. package/dist/interfaces/common.d.ts +62 -0
  91. package/dist/interfaces/common.js +8 -0
  92. package/dist/interfaces/compile.d.ts +11 -0
  93. package/dist/interfaces/compile.js +4 -0
  94. package/dist/interfaces/custom.data.d.ts +82 -0
  95. package/dist/interfaces/custom.data.js +5 -0
  96. package/dist/interfaces/deploy.d.ts +29 -0
  97. package/dist/interfaces/deploy.js +4 -0
  98. package/dist/interfaces/dev.d.ts +53 -0
  99. package/dist/interfaces/dev.js +5 -0
  100. package/dist/interfaces/init.d.ts +60 -0
  101. package/dist/interfaces/init.js +4 -0
  102. package/dist/interfaces/orders.d.ts +91 -0
  103. package/dist/interfaces/orders.js +19 -0
  104. package/dist/interfaces/product.d.ts +65 -0
  105. package/dist/interfaces/product.js +5 -0
  106. package/dist/interfaces/push.d.ts +26 -0
  107. package/dist/interfaces/push.js +4 -0
  108. package/dist/interfaces/test.d.ts +36 -0
  109. package/dist/interfaces/test.js +4 -0
  110. package/dist/services/auth.d.ts +54 -99
  111. package/dist/services/auth.js +76 -12
  112. package/dist/types/api-contracts.d.ts +211 -0
  113. package/dist/types/api-contracts.js +8 -0
  114. package/dist/types/compile.types.d.ts +76 -0
  115. package/dist/types/compile.types.js +4 -0
  116. package/dist/types/index.d.ts +23 -85
  117. package/dist/types/index.js +25 -14
  118. package/dist/types/skill.d.ts +142 -0
  119. package/dist/{skill.js → types/skill.js} +66 -19
  120. package/dist/types/tool-validation.d.ts +34 -0
  121. package/dist/types/tool-validation.js +42 -0
  122. package/dist/utils/auth-flows.d.ts +26 -0
  123. package/dist/utils/auth-flows.js +141 -0
  124. package/dist/utils/bundling.d.ts +36 -0
  125. package/dist/utils/bundling.js +137 -0
  126. package/dist/utils/compile.d.ts +37 -0
  127. package/dist/utils/compile.js +242 -0
  128. package/dist/utils/deploy-api.d.ts +26 -0
  129. package/dist/utils/deploy-api.js +53 -0
  130. package/dist/utils/deploy-helpers.d.ts +46 -0
  131. package/dist/utils/deploy-helpers.js +86 -0
  132. package/dist/utils/deployment.d.ts +25 -0
  133. package/dist/utils/deployment.js +161 -0
  134. package/dist/utils/dev-api.d.ts +61 -0
  135. package/dist/utils/dev-api.js +262 -0
  136. package/dist/utils/dev-helpers.d.ts +46 -0
  137. package/dist/utils/dev-helpers.js +83 -0
  138. package/dist/utils/dev-server.d.ts +24 -0
  139. package/dist/utils/dev-server.js +555 -0
  140. package/dist/utils/dev-watcher.d.ts +31 -0
  141. package/dist/utils/dev-watcher.js +110 -0
  142. package/dist/utils/files.js +0 -5
  143. package/dist/utils/init-agent.d.ts +34 -0
  144. package/dist/utils/init-agent.js +129 -0
  145. package/dist/utils/init-helpers.d.ts +41 -0
  146. package/dist/utils/init-helpers.js +73 -0
  147. package/dist/utils/init-prompts.d.ts +47 -0
  148. package/dist/utils/init-prompts.js +168 -0
  149. package/dist/utils/push-api.d.ts +15 -0
  150. package/dist/utils/push-api.js +48 -0
  151. package/dist/utils/push-helpers.d.ts +38 -0
  152. package/dist/utils/push-helpers.js +84 -0
  153. package/dist/utils/sandbox-storage.d.ts +27 -0
  154. package/dist/utils/sandbox-storage.js +71 -0
  155. package/dist/utils/sandbox.js +78 -118
  156. package/dist/utils/skill-management.d.ts +14 -0
  157. package/dist/utils/skill-management.js +148 -0
  158. package/dist/utils/test-helpers.d.ts +40 -0
  159. package/dist/utils/test-helpers.js +92 -0
  160. package/dist/utils/test-prompts.d.ts +23 -0
  161. package/dist/utils/test-prompts.js +186 -0
  162. package/dist/utils/tool-detection.d.ts +18 -0
  163. package/dist/utils/tool-detection.js +110 -0
  164. package/dist/web/app.css +14 -9
  165. package/package.json +11 -12
  166. package/template/QUICKSTART.md +299 -144
  167. package/template/README.md +928 -349
  168. package/template/TOOL_EXAMPLES.md +655 -0
  169. package/template/package-lock.json +3781 -0
  170. package/template/package.json +1 -1
  171. package/template/src/index.ts +81 -40
  172. package/template/src/tools/BasketTool.ts +128 -0
  173. package/template/src/tools/CustomDataTool.ts +7 -13
  174. package/template/src/tools/OrderTool.ts +54 -0
  175. package/template/src/tools/PaymentTool.ts +1 -1
  176. package/template/src/tools/ProductsTool.ts +56 -118
  177. package/template/src/tools/UserDataTool.ts +4 -27
  178. package/dist/custom-data-api.d.ts +0 -72
  179. package/dist/custom-data-api.js +0 -174
  180. package/dist/product-api.d.ts +0 -197
  181. package/dist/product-api.js +0 -152
  182. package/dist/services/api.d.ts +0 -569
  183. package/dist/services/api.js +0 -625
  184. package/dist/skill.d.ts +0 -50
  185. package/dist/types.d.ts +0 -1
  186. package/dist/types.js +0 -2
  187. package/dist/user-data-api.d.ts +0 -39
  188. package/dist/user-data-api.js +0 -50
  189. package/template/API.md +0 -604
  190. package/template/DEVELOPER.md +0 -771
  191. package/template/lua.skill.yaml +0 -16
package/README.md CHANGED
@@ -1,545 +1,859 @@
1
1
  # Lua CLI
2
2
 
3
- A powerful command-line interface for the Lua AI platform that helps you develop, test, and deploy LuaSkills with custom tools.
3
+ Build AI agents with custom capabilities using TypeScript.
4
4
 
5
- ## Installation
5
+ [![npm version](https://img.shields.io/npm/v/lua-cli.svg)](https://www.npmjs.com/package/lua-cli)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ---
9
+
10
+ ## 🎯 What is Lua CLI?
11
+
12
+ Lua CLI is a powerful command-line tool for building, testing, and deploying AI skills. A **skill** is a collection of **tools** (functions) that your AI agent can use to accomplish tasks.
13
+
14
+ **Think of it like:**
15
+ - 🤖 **AI Agent** = Your assistant (like ChatGPT)
16
+ - 🎯 **Skills** = What it can do (your custom capabilities)
17
+ - 🛠️ **Tools** = Specific functions (e.g., "get weather", "create order")
18
+
19
+ ---
20
+
21
+ ## ⚡ Quick Start
6
22
 
7
23
  ```bash
24
+ # Install
8
25
  npm install -g lua-cli
26
+
27
+ # Authenticate
28
+ lua auth configure
29
+
30
+ # Create a project
31
+ mkdir my-skill && cd my-skill
32
+ lua init
33
+
34
+ # Test locally
35
+ lua test
36
+
37
+ # Start dev mode
38
+ lua dev
9
39
  ```
10
40
 
11
- ## Usage
41
+ **Done!** Your AI skill is running at http://localhost:3000 🎉
42
+
43
+ ---
44
+
45
+ ## 📦 Installation
46
+
47
+ ### Global Installation (Recommended)
12
48
 
13
- After installation, you can use the `lua` command:
49
+ ```bash
50
+ npm install -g lua-cli
51
+ ```
52
+
53
+ ### Using npx (No Installation)
14
54
 
15
55
  ```bash
16
- lua --help
56
+ npx lua-cli [command]
17
57
  ```
18
58
 
19
- ## Features
59
+ ### Requirements
20
60
 
21
- - 🔐 **Secure Authentication**: Support for both API key and email-based OTP authentication
22
- - 🏢 **Organization Management**: Select and manage multiple organizations
23
- - 🤖 **Agent Management**: Choose from available agents within your organizations
24
- - 🛠️ **Skill Development**: Initialize new Lua skills with proper configuration
25
- - 🔧 **Tool Development**: Create custom tools with TypeScript and Zod validation
26
- - 📦 **Dependency Bundling**: Automatic bundling of npm packages using esbuild
27
- - 🧪 **Interactive Testing**: Test your tools with real-time execution
28
- - 🚀 **Deployment**: Compile and deploy skills to the Lua platform
29
- - 🔑 **API Key Management**: Securely store, view, and manage your API keys
30
- - 💾 **User Data API**: Built-in API for persistent user data storage in your tools
31
- - 📚 **Comprehensive Documentation**: Complete guides and examples
61
+ - **Node.js** 16.0.0 or higher
62
+ - **npm** 7.0.0 or higher
63
+ - **TypeScript** knowledge (for development)
32
64
 
33
- ## Quick Start
65
+ ---
34
66
 
35
- 1. **Configure your authentication:**
36
- ```bash
37
- lua auth configure
38
- ```
39
- Choose between API key or email authentication methods.
67
+ ## 🚀 Features
40
68
 
41
- 2. **Initialize a new skill project:**
42
- ```bash
43
- lua skill init
44
- ```
45
- Choose between selecting an existing agent or creating a new one, then provide skill details.
69
+ ### For Developers
70
+ - 🔨 **TypeScript-first** - Full type safety and autocomplete
71
+ - 🎨 **Template System** - 30+ example tools to learn from
72
+ - 🧪 **Interactive Testing** - Test tools before deployment
73
+ - 🔄 **Live Reload** - Dev mode with automatic recompilation
74
+ - 📦 **Auto Bundling** - Dependencies bundled automatically with esbuild
75
+ - ✅ **Input Validation** - Zod schema validation built-in
46
76
 
47
- 3. **Develop your tools:**
48
- ```bash
49
- # Create tools in the tools/ directory
50
- # See template/README.md for examples
51
- ```
77
+ ### For Operations
78
+ - 🔐 **Secure Auth** - API key or email OTP authentication
79
+ - 🌐 **Multi-Skill** - Multiple skills in one project
80
+ - 📊 **Version Management** - Push, test, and deploy versions
81
+ - 🎯 **Sandbox Testing** - Test in isolation before production
82
+ - 📝 **Environment Variables** - Secure configuration management
52
83
 
53
- 4. **Compile your skill:**
54
- ```bash
55
- lua skill compile
56
- ```
57
- Bundles dependencies and creates deployable files.
84
+ ### For Users
85
+ - 💬 **Chat Interface** - Test your AI in real conversations
86
+ - 🔍 **Tool Explorer** - Browse and test individual tools
87
+ - 📊 **Real-time Logs** - WebSocket log streaming
88
+ - 🎨 **Beautiful UI** - Modern, intuitive interface
58
89
 
59
- 5. **Test your tools:**
60
- ```bash
61
- lua skill test
62
- ```
63
- Interactive testing interface for your tools.
90
+ ---
64
91
 
65
- 6. **Deploy your skill:**
66
- ```bash
67
- lua skill deploy
68
- ```
69
- Deploy to the Lua platform.
92
+ ## 📖 Documentation
70
93
 
71
- ## Commands
94
+ ### 📘 **For Beginners**
95
+ **[Getting Started Guide](GETTING_STARTED.md)** - Zero to deployed skill in one hour
96
+ - Installation and setup
97
+ - Your first skill
98
+ - Step-by-step tutorial
99
+ - Complete restaurant skill example
72
100
 
73
- ### Authentication Commands
101
+ ### 🔧 **For Developers**
102
+ **[API Reference](API_REFERENCE.md)** - Complete API documentation
103
+ - All exported APIs (User, Data, Products, Baskets, Orders)
104
+ - Type definitions
105
+ - Code examples
106
+ - Best practices
74
107
 
75
- #### `lua auth configure`
108
+ **[Template Guide](TEMPLATE_GUIDE.md)** - Understanding the example project
109
+ - Template structure explained
110
+ - 30+ tool examples
111
+ - Building your first skill
112
+ - Common patterns and recipes
76
113
 
77
- Set up your authentication credentials. You can choose between:
114
+ ### 💻 **For CLI Users**
115
+ **[CLI Reference](CLI_REFERENCE.md)** - All command documentation
116
+ - Complete command reference
117
+ - Flags and options
118
+ - Workflow examples
119
+ - Troubleshooting
78
120
 
79
- - **API Key**: Direct API key input
80
- - **Email**: Email-based OTP authentication
121
+ ### 🏗️ **For Contributors**
122
+ **[Developer Guide](DEVELOPER_GUIDE.md)** - Architecture and internals
123
+ - Codebase structure
124
+ - Module organization
125
+ - Contributing guidelines
81
126
 
82
- ```bash
83
- lua auth configure
84
- ```
127
+ ---
85
128
 
86
- #### `lua auth key`
129
+ ## 🎓 Core Concepts
87
130
 
88
- Display your stored API key (with confirmation prompt).
131
+ ### Skills
89
132
 
90
- ```bash
91
- lua auth key
133
+ A skill is a collection of related tools:
134
+
135
+ ```typescript
136
+ import { LuaSkill } from 'lua-cli';
137
+
138
+ const weatherSkill = new LuaSkill({
139
+ name: "weather-skill",
140
+ version: "1.0.0",
141
+ description: "Provides weather information",
142
+ context: "Use get_weather when users ask about weather...",
143
+ tools: [
144
+ new GetWeatherTool(),
145
+ new GetForecastTool()
146
+ ]
147
+ });
92
148
  ```
93
149
 
94
- #### `lua auth logout`
150
+ ### Tools
95
151
 
96
- Delete your stored API key and credentials.
152
+ A tool is a single function the AI can call:
97
153
 
98
- ```bash
99
- lua auth logout
154
+ ```typescript
155
+ import { LuaTool } from 'lua-cli';
156
+ import { z } from 'zod';
157
+
158
+ export default class GetWeatherTool implements LuaTool {
159
+ name = "get_weather";
160
+ description = "Get current weather for a city";
161
+
162
+ inputSchema = z.object({
163
+ city: z.string()
164
+ });
165
+
166
+ async execute(input: any) {
167
+ // Call weather API
168
+ return {
169
+ temperature: 72,
170
+ condition: "sunny",
171
+ city: input.city
172
+ };
173
+ }
174
+ }
100
175
  ```
101
176
 
102
- ### Skill Management Commands
177
+ ### Platform APIs
103
178
 
104
- #### `lua skill init`
179
+ Built-in APIs for common operations:
105
180
 
106
- Initialize a new Lua skill project in the current directory.
181
+ ```typescript
182
+ import { User, Data, Products, Baskets, Orders } from 'lua-cli';
107
183
 
108
- ```bash
109
- lua skill init
184
+ // User data
185
+ const user = await User.get();
186
+
187
+ // Custom data with vector search
188
+ await Data.create('movies', movieData, searchText);
189
+ const results = await Data.search('movies', 'sci-fi thriller');
190
+
191
+ // Products
192
+ const products = await Products.search('laptop');
193
+
194
+ // Shopping baskets
195
+ const basket = await Baskets.create({ currency: 'USD' });
196
+ await Baskets.addItem(basketId, { id, price, quantity });
197
+
198
+ // Orders
199
+ const order = await Baskets.placeOrder(orderData, basketId);
110
200
  ```
111
201
 
112
- This command will:
113
- - Fetch your organizations and agents from the API
114
- - Let you select an organization by name
115
- - **Choose between existing agents or creating a new one:**
116
- - **Existing Agent**: Select from your current agents
117
- - **New Agent**: Create a custom agent with:
118
- - Agent type selection (Base Agent, Shopify, WooCommerce, etc.)
119
- - Required metadata collection (API keys, IDs, etc.)
120
- - Feature configuration (RAG, tickets, web search, etc.)
121
- - Business information (name, type, personality, traits)
122
- - Automatic persona generation and welcome message
123
- - Prompt for skill name and description
124
- - Create a `lua.skill.yaml` configuration file with agent details
125
- - Copy template files to the current directory
202
+ ---
126
203
 
127
- #### `lua skill compile`
204
+ ## 💡 Examples
128
205
 
129
- Compile your LuaSkill and bundle all dependencies.
206
+ ### Example 1: Simple Weather Tool
130
207
 
131
- ```bash
132
- lua skill compile
208
+ ```typescript
209
+ import { LuaTool } from 'lua-cli';
210
+ import { z } from 'zod';
211
+
212
+ export default class WeatherTool implements LuaTool {
213
+ name = "get_weather";
214
+ description = "Get weather for any city";
215
+ inputSchema = z.object({ city: z.string() });
216
+
217
+ async execute(input: any) {
218
+ const response = await fetch(
219
+ `https://api.open-meteo.com/v1/forecast?city=${input.city}`
220
+ );
221
+ const data = await response.json();
222
+ return { temperature: data.temp, condition: data.condition };
223
+ }
224
+ }
133
225
  ```
134
226
 
135
- This command will:
136
- - Scan your tools for imports and dependencies
137
- - Bundle external packages using esbuild
138
- - Compress the generated code for efficient storage
139
- - Create `.lua/deploy.json` with compiled skill data
140
- - Generate individual tool files in `.lua/` directory
227
+ ### Example 2: E-commerce Tool
141
228
 
142
- **Options:**
143
- - `--watch` - Watch for changes and recompile automatically
144
- - `--minify` - Minify the bundled code
229
+ ```typescript
230
+ import { LuaTool, Products, Baskets } from 'lua-cli';
231
+ import { z } from 'zod';
145
232
 
146
- #### `lua skill test`
233
+ export default class AddToCartTool implements LuaTool {
234
+ name = "add_to_cart";
235
+ description = "Add product to shopping cart";
236
+
237
+ inputSchema = z.object({
238
+ productId: z.string(),
239
+ quantity: z.number().min(1)
240
+ });
241
+
242
+ async execute(input: any) {
243
+ const product = await Products.getById(input.productId);
244
+ const basket = await Baskets.create({ currency: 'USD' });
245
+
246
+ await Baskets.addItem(basket.id, {
247
+ id: input.productId,
248
+ price: product.price,
249
+ quantity: input.quantity
250
+ });
251
+
252
+ return {
253
+ basketId: basket.id,
254
+ message: `Added ${input.quantity}x ${product.name} to cart`
255
+ };
256
+ }
257
+ }
258
+ ```
147
259
 
148
- Interactive testing interface for your tools.
260
+ ### Example 3: Custom Data with Search
149
261
 
150
- ```bash
151
- lua skill test
262
+ ```typescript
263
+ import { LuaTool, Data } from 'lua-cli';
264
+ import { z } from 'zod';
265
+
266
+ export class CreateMovieTool implements LuaTool {
267
+ name = "create_movie";
268
+ description = "Add a movie to the database";
269
+
270
+ inputSchema = z.object({
271
+ title: z.string(),
272
+ director: z.string(),
273
+ year: z.number()
274
+ });
275
+
276
+ async execute(input: any) {
277
+ const searchText = `${input.title} ${input.director} ${input.year}`;
278
+ const movie = await Data.create('movies', input, searchText);
279
+ return { id: movie.id, message: 'Movie added' };
280
+ }
281
+ }
282
+
283
+ export class SearchMoviesTool implements LuaTool {
284
+ name = "search_movies";
285
+ description = "Search movies by title, director, or year";
286
+ inputSchema = z.object({ query: z.string() });
287
+
288
+ async execute(input: any) {
289
+ const results = await Data.search('movies', input.query, 10, 0.7);
290
+ return { movies: results.data, count: results.count };
291
+ }
292
+ }
152
293
  ```
153
294
 
154
- Features:
155
- - Tool selection menu
156
- - Input validation with Zod schemas
157
- - Real-time execution in isolated VM context
158
- - Error reporting and debugging
159
- - Mock data support
295
+ ---
160
296
 
161
- #### `lua skill push`
297
+ ## 🎯 Commands
162
298
 
163
- Push your compiled skill version to the server.
299
+ ### Authentication
300
+ ```bash
301
+ lua auth configure # Set up API key
302
+ lua auth key # Display API key
303
+ lua auth logout # Delete API key
304
+ ```
164
305
 
306
+ ### Skill Management
165
307
  ```bash
166
- lua skill push
308
+ lua init # Create new skill project
309
+ lua compile # Compile TypeScript to deployable format
310
+ lua test # Test tools interactively
311
+ lua push # Upload version to server
312
+ lua deploy # Deploy version to production
313
+ lua dev # Development mode with live reload
167
314
  ```
168
315
 
169
- This command will:
170
- - Compile your skill first
171
- - Confirm the version you want to push
172
- - Send the compiled skill data to the server
173
- - Store the skill ID in your YAML file
316
+ **See [CLI_REFERENCE.md](CLI_REFERENCE.md) for complete command documentation.**
317
+
318
+ ---
174
319
 
175
- #### `lua skill dev`
320
+ ## 🛠️ Development Workflow
176
321
 
177
- Push your compiled skill version to the sandbox for development and testing with automatic file watching and web chat interface.
322
+ ### Local Development
178
323
 
179
324
  ```bash
180
- lua skill dev
181
- ```
182
-
183
- This command will:
184
- - Compile your skill first
185
- - Confirm the version you want to push to sandbox
186
- - **Smart Sandbox Management**:
187
- - If you have a previous sandbox skill ID stored, it will try to update the existing sandbox
188
- - If the update fails or no sandbox exists, it will create a new one
189
- - The sandbox skill ID is securely stored on your machine for future use
190
- - Display the sandbox skill ID for testing
191
- - **Web Chat Interface**:
192
- - Automatically opens a beautiful chat interface in your browser
193
- - Test your sandbox skill in real-time with natural language
194
- - Messages are sent to the sandbox environment via the chat API
195
- - Available at `http://localhost:3000` (opens automatically)
196
- - **Live Log Panel**:
197
- - Real-time log feed showing execution details
198
- - WebSocket connection to `wss://api.heylua.ai/feed`
199
- - Console-style interface with color-coded log levels
200
- - Shows tool calls, errors, metrics, and execution metadata
201
- - Displays detailed information in expandable sections
202
- - Connection status indicator and automatic reconnection
203
- - Supports log types: error, debug, warn, info
204
- - **File Watching Mode**:
205
- - Watches for file changes in the current directory
206
- - Automatically recompiles and pushes to sandbox when files change
207
- - Ignores build artifacts (`.lua/`, `node_modules/`, `.git/`, etc.)
208
- - Debounces rapid changes to prevent excessive builds
209
- - Press `Ctrl+C` to stop watching and exit
210
-
211
- #### `lua skill deploy`
212
-
213
- Deploy a version to production.
325
+ # Start dev mode
326
+ lua dev
327
+
328
+ # Make changes to src/tools/*.ts
329
+ # Save → Auto-recompiles Auto-pushes to sandbox
330
+ # Test in browser at http://localhost:3000
331
+ ```
332
+
333
+ ### Testing
214
334
 
215
335
  ```bash
216
- lua skill deploy
217
- ```
218
-
219
- This command will:
220
- - Fetch available versions from the server
221
- - Let you select which version to deploy
222
- - Show a warning about deploying to all users
223
- - Publish the selected version to production
224
-
225
- **Requirements:**
226
- - Valid API key (configured with `lua auth configure`)
227
- - Compiled skill (run `lua skill compile` first)
228
- - Active internet connection
229
-
230
- ## Template System
231
-
232
- The Lua CLI includes a comprehensive template system with examples and documentation:
233
-
234
- ### Template Structure
235
- ```
236
- template/
237
- ├── README.md # Complete user guide
238
- ├── DEVELOPER.md # Technical documentation
239
- ├── API.md # API reference
240
- ├── QUICKSTART.md # Quick start guide
241
- ├── tools/ # Example tools
242
- │ ├── GetWeatherTool.ts
243
- │ ├── GetUserDataTool.ts
244
- │ ├── CreatePostTool.ts
245
- │ ├── CalculatorTool.ts
246
- │ └── AdvancedMathTool.ts
247
- ├── services/ # Example services
248
- │ ├── ApiService.ts
249
- │ ├── GetWeather.ts
250
- │ └── MathService.ts
251
- └── index.ts # Main skill definition
252
- ```
253
-
254
- ### Getting Started with Templates
255
-
256
- 1. **Copy the template:**
257
- ```bash
258
- cp -r template/ my-skill/
259
- cd my-skill
260
- ```
261
-
262
- 2. **Install dependencies:**
263
- ```bash
264
- npm install
265
- ```
266
-
267
- 3. **Read the documentation:**
268
- ```bash
269
- # Start with the quick start guide
270
- cat QUICKSTART.md
271
-
272
- # Then read the full documentation
273
- cat README.md
274
- ```
275
-
276
- 4. **Create your tools:**
277
- ```bash
278
- # Modify existing tools or create new ones
279
- # See tools/ directory for examples
280
- ```
281
-
282
- ## Configuration File
283
-
284
- The `lua.skill.yaml` file is created when you run `lua skill init`:
336
+ # Test individual tools
337
+ lua test
285
338
 
286
- ```yaml
287
- agent:
288
- agentId: "your-agent-id"
289
- orgId: "your-organization-id"
290
- persona: "Generated persona description" # Only for newly created agents
291
- welcomeMessage: "Welcome message" # Only for newly created agents
339
+ # Test conversationally
340
+ lua dev
341
+ # Use chat interface
342
+ ```
292
343
 
293
- skill:
294
- name: "Your Skill Name"
295
- version: "0.0.1"
296
- skillId: "your-skill-id"
344
+ ### Deployment
345
+
346
+ ```bash
347
+ # Upload new version
348
+ lua push
349
+
350
+ # Deploy to production
351
+ lua deploy
297
352
  ```
298
353
 
299
- ## Authentication Methods
354
+ ---
300
355
 
301
- ### API Key Authentication
356
+ ## 📚 Built-in APIs
302
357
 
303
- 1. Run `lua auth configure`
304
- 2. Select "API Key"
305
- 3. Enter your API key when prompted
306
- 4. The key is validated and stored securely
358
+ ### User API
359
+ ```typescript
360
+ import { User } from 'lua-cli';
307
361
 
308
- ### Email Authentication
362
+ const user = await User.get();
363
+ ```
309
364
 
310
- 1. Run `lua auth configure`
311
- 2. Select "Email"
312
- 3. Enter your email address
313
- 4. Check your email for the OTP code
314
- 5. Enter the 6-digit OTP code
315
- 6. An API key is automatically generated and stored
365
+ ### Custom Data API (with Vector Search)
366
+ ```typescript
367
+ import { Data } from 'lua-cli';
316
368
 
317
- ## Security
369
+ await Data.create('collection', data, searchText);
370
+ const results = await Data.search('collection', 'query', limit, threshold);
371
+ ```
318
372
 
319
- - All API keys are stored securely using your system's credential manager
320
- - Email authentication uses OTP (One-Time Password) for secure verification
321
- - Confirmation prompts prevent accidental exposure of sensitive information
322
- - No credentials are stored in plain text
373
+ ### Products API
374
+ ```typescript
375
+ import { Products } from 'lua-cli';
323
376
 
324
- ## Development Workflow
377
+ const products = await Products.search('laptop');
378
+ await Products.create({ name, price });
379
+ ```
325
380
 
326
- ### 1. Project Setup
327
- ```bash
328
- # Initialize a new skill project
329
- lua skill init
381
+ ### Baskets API
382
+ ```typescript
383
+ import { Baskets, BasketStatus } from 'lua-cli';
330
384
 
331
- # Or copy the template
332
- cp -r template/ my-skill/
333
- cd my-skill
334
- npm install
385
+ const basket = await Baskets.create({ currency: 'USD' });
386
+ await Baskets.addItem(basketId, { id, price, quantity });
335
387
  ```
336
388
 
337
- ### 2. Tool Development
338
- ```bash
339
- # Create tools in tools/ directory
340
- # Use TypeScript with Zod validation
341
- # See template/tools/ for examples
389
+ ### Orders API
390
+ ```typescript
391
+ import { Orders, OrderStatus } from 'lua-cli';
392
+
393
+ const order = await Baskets.placeOrder(orderData, basketId);
394
+ await Orders.updateStatus(OrderStatus.FULFILLED, orderId);
342
395
  ```
343
396
 
344
- ### 3. Testing
345
- ```bash
346
- # Compile your skill
347
- lua skill compile
397
+ **See [API_REFERENCE.md](API_REFERENCE.md) for complete API documentation.**
398
+
399
+ ---
400
+
401
+ ## 🎨 Template Project
402
+
403
+ The template includes 30+ working examples:
404
+
405
+ - 🌤️ **Weather Tool** - External API integration
406
+ - 👤 **User Data Tools** - User management
407
+ - 🛍️ **Product Tools** - E-commerce catalog
408
+ - 🛒 **Basket Tools** - Shopping cart
409
+ - 📦 **Order Tools** - Order processing
410
+ - 🎬 **Custom Data Tools** - Vector search
411
+ - 💳 **Payment Tool** - Payment integration
412
+
413
+ **See [TEMPLATE_GUIDE.md](TEMPLATE_GUIDE.md) for complete template documentation.**
348
414
 
349
- # Test your tools interactively
350
- lua skill test
415
+ ---
416
+
417
+ ## 🔒 Security
418
+
419
+ - ✅ API keys stored in system keychain
420
+ - ✅ Environment variables for secrets
421
+ - ✅ Secure VM sandbox for tool execution
422
+ - ✅ No hardcoded credentials
423
+ - ✅ HTTPS for all API calls
424
+
425
+ **Best Practices:**
426
+ ```typescript
427
+ import { env } from 'lua-cli';
428
+
429
+ // ✅ Good - Use environment variables
430
+ const apiKey = env('EXTERNAL_API_KEY');
431
+
432
+ // ❌ Bad - Hardcoded secrets
433
+ const apiKey = 'sk_abc123';
351
434
  ```
352
435
 
353
- ### 4. Deployment
354
- ```bash
355
- # Push version to server
356
- lua skill push
436
+ ---
357
437
 
358
- # Deploy to production
359
- lua skill deploy
438
+ ## 🧪 Testing
439
+
440
+ ### Unit Testing
441
+
442
+ ```typescript
443
+ import { describe, it, expect } from '@jest/globals';
444
+ import MyTool from './tools/MyTool';
445
+
446
+ describe('MyTool', () => {
447
+ it('should return expected result', async () => {
448
+ const tool = new MyTool();
449
+ const result = await tool.execute({ input: 'test' });
450
+ expect(result).toHaveProperty('success');
451
+ });
452
+ });
360
453
  ```
361
454
 
362
- ### 5. Iteration
455
+ ### Interactive Testing
456
+
363
457
  ```bash
364
- # Make changes to your tools
365
- # Recompile and test
366
- lua skill compile && lua skill test
458
+ lua test
459
+ # Select tool → Enter inputs → See results
460
+ ```
367
461
 
368
- # Push updates
369
- lua skill push
462
+ ### Conversational Testing
370
463
 
371
- # Deploy updates
372
- lua skill deploy
464
+ ```bash
465
+ lua dev
466
+ # Chat with AI at http://localhost:3000
373
467
  ```
374
468
 
375
- ## Requirements
469
+ ---
376
470
 
377
- - Node.js 16.0.0 or higher
378
- - Valid Lua AI platform account
379
- - TypeScript knowledge (for tool development)
380
- - Basic understanding of Zod schemas
471
+ ## 🎯 Use Cases
381
472
 
382
- ## Development
473
+ ### Customer Service
474
+ - Answer FAQs from knowledge base
475
+ - Look up order status
476
+ - Create support tickets
477
+ - Search documentation
383
478
 
384
- To contribute to this project:
479
+ ### E-commerce
480
+ - Product search and recommendations
481
+ - Shopping cart management
482
+ - Order creation and tracking
483
+ - Inventory checks
385
484
 
386
- 1. Clone the repository
387
- 2. Install dependencies: `npm install`
388
- 3. Build the project: `npm run build`
389
- 4. Make your changes
390
- 5. Test your changes
391
- 6. Submit a pull request
485
+ ### Booking & Scheduling
486
+ - Check availability
487
+ - Create appointments
488
+ - Send confirmations
489
+ - Manage reservations
392
490
 
393
- ## License
491
+ ### Data Management
492
+ - CRUD operations on custom data
493
+ - Vector search for semantic queries
494
+ - Data aggregation and reporting
495
+ - Integration with external systems
394
496
 
395
- MIT License - see [LICENSE](LICENSE) file for details.
497
+ ---
498
+
499
+ ## 📊 Architecture
396
500
 
397
- ## User Data API
501
+ ```
502
+ ┌─────────────────┐
503
+ │ AI Agent │
504
+ │ (Lua Platform)│
505
+ └────────┬────────┘
506
+
507
+
508
+ ┌─────────────────┐
509
+ │ Your Skills │ ← Built with Lua CLI
510
+ │ (TypeScript) │
511
+ └────────┬────────┘
512
+
513
+
514
+ ┌─────────────────┐
515
+ │ Your Tools │
516
+ │ (Functions) │
517
+ └────────┬────────┘
518
+
519
+
520
+ ┌─────────────────┐
521
+ │ Platform APIs │ ← User, Products, Data, etc.
522
+ │ External APIs │ ← Weather, Stripe, SendGrid, etc.
523
+ │ Databases │ ← Your own systems
524
+ └─────────────────┘
525
+ ```
398
526
 
399
- The Lua CLI provides a built-in User Data API that allows your tools to interact with persistent user data stored in the Lua system.
527
+ ---
400
528
 
401
- ### Basic Usage
529
+ ## 🌟 Key Features
402
530
 
531
+ ### Type-Safe Development
403
532
  ```typescript
404
- import { user } from 'lua-cli/user-data-api';
405
-
406
- // Get user data
407
- const userData = await user.data.get();
408
- console.log('User data:', userData);
409
-
410
- // Create or update user data
411
- await user.data.create({
412
- name: 'John Doe',
413
- preferences: {
414
- theme: 'dark',
415
- language: 'en'
416
- }
417
- });
533
+ // Full TypeScript support
534
+ import { LuaTool, Products } from 'lua-cli';
535
+ import { z } from 'zod';
418
536
 
419
- // Update existing data
420
- await user.data.update({
421
- name: 'Jane Doe',
422
- preferences: {
423
- theme: 'light',
424
- language: 'es'
537
+ // Autocomplete, type checking, and validation
538
+ export default class MyTool implements LuaTool {
539
+ inputSchema = z.object({
540
+ query: z.string() // Validated at runtime
541
+ });
542
+
543
+ async execute(input: z.infer<typeof this.inputSchema>) {
544
+ // input is fully typed!
545
+ return await Products.search(input.query);
425
546
  }
426
- });
547
+ }
548
+ ```
549
+
550
+ ### Instant Feedback
551
+ ```bash
552
+ lua dev
553
+ # Edit file → Save → Auto-reload → Test immediately
554
+ ```
427
555
 
428
- // Clear all user data
429
- await user.data.clear();
556
+ ### Production Ready
557
+ ```bash
558
+ lua push # Upload to server
559
+ lua deploy # Deploy to all users
430
560
  ```
431
561
 
432
- ### Using in Tools
562
+ ---
563
+
564
+ ## 📖 Learning Resources
565
+
566
+ ### 🟢 **New to Lua?**
567
+ Start here: **[GETTING_STARTED.md](GETTING_STARTED.md)**
568
+ - Installation
569
+ - First skill in 1 hour
570
+ - Complete tutorial
571
+ - Common patterns
572
+
573
+ ### 🟡 **Building Skills?**
574
+ Read: **[API_REFERENCE.md](API_REFERENCE.md)**
575
+ - All exported APIs
576
+ - Type definitions
577
+ - Code examples
578
+ - Best practices
579
+
580
+ ### 🟠 **Understanding Examples?**
581
+ Read: **[TEMPLATE_GUIDE.md](TEMPLATE_GUIDE.md)**
582
+ - Template structure
583
+ - 30+ tool examples
584
+ - Common recipes
585
+ - Migration guide
586
+
587
+ ### 🔵 **Using the CLI?**
588
+ Read: **[CLI_REFERENCE.md](CLI_REFERENCE.md)**
589
+ - All commands
590
+ - Flags and options
591
+ - Workflows
592
+ - Troubleshooting
593
+
594
+ ### 🟣 **Contributing?**
595
+ Read: **[DEVELOPER_GUIDE.md](DEVELOPER_GUIDE.md)**
596
+ - Architecture
597
+ - Module structure
598
+ - Contribution guidelines
599
+
600
+ ---
601
+
602
+ ## 🔧 Common Tasks
603
+
604
+ ### Create a New Tool
605
+
606
+ ```bash
607
+ # Create file
608
+ touch src/tools/MyTool.ts
609
+ ```
433
610
 
434
611
  ```typescript
435
- import { LuaTool } from 'lua-cli/skill';
436
- import { user } from 'lua-cli/user-data-api';
612
+ import { LuaTool } from 'lua-cli';
437
613
  import { z } from 'zod';
438
614
 
439
- export class UserPreferencesTool extends LuaTool {
440
- constructor() {
441
- super('user-preferences', 'Manage user preferences');
615
+ export default class MyTool implements LuaTool {
616
+ name = "my_tool";
617
+ description = "What it does";
618
+ inputSchema = z.object({ param: z.string() });
619
+
620
+ async execute(input: any) {
621
+ // Your logic here
622
+ return { success: true };
442
623
  }
624
+ }
625
+ ```
443
626
 
444
- async execute(input: { action: string; key?: string; value?: string }) {
445
- const { action, key, value } = input;
446
-
447
- switch (action) {
448
- case 'get':
449
- const userData = await user.data.get();
450
- return { preferences: userData.preferences || {} };
451
-
452
- case 'set':
453
- if (!key || !value) {
454
- throw new Error('Key and value are required for set action');
455
- }
456
-
457
- const currentData = await user.data.get();
458
- const updatedData = {
459
- ...currentData,
460
- preferences: {
461
- ...currentData.preferences,
462
- [key]: value
463
- }
464
- };
465
-
466
- await user.data.update(updatedData);
467
- return { success: true, message: `Set ${key} to ${value}` };
468
-
469
- case 'clear':
470
- await user.data.clear();
471
- return { success: true, message: 'All preferences cleared' };
472
-
473
- default:
474
- throw new Error('Invalid action. Use: get, set, or clear');
475
- }
627
+ Add to skill in `src/index.ts`:
628
+ ```typescript
629
+ import MyTool from './tools/MyTool';
630
+
631
+ const skill = new LuaSkill({
632
+ tools: [new MyTool()]
633
+ });
634
+ ```
635
+
636
+ ---
637
+
638
+ ### Call External APIs
639
+
640
+ ```typescript
641
+ import { LuaTool, env } from 'lua-cli';
642
+
643
+ export default class ExternalApiTool implements LuaTool {
644
+ async execute(input: any) {
645
+ const apiKey = env('EXTERNAL_API_KEY');
646
+
647
+ const response = await fetch('https://api.example.com/data', {
648
+ headers: { 'Authorization': `Bearer ${apiKey}` }
649
+ });
650
+
651
+ return await response.json();
476
652
  }
653
+ }
654
+ ```
477
655
 
478
- getInputSchema() {
479
- return z.object({
480
- action: z.enum(['get', 'set', 'clear']).describe('Action to perform'),
481
- key: z.string().optional().describe('Preference key (required for set action)'),
482
- value: z.string().optional().describe('Preference value (required for set action)')
656
+ ---
657
+
658
+ ### Use Platform APIs
659
+
660
+ ```typescript
661
+ import { LuaTool, Products, Baskets } from 'lua-cli';
662
+
663
+ export default class ShoppingTool implements LuaTool {
664
+ async execute(input: any) {
665
+ // Search products
666
+ const products = await Products.search(input.query);
667
+
668
+ // Create basket
669
+ const basket = await Baskets.create({ currency: 'USD' });
670
+
671
+ // Add item
672
+ await Baskets.addItem(basket.id, {
673
+ id: products.data[0].id,
674
+ price: products.data[0].price,
675
+ quantity: 1
483
676
  });
677
+
678
+ return { basketId: basket.id };
484
679
  }
485
680
  }
486
681
  ```
487
682
 
488
- ### API Reference
489
-
490
- - `user.data.get()` - Retrieves current user data
491
- - `user.data.create(data)` - Creates or updates user data
492
- - `user.data.update(data)` - Updates existing user data (alias for create)
493
- - `user.data.clear()` - Clears all user data
494
-
495
- For more details, see [USER_DATA_API.md](./USER_DATA_API.md).
496
-
497
- ## Support
498
-
499
- For support and questions:
500
- - Create an issue on [GitHub](https://github.com/lua-ai-global/lua-cli/issues)
501
- - Contact: stefan@heylua.ai
502
-
503
- ## Changelog
504
-
505
- ### 1.4.0
506
- - **Agent Creation**: Added ability to create new agents during `lua skill init`
507
- - **Agent Type Selection**: Choose from various agent types (Base Agent, Shopify, WooCommerce, etc.)
508
- - **Metadata Collection**: Automatic collection of required metadata for agent types
509
- - **Feature Configuration**: Enable/disable features like RAG, tickets, web search
510
- - **Persona Generation**: Automatic persona and welcome message generation for new agents
511
- - **Enhanced YAML**: Added persona and welcome message fields to configuration file
512
-
513
- ### 1.3.0
514
- - **Command Restructure**: Reorganized commands under `lua auth` and `lua skill` groups
515
- - **New Push Command**: Added `lua skill push` to push versions to server
516
- - **New Deploy Command**: Added `lua skill deploy` to deploy versions to production
517
- - **Version Management**: Added version field to YAML configuration
518
- - **Improved UX**: Better command organization and intuitive naming
519
- - **Enhanced Workflow**: Complete skill lifecycle from init to production deployment
520
-
521
- ### 1.2.0
522
- - **Tool Development Framework**: Complete LuaSkill and LuaTool framework
523
- - **Dependency Bundling**: Automatic bundling of npm packages using esbuild
524
- - **Interactive Testing**: Real-time tool testing with `lua test` command
525
- - **Code Compression**: Gzip compression for efficient storage
526
- - **In-Memory Execution**: VM-based execution without temporary files
527
- - **Comprehensive Documentation**: Complete guides, API reference, and examples
528
- - **Template System**: Rich template with 5 example tools and services
529
- - **TypeScript Support**: Full TypeScript integration with Zod validation
530
- - **Error Handling**: Robust error handling and validation
531
- - **Performance Optimization**: Optimized bundling and execution
532
-
533
- ### 1.1.0
534
- - **Major Refactoring**: Complete codebase reorganization into modular structure
535
- - **Email Authentication**: Added OTP-based email authentication
536
- - **API Key Display**: New `lua apiKey` command
537
- - **TypeScript Types**: Comprehensive type definitions
538
- - **Improved Architecture**: Separated commands, services, and utilities
539
-
540
- ### 1.0.0
541
- - Initial release
542
- - API key authentication
543
- - Organization and agent management
544
- - Skill project initialization
545
- - Secure credential storage
683
+ ---
684
+
685
+ ### Store Custom Data
686
+
687
+ ```typescript
688
+ import { LuaTool, Data } from 'lua-cli';
689
+
690
+ export default class SaveNoteTool implements LuaTool {
691
+ async execute(input: any) {
692
+ // Create
693
+ const note = await Data.create('notes', {
694
+ title: input.title,
695
+ content: input.content,
696
+ tags: input.tags
697
+ }, `${input.title} ${input.content}`);
698
+
699
+ // Search later
700
+ const results = await Data.search('notes', 'meeting notes', 10);
701
+
702
+ return { noteId: note.id };
703
+ }
704
+ }
705
+ ```
706
+
707
+ ---
708
+
709
+ ## 🎯 Example Projects
710
+
711
+ ### Knowledge Base Assistant
712
+ ```typescript
713
+ Tools: search_kb, create_article, update_article
714
+ APIs: Data (vector search)
715
+ Use Case: Company documentation, FAQ
716
+ ```
717
+
718
+ ### E-commerce Bot
719
+ ```typescript
720
+ Tools: search_products, add_to_cart, checkout
721
+ APIs: Products, Baskets, Orders
722
+ Use Case: Online shopping assistant
723
+ ```
724
+
725
+ ### Booking System
726
+ ```typescript
727
+ Tools: check_availability, make_reservation, cancel_booking
728
+ APIs: Data (custom collections)
729
+ Use Case: Restaurant/hotel reservations
730
+ ```
731
+
732
+ ### CRM Assistant
733
+ ```typescript
734
+ Tools: find_customer, create_lead, update_contact
735
+ APIs: Data, User
736
+ Use Case: Customer relationship management
737
+ ```
738
+
739
+ ---
740
+
741
+ ## 🚀 Deployment
742
+
743
+ ### Development → Production Flow
744
+
745
+ ```bash
746
+ # 1. Develop locally
747
+ lua dev
748
+ # Edit, test, iterate
749
+
750
+ # 2. Push to server
751
+ lua push
752
+
753
+ # 3. Test in sandbox
754
+ lua dev
755
+ # Final testing
756
+
757
+ # 4. Deploy to production
758
+ lua deploy
759
+ # Available to all users!
760
+ ```
761
+
762
+ ### Version Management
763
+
764
+ Update version in `lua.skill.yaml`:
765
+ ```yaml
766
+ skills:
767
+ - name: my-skill
768
+ version: 1.0.1 # ← Increment this
769
+ ```
770
+
771
+ Then push and deploy:
772
+ ```bash
773
+ lua push # Uploads v1.0.1
774
+ lua deploy # Deploys v1.0.1
775
+ ```
776
+
777
+ ---
778
+
779
+ ## ⚙️ Configuration
780
+
781
+ ### Environment Variables
782
+
783
+ **`.env` file:**
784
+ ```bash
785
+ STRIPE_API_KEY=sk_test_abc123
786
+ SENDGRID_KEY=SG.xyz789
787
+ CUSTOM_API_URL=https://api.example.com
788
+ ```
789
+
790
+ **`lua.skill.yaml`:**
791
+ ```yaml
792
+ skill:
793
+ env:
794
+ PRODUCTION_API_KEY: sk_live_abc123
795
+ BASE_URL: https://prod.example.com
796
+ ```
797
+
798
+ **Access in code:**
799
+ ```typescript
800
+ import { env } from 'lua-cli';
801
+
802
+ const key = env('STRIPE_API_KEY');
803
+ ```
804
+
805
+ ---
806
+
807
+ ## 🤝 Contributing
808
+
809
+ We welcome contributions!
810
+
811
+ 1. Fork the repository
812
+ 2. Create a feature branch
813
+ 3. Make your changes
814
+ 4. Write tests
815
+ 5. Submit a pull request
816
+
817
+ See [DEVELOPER_GUIDE.md](DEVELOPER_GUIDE.md) for architecture details.
818
+
819
+ ---
820
+
821
+ ## 📄 License
822
+
823
+ MIT License - see [LICENSE](LICENSE) file for details.
824
+
825
+ ---
826
+
827
+ ## 🔗 Links
828
+
829
+ - **Documentation**: https://docs.lua.ai
830
+ - **Platform**: https://heylua.ai
831
+ - **GitHub**: https://github.com/lua-ai/lua-cli
832
+ - **npm**: https://www.npmjs.com/package/lua-cli
833
+
834
+ ---
835
+
836
+ ## 💬 Support
837
+
838
+ - **Issues**: [GitHub Issues](https://github.com/lua-ai/lua-cli/issues)
839
+ - **Email**: support@lua.ai
840
+ - **Docs**: https://docs.lua.ai
841
+
842
+ ---
843
+
844
+ ## 🎉 Quick Links
845
+
846
+ | I want to... | Read this... |
847
+ |--------------|--------------|
848
+ | **Get started** | [GETTING_STARTED.md](GETTING_STARTED.md) |
849
+ | **Learn the API** | [API_REFERENCE.md](API_REFERENCE.md) |
850
+ | **Use CLI commands** | [CLI_REFERENCE.md](CLI_REFERENCE.md) |
851
+ | **Understand examples** | [TEMPLATE_GUIDE.md](TEMPLATE_GUIDE.md) |
852
+ | **Contribute code** | [DEVELOPER_GUIDE.md](DEVELOPER_GUIDE.md) |
853
+ | **See changelog** | [CHANGELOG.md](CHANGELOG.md) |
854
+
855
+ ---
856
+
857
+ **Happy building! 🚀**
858
+
859
+ Made with ❤️ by the Lua team