- Rust 97.1%
- Shell 2.2%
- Nix 0.7%
| assets | ||
| docs | ||
| scripts | ||
| src | ||
| .envrc | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
selo-pona
selo pona (no caps, simple shell in toki pona) is an interactive shell and (planned) a tree-walking interpeter (planned) for a scripting language that is a (planned) superset of bash. That is, every bash script is also a selo pona script (planned), but selo pona adds some nicer syntax, on top. (planned)
Built in Rust, with minimal dependencies (for now, only libc, and leftpad)
Installation
You have to compile from source for now, some packages may be available when this project's out of pre-alpha someday and if someone's out there to maintain them.
Compiling from source
This project uses cargo (for now, will probably move to gcc-rs when it comes out). MSRV is 1.93. The only dependency you need is libc, it should work with either glibc or musl. File an issue if you find some discrepancy between them.
Clone the project, and run cargo build --release. Output is in target/release/selo-pona.
Usage
Like a regular shell. You start it, and you can type commands, or you can run scripts (planned).
Autocompletion
Autocompletion is a little unusual. When you hit Tab, you go into autocompletion mode. You can hit Tab (Shift-Tab) to cycle (backwards) through the list of entries. You can also type to fuzzy search through the entries, and as soon as there is only one entry left it runs it, and you can type the rest of your command. To avoid being taken by surprise and typing extra characters, subsequent keystrokes that correspond to the entry are ignored.
History
You can hit up/down to cycle through your previous commands. You can hit Ctrl-r to search through the entries (planned).
Unlike bash, history is not saved per-session but instead whenever a command is ran in interactive mode. You can use the builtin history to edit the file (currently broken (i think)).
Config
Feature List
Language
- Scanner
- Parser
- Interpreter
Shell
- read/eval/print loop (basic implementation)
- cli interface (basic implementation)
- autocompletion (basic implementation)
- history (basic implementation)
Commands handling
- Pipes (basic)
- File redirections (basic)
- Command substitions
- String, backslash-escapes (basic)
- Subshells
- builtins (for now there's only cd, and history)
- steal zoxide code
Design principles
I've created this because I like fish but, I find annoying that it's not compatible with regular shell scripts and their scripting language sucks (source: my personal taste (why are we assigning variables with set, c'mon )).
This is made to be minimalist, useful out-of-the box, and unintrusive. I want a shell that can do what I want to do as fast as possible with the least hassle and verbosity possible. You can leave your default bashrc and it'll work (planned).
This is not a Rust rewrite of bash. I used Rust because I like it and find it quite expressive, I have no guarantee about neither safety or performance.