2 releases (1 stable)
new 1.0.0 | Apr 10, 2025 |
---|---|
0.1.5-alpha | Apr 10, 2025 |
#373 in Command line utilities
173 downloads per month
15KB
336 lines
Brainfuck CLI
A simple and educational Brainfuck interpreter written in Rust.
Supports both file execution and an interactive REPL mode.
✨ Features
- Fully functional Brainfuck interpreter
- REPL mode with built-in commands
- File execution via CLI
- Clean and minimal interface
- Written 100% in Rust 🦀
🚀 Installation
With Cargo:
cargo install brainfuck-cli
This will install the brainfuck
command globally.
🧰 Manual Installation (No Cargo)
If you don't have Rust installed or prefer not to use cargo
, you can download a precompiled binary from the Releases page.
Linux/macOS:
wget https://github.com/pedroafabri/brainfuck-cli/releases/download/<version>/brainfuck
chmod +x brainfuck
sudo mv brainfuck /usr/local/bin/
Remember to change the version accordingly.
Windows:
- Download
brainfuck.exe
from the Releases page. - Move it to a folder in your
PATH
(e.g.C:\Windows\System32
orC:\Program Files\brainfuck
). - Optionally, add the folder to your
PATH
environment variable if not already included.
Once installed, you can run brainfuck
from your terminal or command prompt.
wget https://github.com/pedroafabri/brainfuck-cli/releases/download/vX.Y.Z/brainfuck
chmod +x brainfuck
sudo mv brainfuck /usr/local/bin/
---
## 🧠 Usage
### Execute a Brainfuck file:
```bash
brainfuck path/to/program.bf
Start REPL mode:
brainfuck
💬 REPL Commands
Once inside the REPL, the following commands are available:
.help -> Display this message
.reset -> Reset the current Brainfuck interpreter to its initial state
.exit -> Exit this REPL session
You can also type and run Brainfuck code interactively:
+++++++[>++++++++<-]>.
📄 Example
$ brainfuck hello.bf
Hello, World!
$ brainfuck
Brainfuck Interpreter - v0.1.0
Type '.help' for available commands.
> +++++++[>++++++++<-]>.
A
🛠️ Project Status
This project is a personal learning project and a tribute to minimalism.
Contributions and suggestions are welcome!
📜 License
MIT
Dependencies
~210–640KB
~15K SLoC