Skip to content

Installation

Choose your installation method based on your development environment:


No Rust required! For JavaScript and TypeScript developers:

Terminal window
# Install globally
npm install -g @getlumos/cli
# Verify installation
lumos --version
# 0.1.0

Or use directly with npx:

Terminal window
npx @getlumos/cli generate schema.lumos

Prerequisites:

  • Node.js 16.0 or higher

Published Package:

Learn more: Using LUMOS with npm →


For Rust and Anchor developers:

  • Rust 1.70 or higher
  • Cargo package manager

Check your Rust version:

Terminal window
rustc --version
# rustc 1.70.0 or higher

If you don’t have Rust installed, visit rustup.rs

The fastest way to get started with LUMOS:

Terminal window
# Install the CLI
cargo install lumos-cli
# Verify installation
lumos --version
# lumos-cli 0.1.0

Published Packages:

  • 📦 lumos-core - Core library (parser, generators, IR)
  • 🔧 lumos-cli - Command-line interface

For the latest development version:

Terminal window
# Clone the repository
git clone https://github.com/getlumos/lumos.git
cd lumos
# Build the CLI
cargo build --release --all-features --workspace
# The binary will be at: target/release/lumos
./target/release/lumos --version

To use LUMOS in your Rust project:

Cargo.toml
[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)?;
}

Run the following command to ensure LUMOS is installed correctly:

Terminal window
lumos --help

You 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 version

Installation Complete!

Now you’re ready to:

  1. Quick Start → - Create your first LUMOS schema
  2. Examples → - Explore real-world schemas
  3. Type Mapping → - Learn the type system

If lumos command is not found after installation:

  1. Ensure Cargo’s bin directory is in your PATH:

    Terminal window
    echo $PATH | grep .cargo/bin
  2. 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 shell
    source ~/.bashrc # or ~/.zshrc

Make sure you have the latest Rust toolchain:

Terminal window
rustup update

Then retry the build:

Terminal window
cargo clean
cargo build --release

For enhanced development experience with syntax highlighting:

  1. Visit: vscode-lumos on GitHub
  2. Search “LUMOS” in VSCode Extensions Marketplace
  3. Install the extension

Features:

  • Syntax highlighting for .lumos files
  • Code snippets
  • Auto-generation on save
  • Commands integration