Skip to content

superiums/lumesh

 
 

Repository files navigation

English | 简体中文

Lumesh

GitHub License GitHub Repo stars GitHub Release

Codeberg | GitHub | Document | DeepWiki | release-page 1 | release-page 2 | tree-sitter

     ⚡┓
      ┃ ┓┏┏┳┓┏┓
      ┗┛┗┻┛┗┗┗  lightweight ultimate modern efficient 

Write as js, works as Bash, run as light

Lumesh is a modern shell and scripting language, as a bash replacer, it was completely rewritten from Dune, designed for high performance and user-friendly experience.

The Origin of Lume's Name

Lume [lʌmi] means 'light' and symbolizes lightness and speed.

  • Lightweight

    Lume Shell is a lightweight shell with a clean design and minimal resource usage, ideal for scenarios requiring rapid startup and efficient operation.

  • Ultimate

    Lume Shell is a powerful tool that delivers a comprehensive command-line experience for advanced users.

  • Modern

    Lume Shell incorporates contemporary design philosophies and technologies, supporting the latest scripting language features and interactive methods.

  • Efficient

    Lume Shell excels in command execution and script processing, delivering both high efficiency and rapid response.

⚑ Why Choose Lumesh?

Pain Points of Traditional Shells

  • Syntax limitations: Traditional shell syntax is outdated with a steep learning curve.
  • Difficult error handling: Lacks flexible error capture and recovery mechanisms.
  • Weak data processing: Struggles with structured data handling.
  • Insufficient programming capabilities: Lacks modern programming language features.

Lumesh’s Solutions

  • Modern syntax: Supports destructuring assignment, arrow functions, method chaining, higher-order functions, decorators, and other modern features.
  • Powerful error handling: Provides 7 error-catch operators (?., ?:, ?+, ??, ?>, ?!, ?~).
  • Structured pipelines: Supports passing and processing structured data within pipelines.
  • Rich built-in library: Offers 17 built-in modules covering filesystem, string processing, time operations, and more.

Performance Comparison

Comparison Item lume bash dash fish
Speed (million loops) ***** *** **** *
Syntax Friendliness ***** ** * ****
Error Messages ***** * * ***
Error Handling ***** * * *
Built-in Libraries ***** *
Interactivity **** ** * *****
Size **** *** ***** **
Key Bindings
Structured Pipelines
AI Interaction

⚑ Core Features

⚡ Cross Platform

Experience one style every place.

⚡ Intuitive Syntax Design

# Syntax like modern programming languages
let user = {name: "Alice", age: 25}
let {name, age} = user
let numbers = 1..10 | list.filter(x -> x > 5)
let [a, b] = [1, 2]

⚡ Chained Calls

Supports method chaining similar to object-oriented languages:

"hello world".split(' ').join(',')
data | .filter(x -> x > 0)

⚡ Powerful Error Handling

More intelligent error tips, error capture and recovery deeling than traditional shells.

command ?.        # Ignore errors
command ?: e      # Error capture or default value
command ?+        # Print to standard output
command ??        # Print to error output
command ?>        # Override print (data channel)
command ?!        # Terminate on error (terminate pipeline)

⚡ Diverse Pipeline Operations

data | process           # Standard pipeline, supports structured data
data | positional a _ c  # Positional pipeline
data |> loop_deel        # Loop pipeline
data |^ interactive      # PTY pipeline

Structured pipelines:

ls -l | .to_table() | where(size > 5K)
Fs.ls -l | where(size > 5K) | select(name,size,modified)
ls -1 |> cp -r _ /tmp/

⚡ Rich Built-in Modules

  • Collection Operations: list.reduce, list.map
  • File System: fs.ls, fs.read, fs.write
  • String Processing: string.split, string.join, regex module
  • Time Operations: time.now, time.format
  • Data Conversion: into, from module
  • Mathematical Calculations: Complete math function library
  • Logging: log module
  • UI Operations: ui.pick, ui.confirm

⚡ Function Decorators

Supports function decorator syntax:

@decorator_name
@decorator_with_args(arg)
fn my_function() { ... }

⚡ Module import

Supports module import syntax:

use moduleA as ma
ma::method()

AI Integration Support

Built-in local AI assistant, supports command completion and smart suggestions.

⚑ Quick Start

Installation Methods

method 1: use install script

Method 2: Download Precompiled Version

you need to manually extra data.tgz to data directory to enable param completion.

Method 3: Compile from Source

git clone 'https://codeberg.com/santo/lumesh.git'
cd lumesh
cargo build --release

Method 4: Build from Cargo

cargo install lumesh

Experience Immediately

  • lume: Complete shell, supports REPL, auto-completion, syntax highlighting
  • lume-se: Lightweight script executor, quick startup, minimal dependencies.
# Start interactive shell
lume

# Or execute script
lumesh script.lm

Grammer highlight

  • Interactive highlight:already supported within box
  • editor highlight: tree-sitter

Benchmark Testing

highlight highlight

Due to fish being unable to complete one million tasks, we recorded its half-task time.

from v0.10.1 on, lume becomes about 2x faster than before!

from v0.11.0 on, lume takes less memery

⚑ Version History

Recent development has emphasized:

  • Decorator support for function enhancement
  • IFS (Internal Field Separator) mode control for compatibility
  • Enhanced module system with cross-linking between modules
  • Improved error reporting and debugging capabilities
  • CFM (Command First Mode) for daily commands (v0.8.0)
  • More friendly help info (v0.8.5)
  • Params completion from fish (v0.8.8)
  • Automatic completion detection logic optimization (v0.8.8)
  • Modular programming support (v0.10.0)
  • Built-in library dynamic lazy loading support (v0.10.1)
  • More flexible placeholder support (v0.10.2)
  • Improved CFM (v0.11.1)
  • Middleware-style decorator support (v0.11.5)
  • Loop iterator optimization (v0.11.5)
  • Local variable support (v0.11.6)
  • Support more data type: HashMap/BtreeSet
  • Support Consts:COLOR, STYLE, MATH
  • Optimize lib execution
  • Security enhance with knock_validator

Stargazers over time

start your travel with lumesh now

About

A shell with light-speed, bash replacer

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Rust 99.8%
  • Shell 0.2%