Installation

Requirements

legionhjyu runs on Python 3.10 or later. If you don't have it:

bash
python3 --version

If that prints 3.10 or higher, you're set.

Install from source

Clone the repo and run the installer:

bash
git clone https://github.com/legionhjyu/legionhjyu.git
cd legionhjyu
python3 install.py

The installer copies the stdlib to ~/.legion/stdlib/, writes a launcher at ~/.local/bin/legion, and creates ~/.legion/meta.json with version info.

After that, add ~/.local/bin to your PATH if it isn't already:

bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Then check it works:

bash
legion version

You should see:

lhj
legionhjyu 1.0.0
Python 3.x.x

Install via the pre-built executable

If you don't want to deal with Python, grab the standalone binary from the Download page. These are self-contained executables with Python bundled inside — no dependencies required.

PlatformFile
Linux (x64)legion-linux-x64
macOS (x64)legion-macos-x64
Windowslegion-windows.exe

Download the right binary for your platform, make it executable (Linux/macOS), and put it somewhere on your PATH:

bash
## Linux / macOS
chmod +x legion-linux-x64
mv legion-linux-x64 ~/.local/bin/legion

On Windows, rename the .exe to legion.exe and move it to a directory in your system PATH.

Verify the install

Write a test file:

lhj
## test.lhj
echo "legion works!"

Run it:

bash
legion run test.lhj

Output:

lhj
legion works!

Directory layout

After installation, legionhjyu creates:

lhj
~/.legion/
  stdlib/       -- built-in .lhj modules (io, collections, random, json_mod)
  packages/     -- installed packages (legion pkg install puts them here)
  meta.json     -- version and install info

Updating

Pull the latest source and re-run the installer:

bash
cd legionhjyu
git pull
python3 install.py

Or download the latest binary from the Download page.

Uninstalling

bash
rm ~/.local/bin/legion
rm -rf ~/.legion

That removes the CLI and all installed packages.