Welcome to ShellLite! This chapter covers everything you need to get up and running, from installation to writing your first script.
Current Version: 0.05.0 (Performance Update)
This release introduces native compilation via LLVM, transforming ShellLite into a compiled language alongside its interpreted mode.
The easiest way to install ShellLite:
pip install shell-liteDownload the latest shl.exe from the Releases page.
- Download & Run: Locate the compiled
shl.exefile and run it. - Global Installation: The first time you run it, if it detects it isn't installed globally (system-wide), it will ask:
"Would you like to install it so 'shl' works everywhere? (y/n)"
- Approve: Type
yand press Enter. This adds ShellLite to your system PATH. - Verify: Close your current terminal and open a new one. Type
shl. You should see the ShellLite interactive prompt.
Tip
If shl doesn't work after installation, try restarting your computer or checking your System Environment Variables manually.
If you are developing the language itself or prefer running from source:
- Clone the Repository:
git clone https://github.com/Shrey-N/ShellLite.git cd ShellLite - Install in Development Mode:
pip install -e . - Install Optional Dependencies (for LLVM compilation):
pip install llvmlite
- Run with Python:
# Enter Interactive Mode python -m shell_lite.main # Run a Script python -m shell_lite.main myscript.shl
For the best experience, install the official ShellLite VS Code extension:
The extension provides syntax highlighting and code snippets for ShellLite.
The official IDE for ShellLite with integrated debugging and project management:
| Command | Description |
|---|---|
shl <file.shl> |
Run a ShellLite script |
shl |
Start the interactive REPL |
shl compile <file> |
Compile to native code (LLVM) |
shl compile <file> --target js |
Compile to JavaScript |
shl compile <file> --target python |
Compile to Python |
shl init |
Initialize a new project |
shl install |
Install project dependencies |
shl get <user/repo> |
Install a package from GitHub |
shl fmt <file> |
Format a script |
shl check <file> |
Lint a file (JSON output) |
shl help |
Show help message |
ShellLite comes with a "Read-Eval-Print Loop" (REPL). This lets you type commands and see results instantly.
Just type shl in your terminal to start it.
ShellLite REPL - English Syntax
========================================
Version: v0.05 | Made by Shrey Naithani
Commands: Type 'exit' to quit, 'help' for examples.
>>> say "Hello"
Hello
>>> 5 + 5
10
Type exit to leave the REPL.
To run a real program, save your code in a text file with the .shl extension (e.g., script.shl).
Then run it from the command line:
shl script.shlshl initThis creates a shell-lite.toml configuration file.
shl installInstalls all dependencies defined in shell-lite.toml.
shl get user/repoInstalls a package directly from GitHub.
In your code, you often want to leave notes for yourself. These are called comments.
ShellLite uses the # symbol for single-line comments and /* */ for multi-line comments.
# This is a single-line comment. The computer ignores this.
say "Hi" # You can put comments at the end of lines too.
/*
This is a multi-line comment.
It can span multiple lines.
*/ShellLite v0.05.0 introduces native compilation via LLVM:
# Compile to native code (default)
shl compile script.shl
# Compile to JavaScript
shl compile script.shl --target js
# Compile to Python
shl compile script.shl --target python