@lexia/cli
v0.4.2
Published
CLI tool for managing Lexia projects - Quick setup and deployment
Maintainers
Readme
@lexia/cli
A powerful command-line tool for managing Lexia projects. Set up and run your AI agent in seconds! 🚀
✨ Features
- 🎯 One Command Setup - Clone, configure, and run with
lexia kickstart <language> - 🌐 Multi-Language Support - Python ✅ | Node.js ✅ | Go (coming soon)
- 🖥️ Cross-Platform - Works on Windows, Linux, and macOS
- 📦 No Dependencies - Just Node.js (which you already have!)
- 🎨 Beautiful UI - Colorful output with progress indicators
- ⚡ Fast - Node.js native performance
- 🔄 Process Management - Manages both backend and frontend automatically
📦 Installation
Quick Install (Recommended)
# Install globally via npm
npm install -g @lexia/cli
# Or use it directly with npx (no installation needed)
npx @lexia/cli kickstart pythonInstall from Source
# Clone the repository
git clone https://github.com/Xalantico/lexia-cli
cd lexia-cli
# Install dependencies
npm install
# Link globally
npm link🚀 Quick Start
Prerequisites
Make sure you have these installed:
- Node.js 14+ (you already have this!)
- Python 3.8+ (for Python starter kit)
- Git
Usage
Create and run a new Lexia Python agent in one command:
lexia kickstart pythonThat's it! This will:
- ✅ Check prerequisites (Python, Git, Node.js)
- 📁 Create
lexia-kickstartdirectory - 📦 Clone the starter kit
- 🐍 Set up Python virtual environment
- 📥 Install all dependencies
- 🚀 Start backend (port 5001)
- 🎨 Start frontend (port 3000)
📖 Command Reference
lexia kickstart <language>
Quick setup for a new Lexia project in your preferred language.
Available Languages:
python- Python-based agent (FastAPI + OpenAI) ✅ Available nownode- Node.js-based agent (Express + OpenAI) ✅ Available nowgo- Go-based agent 🚧 Coming soon
lexia kickstart python
Set up a Python-based Lexia agent with FastAPI and OpenAI.
Options:
-d, --directory <name> Directory name (default: "lexia-kickstart")
-p, --port <number> Frontend port (default: 3000)
-a, --agent-port <number> Backend port (default: 5001)
--no-start Skip auto-starting serversExamples:
# Basic usage
lexia kickstart python
# Custom directory name
lexia kickstart python --directory my-awesome-agent
# Custom ports
lexia kickstart python --port 8080 --agent-port 8000
# Setup without auto-start
lexia kickstart python --no-start
# All options combined
lexia kickstart python -d my-agent -p 4000 -a 5000lexia kickstart node
Set up a Node.js-based Lexia agent with Express and OpenAI.
Options: Same as Python (see above)
Examples:
# Basic usage
lexia kickstart node
# Custom directory name
lexia kickstart node --directory my-node-agent
# Custom ports
lexia kickstart node --port 8080 --agent-port 8000
# All options combined
lexia kickstart node -d my-agent -p 4000 -a 5000Coming Soon:
# Go agent (coming soon)
lexia kickstart go🎬 What It Looks Like
$ lexia kickstart python
============================================================
🚀 Lexia Kickstart - Python
============================================================
✓ Python found: python3
✓ Git found
✓ Node.js/npm found
✓ npx found
► Creating directory: lexia-kickstart
✓ Created directory: /path/to/lexia-kickstart
✓ Repository cloned successfully
✓ Virtual environment created
✓ Dependencies installed
============================================================
✓ Setup completed successfully!
============================================================
✓ Backend started (PID: 12345)
✓ Frontend started (PID: 12346)
============================================================
🎉 Lexia is running!
============================================================
Frontend: http://localhost:3000
Backend: http://localhost:5001
⚠ Press Ctrl+C to stop both servers🛠️ Development
Project Structure
lexia-cli/
├── bin/
│ └── lexia.js # CLI entry point (executable)
├── src/
│ ├── commands/
│ │ └── kickstart.js # Kickstart command implementation
│ └── utils/
│ └── index.js # Utility functions
├── package.json # Package configuration
├── README.md # This file
└── .gitignore # Git ignore patternsAdding New Commands
- Create a new file in
src/commands/:
// src/commands/mycommand.js
async function myCommand(options) {
console.log('Hello from my command!');
}
module.exports = myCommand;- Register it in
bin/lexia.js:
const myCommand = require('../src/commands/mycommand');
program
.command('mycommand')
.description('My custom command')
.action(myCommand);Dependencies
- commander - CLI framework with elegant syntax
- chalk - Terminal styling and colors
- ora - Beautiful terminal spinners
- inquirer - Interactive prompts
- simple-git - Git operations
- cross-spawn - Cross-platform process spawning
🐛 Troubleshooting
Common Issues
"Python not found"
# Install Python 3.8+
# macOS: brew install python3
# Windows: https://www.python.org/downloads/
# Linux: sudo apt install python3"Git not found"
# Install Git
# macOS: brew install git
# Windows: https://git-scm.com/downloads
# Linux: sudo apt install git"Directory already exists"
# Use a different directory name
lexia kickstart python --directory my-other-project
# Or remove the existing directory
rm -rf lexia-kickstart"Port already in use"
# Use different ports
lexia kickstart python --port 4000 --agent-port 5000
# Or find and kill the process using the port
# macOS/Linux: lsof -ti:3000 | xargs kill
# Windows: netstat -ano | findstr :3000Platform-Specific Notes
Windows
- Uses
lexia_env\Scripts\python.exe - Automatically handles Windows paths
- PowerShell and CMD supported
macOS/Linux
- Uses
lexia_env/bin/python - Bash and Zsh supported
📝 Manual Setup
If you prefer to set up manually:
# After kickstart python (with --no-start)
cd lexia-kickstart
# Activate virtual environment
source lexia_env/bin/activate # macOS/Linux
lexia_env\Scripts\activate # Windows
# Start backend
python main.py --dev
# In another terminal, start frontend
npx -y @lexia/ui lexia --port=3000 --agent-port=5001🌐 Multi-Language Support
Lexia CLI is designed to support multiple programming languages:
Currently Available:
- ✅ Python - Full support with FastAPI + OpenAI
- ✅ Node.js - Full support with Express + OpenAI
Coming Soon:
- 🚧 Go - Gin/Fiber + OpenAI
Future Languages:
- TypeScript
- Rust
- Java
- C#/.NET
Want to contribute a starter kit in your favorite language? Check out our Contributing Guide!
🚢 Publishing to npm
To publish this package to npm:
# Login to npm
npm login
# Publish
npm publish
# Or publish as scoped package
npm publish --access public🤝 Contributing
Contributions are welcome! Here's how:
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
📄 License
MIT License - see LICENSE file for details
🙏 Support
🎯 Roadmap
Commands (Coming Soon)
lexia status # Check running Lexia instances
lexia stop # Stop running servers
lexia restart # Restart servers
lexia update # Update Lexia packages
lexia config # Configure Lexia settings
lexia deploy # Deploy to productionLanguage Support
lexia kickstart node # Node.js/TypeScript agent
lexia kickstart go # Go-based agent
lexia kickstart rust # Rust-based agentMade with ❤️ by the Lexia Team
Star ⭐ this repo if you find it helpful!
