TruShell

A general-purpose shell written in Rust. Like Bash and Zsh, but with a modern expression language and task management features planned.

Status: Alpha (actively developing)


Quick start

Install from source

$ git clone https://github.com/TruFoundation/TruShell.git
$ cd TruShell
$ cargo build --release
$ ./target/release/trushell

Or run directly for development:

$ cargo run

Notes:


What is TruShell?

TruShell is a modern, extensible shell that:

Think of TruShell as an approachable shell with cleaner syntax and an AST-based execution model.


Highlights / Features


Examples

Interactive use:

trushell> let name = "Alice"
trushell> let age = 30
trushell> let next_year = $age + 1
trushell> echo "Hello, $name! Next year you'll be $next_year."

Pipes and file operations:

trushell> cat server.log | grep "ERROR" > errors.txt
trushell> echo "Done" &> status.log

Code blocks and grouping:

trushell> let sum = { let a = 5; let b = 10; $a + $b }

WASM plugin host

TruShell can load sandboxed WASM plugins. Plugins must include a JSON manifest (placed alongside the WASM module) that declares the plugin’s name, version, API version, and the capabilities it requires.

Example manifest:

{
  "name": "log-echo",
  "version": "0.1.0",
  "api_version": "1.0",
  "capabilities": ["logging"]
}

Supported capability examples:

Plugin examples live under examples/plugins/ in the repository. A plugin that imports host functions it has not declared will fail to instantiate.


Syntax overview

Operator precedence (lowest → highest): comparison, addition/subtraction, multiplication/division, primary (literals/identifiers/parentheses).


Architecture

The interpreter follows a familiar pipeline:

  1. Lexer: tokenizes input
  2. Parser: builds an AST
  3. Executor: runs the AST or falls back to system command execution
  4. Output / side effects

Project layout (top-level):

TruShell/
├── src/
│   ├── main.rs         - REPL and command execution
│   └── parser.rs       - Lexer and parser
├── Cargo.toml          - Project manifest
├── Cargo.lock          - Dependency lock file
└── README.md           - This file

Design goals:


Development

Requirements:

Build & run:

# debug
cargo build
# release
cargo build --release
# run tests
cargo test
# enable backtraces while running
RUST_BACKTRACE=1 cargo run

Recommended workflow:


Contributing

We welcome contributions. Suggested flow:

  1. Fork the repository
  2. Create a branch: git checkout -b feature/your-feature
  3. Implement changes and add tests
  4. Run cargo fmt and cargo clippy
  5. Commit with a clear message and push your branch
  6. Open a Pull Request describing the change and motivation

Please open an Issue to discuss larger design changes before implementing them.


Roadmap

Planned work:


Support

Found a bug or have a question?


License

TruShell is released under the terms found in LICENSE.md.


Maintainers: TruFoundation

Made with care — contributions and feedback welcome.