Installation
Choose your installation method based on your development environment:
- JavaScript/TypeScript → Install via npm
- Rust/Anchor → Install via Cargo
Install via npm (JavaScript/TypeScript)
Section titled “Install via npm (JavaScript/TypeScript)”No Rust required! For JavaScript and TypeScript developers:
# Install globallynpm install -g @getlumos/cli
# Verify installationlumos --version# 0.1.0Or use directly with npx:
npx @getlumos/cli generate schema.lumosPrerequisites:
- Node.js 16.0 or higher
Published Package:
- 📦 @getlumos/cli - npm package with WASM
Learn more: Using LUMOS with npm →
Install via Cargo (Rust/Anchor)
Section titled “Install via Cargo (Rust/Anchor)”For Rust and Anchor developers:
Prerequisites
Section titled “Prerequisites”- Rust 1.70 or higher
- Cargo package manager
Check your Rust version:
rustc --version# rustc 1.70.0 or higherIf you don’t have Rust installed, visit rustup.rs
Install from crates.io (Recommended)
Section titled “Install from crates.io (Recommended)”The fastest way to get started with LUMOS:
# Install the CLIcargo install lumos-cli
# Verify installationlumos --version# lumos-cli 0.1.0Published Packages:
- 📦 lumos-core - Core library (parser, generators, IR)
- 🔧 lumos-cli - Command-line interface
Install from Source
Section titled “Install from Source”For the latest development version:
# Clone the repositorygit clone https://github.com/getlumos/lumos.gitcd lumos
# Build the CLIcargo build --release --all-features --workspace
# The binary will be at: target/release/lumos./target/release/lumos --versionAdd as Library Dependency
Section titled “Add as Library Dependency”To use LUMOS in your Rust project:
[dependencies]lumos-core = "0.1"Then in your Rust code:
use lumos_core::{parse_schema, generate_rust, generate_typescript};
fn main() { let schema = parse_schema("schema.lumos")?; let rust_code = generate_rust(&schema)?; let ts_code = generate_typescript(&schema)?;}Verify Installation
Section titled “Verify Installation”Run the following command to ensure LUMOS is installed correctly:
lumos --helpYou should see:
LUMOS - Type-safe schema language for Solana development
Usage: lumos <COMMAND>
Commands: init Initialize a new LUMOS project generate Generate Rust and TypeScript code from schema validate Validate schema syntax check Check if generated code is up-to-date help Print this message or the help of the given subcommand(s)
Options: -h, --help Print help -V, --version Print versionNext Steps
Section titled “Next Steps”✅ Installation Complete!
Now you’re ready to:
- Quick Start → - Create your first LUMOS schema
- Examples → - Explore real-world schemas
- Type Mapping → - Learn the type system
Troubleshooting
Section titled “Troubleshooting”Command not found: lumos
Section titled “Command not found: lumos”If lumos command is not found after installation:
-
Ensure Cargo’s bin directory is in your PATH:
Terminal window echo $PATH | grep .cargo/bin -
If not, add to your shell profile:
Terminal window # For bash (~/.bashrc)export PATH="$HOME/.cargo/bin:$PATH"# For zsh (~/.zshrc)export PATH="$HOME/.cargo/bin:$PATH"# Reload shellsource ~/.bashrc # or ~/.zshrc
Build errors from source
Section titled “Build errors from source”Make sure you have the latest Rust toolchain:
rustup updateThen retry the build:
cargo cleancargo build --releaseVSCode Extension (Optional)
Section titled “VSCode Extension (Optional)”For enhanced development experience with syntax highlighting:
- Visit: vscode-lumos on GitHub
- Search “LUMOS” in VSCode Extensions Marketplace
- Install the extension
Features:
- Syntax highlighting for
.lumosfiles - Code snippets
- Auto-generation on save
- Commands integration