Package Exports
- lua-cli
- lua-cli/skill
- lua-cli/types
Readme
Lua CLI
A powerful command-line interface for the Lua AI platform that helps you develop, test, and deploy LuaSkills with custom tools.
Installation
npm install -g lua-cliUsage
After installation, you can use the lua command:
lua --helpFeatures
- ๐ Secure Authentication: Support for both API key and email-based OTP authentication
- ๐ข Organization Management: Select and manage multiple organizations
- ๐ค Agent Management: Choose from available agents within your organizations
- ๐ ๏ธ Skill Development: Initialize new Lua skills with proper configuration
- ๐ง Tool Development: Create custom tools with TypeScript and Zod validation
- ๐ฆ Dependency Bundling: Automatic bundling of npm packages using esbuild
- ๐งช Interactive Testing: Test your tools with real-time execution
- ๐ Deployment: Compile and deploy skills to the Lua platform
- ๐ API Key Management: Securely store, view, and manage your API keys
- ๐ Comprehensive Documentation: Complete guides and examples
Quick Start
Configure your authentication:
lua auth configure
Choose between API key or email authentication methods.
Initialize a new skill project:
lua skill init
Select your organization and agent, then provide skill details.
Develop your tools:
# Create tools in the tools/ directory # See template/README.md for examples
Compile your skill:
lua skill compile
Bundles dependencies and creates deployable files.
Test your tools:
lua skill testInteractive testing interface for your tools.
Deploy your skill:
lua skill deploy
Deploy to the Lua platform.
Commands
Authentication Commands
lua auth configure
Set up your authentication credentials. You can choose between:
- API Key: Direct API key input
- Email: Email-based OTP authentication
lua auth configurelua auth key
Display your stored API key (with confirmation prompt).
lua auth keylua auth logout
Delete your stored API key and credentials.
lua auth logoutSkill Management Commands
lua skill init
Initialize a new Lua skill project in the current directory.
lua skill initThis command will:
- Fetch your organizations and agents from the API
- Let you select an organization by name
- Let you choose an agent from the selected organization
- Prompt for skill name and description
- Create a
lua.skill.tomlconfiguration file - Copy template files to the current directory
lua skill compile
Compile your LuaSkill and bundle all dependencies.
lua skill compileThis command will:
- Scan your tools for imports and dependencies
- Bundle external packages using esbuild
- Compress the generated code for efficient storage
- Create
.lua/deploy.jsonwith compiled skill data - Generate individual tool files in
.lua/directory
Options:
--watch- Watch for changes and recompile automatically--minify- Minify the bundled code
lua skill test
Interactive testing interface for your tools.
lua skill testFeatures:
- Tool selection menu
- Input validation with Zod schemas
- Real-time execution in isolated VM context
- Error reporting and debugging
- Mock data support
lua skill push
Push your compiled skill version to the server.
lua skill pushThis command will:
- Compile your skill first
- Confirm the version you want to push
- Send the compiled skill data to the server
- Store the skill ID in your TOML file
lua skill deploy
Deploy a version to production.
lua skill deployThis command will:
- Fetch available versions from the server
- Let you select which version to deploy
- Show a warning about deploying to all users
- Publish the selected version to production
Requirements:
- Valid API key (configured with
lua auth configure) - Compiled skill (run
lua skill compilefirst) - Active internet connection
Template System
The Lua CLI includes a comprehensive template system with examples and documentation:
Template Structure
template/
โโโ README.md # Complete user guide
โโโ DEVELOPER.md # Technical documentation
โโโ API.md # API reference
โโโ QUICKSTART.md # Quick start guide
โโโ tools/ # Example tools
โ โโโ GetWeatherTool.ts
โ โโโ GetUserDataTool.ts
โ โโโ CreatePostTool.ts
โ โโโ CalculatorTool.ts
โ โโโ AdvancedMathTool.ts
โโโ services/ # Example services
โ โโโ ApiService.ts
โ โโโ GetWeather.ts
โ โโโ MathService.ts
โโโ index.ts # Main skill definitionGetting Started with Templates
Copy the template:
cp -r template/ my-skill/ cd my-skill
Install dependencies:
npm install
Read the documentation:
# Start with the quick start guide cat QUICKSTART.md # Then read the full documentation cat README.md
Create your tools:
# Modify existing tools or create new ones # See tools/ directory for examples
Configuration File
The lua.skill.toml file is created when you run lua skill init:
[agent]
agentId = "your-agent-id"
orgId = "your-organization-id"
[skill]
name = "Your Skill Name"
version = "0.0.1"
skillId = "your-skill-id"Authentication Methods
API Key Authentication
- Run
lua auth configure - Select "API Key"
- Enter your API key when prompted
- The key is validated and stored securely
Email Authentication
- Run
lua auth configure - Select "Email"
- Enter your email address
- Check your email for the OTP code
- Enter the 6-digit OTP code
- An API key is automatically generated and stored
Security
- All API keys are stored securely using your system's credential manager
- Email authentication uses OTP (One-Time Password) for secure verification
- Confirmation prompts prevent accidental exposure of sensitive information
- No credentials are stored in plain text
Development Workflow
1. Project Setup
# Initialize a new skill project
lua skill init
# Or copy the template
cp -r template/ my-skill/
cd my-skill
npm install2. Tool Development
# Create tools in tools/ directory
# Use TypeScript with Zod validation
# See template/tools/ for examples3. Testing
# Compile your skill
lua skill compile
# Test your tools interactively
lua skill test4. Deployment
# Push version to server
lua skill push
# Deploy to production
lua skill deploy5. Iteration
# Make changes to your tools
# Recompile and test
lua skill compile && lua skill test
# Push updates
lua skill push
# Deploy updates
lua skill deployRequirements
- Node.js 16.0.0 or higher
- Valid Lua AI platform account
- TypeScript knowledge (for tool development)
- Basic understanding of Zod schemas
Development
To contribute to this project:
- Clone the repository
- Install dependencies:
npm install - Build the project:
npm run build - Make your changes
- Test your changes
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For support and questions:
- Create an issue on GitHub
- Contact: stefan@lua.dev
Changelog
1.3.0
- Command Restructure: Reorganized commands under
lua authandlua skillgroups - New Push Command: Added
lua skill pushto push versions to server - New Deploy Command: Added
lua skill deployto deploy versions to production - Version Management: Added version field to TOML configuration
- Improved UX: Better command organization and intuitive naming
- Enhanced Workflow: Complete skill lifecycle from init to production deployment
1.2.0
- Tool Development Framework: Complete LuaSkill and LuaTool framework
- Dependency Bundling: Automatic bundling of npm packages using esbuild
- Interactive Testing: Real-time tool testing with
lua testcommand - Code Compression: Gzip compression for efficient storage
- In-Memory Execution: VM-based execution without temporary files
- Comprehensive Documentation: Complete guides, API reference, and examples
- Template System: Rich template with 5 example tools and services
- TypeScript Support: Full TypeScript integration with Zod validation
- Error Handling: Robust error handling and validation
- Performance Optimization: Optimized bundling and execution
1.1.0
- Major Refactoring: Complete codebase reorganization into modular structure
- Email Authentication: Added OTP-based email authentication
- API Key Display: New
lua apiKeycommand - TypeScript Types: Comprehensive type definitions
- Improved Architecture: Separated commands, services, and utilities
1.0.0
- Initial release
- API key authentication
- Organization and agent management
- Skill project initialization
- Secure credential storage