A feature-rich terminal emulator built in Rust with Python integration, designed to provide a comprehensive command-line experience similar to macOS/Homebrew environments.
- Real Python Execution: Execute Python scripts and interactive Python sessions
- Command History: Persistent command history with search and navigation
- Autocomplete: Intelligent command and file path completion
- Job Control: Background process management with
jobs,fg,bg,kill - Plugin System: Extensible plugin architecture for custom commands
- Color Support: Rich colored output and syntax highlighting
- Configuration: Customizable settings and aliases
- Basic Commands:
ls,cd,pwd,cat,echo,mkdir,rm,cp,mv - Advanced File Operations:
find,grep,chmod,chown,chgrp - Text Processing:
head,tail,sort,uniq,cut,paste,tr,sed,awk - File Analysis:
wc,file,stat,du,df
- Process Management:
ps,top,htop,kill,nohup - System Services:
systemctl,service,init - User Management:
useradd,userdel,groupadd,groupdel,passwd - Disk Management:
fdisk,parted,mkfs,fsck,mount,umount - Scheduling:
cron,at,batch,crontab
- Network Tools:
ping,curl,wget,ssh,scp,rsync - Network Analysis:
netstat,lsof,nmap,tcpdump - Network Monitoring:
iftop,nethogs,iotop - Remote Access:
telnet,nc,socat
- Encryption:
openssl,gpg,ssh-keygen - Hashing:
md5sum,sha256sum,sha512sum - Encoding:
base64,hexdump,xxd
- Homebrew: Full Homebrew package manager simulation
- Python:
pip,condapackage management - Node.js:
npm,yarnpackage management - Docker: Container management commands
- Containerization:
docker,kubectl,helm - Infrastructure:
terraform,ansible,puppet,chef - Virtualization:
vagrant,virtualbox,vmware,qemu,kvm - Cloud Tools:
libvirt,virsh,virt-manager
- Editors:
vim,nano,emacs - Pagers:
less,more
- Manual Pages:
man,info,apropos,whatis - Help System: Built-in help for all commands
- Compression:
gzip,gunzip,bzip2,bunzip2,xz,unxz - Archives:
tar,zip,unzip,7z,rar,unrar
- System Logs:
dmesg,syslog,rsyslog,logwatch - Journal:
journalctl,logrotate
- Sessions:
screen,tmux
- Rust (1.70 or higher) - Install Rust
- Python 3.8+ - Install Python
- Node.js 14+ - Install Node.js
Caution
link.exe not found error when building, you need to install Visual Studio Build Tools with the "Desktop development with C++" workload. Alternatively, you can switch to the GNU toolchain by running:
rustup default stable-x86_64-pc-windows-gnuFor the GNU toolchain, you may also need to install MinGW-w64.
npx macbrewnpm install -g macbrew
macbrewgit clone https://github.com/Zemerik/Macbrew.git
cd Macbrew
cargo build --release
cargo run# File operations
ls -la
cd /path/to/directory
pwd
cat filename.txt
echo "Hello, World!"
# History export (with optional status flags)
history export history.txt
# History without status indicators
history --no-status
# Python execution
python -c "print('Hello from Python!')"
python script.py
# Homebrew package management
brew install package_name
brew search query
brew update
brew upgrade
# Plugin commands (included by default)
hello World
weather Tokyo# Job control
long_running_command &
jobs
fg 1
bg 1
kill 1
# Plugin management
plugins list
install-plugin example
uninstall-plugin example
# Text processing
echo "hello world" | tr '[:lower:]' '[:upper:]'
cat file.txt | sort | uniq
grep "pattern" file.txt# Process management
ps aux
top
kill -9 process_id
# User management
useradd username
passwd username
userdel username
# System services
systemctl status service_name
systemctl start service_name
systemctl stop service_name# Network diagnostics
ping google.com
curl https://api.github.com
ssh user@hostname
scp file.txt user@hostname:/path/
# Network analysis
netstat -tuln
lsof -i :8080
nmap localhost# Hashing
echo "password" | md5sum
echo "password" | sha256sum
# Encryption
openssl enc -aes-256-cbc -in file.txt -out file.enc
gpg --encrypt file.txt
# SSH key management
ssh-keygen -t rsa -b 4096The terminal emulator uses a configuration file located at:
- Linux/macOS:
~/.config/terminal-emulator/config.json - Windows:
%APPDATA%\terminal-emulator\config.json
{
"prompt_style": {
"show_hostname": true,
"show_username": true,
"show_path": true,
"show_git_branch": false,
"format": "{username}@{hostname}:{path} $ "
},
"history_size": 1000,
"auto_completion": true,
"syntax_highlighting": true,
"colors": {
"prompt": "\u001b[32m",
"command": "\u001b[36m",
"output": "\u001b[0m",
"error": "\u001b[31m",
"success": "\u001b[32m",
"warning": "\u001b[33m"
}
}The terminal emulator supports a plugin system for extending functionality:
- Create a plugin directory in
~/.config/terminal-emulator/plugins/ - Add a
plugin.tomlmanifest file - Include your script files
# plugin.toml
name = "my-plugin"
version = "1.0.0"
description = "My custom plugin"
author = "Your Name"
commands = [
{ name = "hello", description = "Say hello", usage = "hello [name]", script = "hello.py", language = "python", enabled = true }
]# hello.py
#!/usr/bin/env python3
import sys
def main():
if len(sys.argv) > 1:
name = sys.argv[1]
print(f"Hello, {name}!")
else:
print("Hello, World!")
if __name__ == "__main__":
main()# Set aliases
alias ll='ls -la'
alias g='git'
alias p='python'
# List aliases
alias
# Remove aliases
unalias ll# Set environment variables
export EDITOR=vim
export PATH=$PATH:/custom/path
# Show environment
env
# Unset variables
unset VARIABLE_NAMEmacbrew/
├── src/ # TypeScript source code
│ ├── bin/ # Binary launcher
│ │ └── macbrew.ts # Main binary launcher
│ ├── scripts/ # Installation scripts
│ │ ├── install.ts # Build and setup script
│ │ ├── postinstall.ts # Post-installation setup
│ │ └── uninstall.ts # Cleanup script
│ ├── types/ # TypeScript type definitions
│ │ ├── config.ts # Configuration types
│ │ ├── plugin.ts # Plugin types
│ │ └── terminal.ts # Terminal types
│ ├── lib/ # Core library modules
│ │ ├── macbrew.ts # Main Macbrew class
│ │ ├── terminal.ts # Terminal functionality
│ │ ├── plugin-manager.ts # Plugin system
│ │ └── config-manager.ts # Configuration management
│ └── index.ts # Main entry point
├── dist/ # Compiled JavaScript output
├── bin/ # JavaScript wrappers
│ └── macbrew.js # Binary launcher wrapper
├── scripts/ # JavaScript wrappers
│ ├── install.js # Install script wrapper
│ ├── postinstall.js # Postinstall script wrapper
│ └── uninstall.js # Uninstall script wrapper
├── package.json # NPM package configuration
├── Cargo.toml # Rust dependencies
└── README.md # This file
- Add the command to the
execute_commandmatch statement inmain.rs - Implement the command function
- Add help documentation
# Build optimized release
cargo build --release
# Create installation package
cargo install --path .
# Publish to npm
npm publish- Python not found: Ensure Python 3.x is installed and in PATH
- Permission denied: Check file permissions and ownership
- Plugin not loading: Verify plugin.toml syntax and file paths
- Command not found: Check if the command is available in your system
Run with debug output:
RUST_LOG=debug cargo runIf you see an error like:
Error: Failed to execute external command 'your-command'.
This usually means the command is not installed, not in your PATH, or not available on your system.
- The command you tried to run is not available on your device, or your system cannot find it.
- This is not a bug in Macbrew. Macbrew passes commands to your operating system, so if the OS can't find or run the command, neither can Macbrew.
- Check for typos: Make sure you typed the command correctly.
- Is the command installed?
- On Windows, some commands (like
ls,grep,awk, etc.) are not available by default. You may need to install tools like Git Bash, Cygwin, or Windows Subsystem for Linux (WSL). - On macOS/Linux, use your package manager (e.g.,
brew install,apt install,yum install) to install missing commands.
- On Windows, some commands (like
- Check your PATH: Make sure the directory containing the command is in your system's PATH environment variable.
- Try in your system terminal: Open Command Prompt, PowerShell, or Terminal and try the command there. If it fails, it's a system issue.
- Permissions: Make sure you have permission to run the command.
- Still not working?
- If the command works in your system terminal but not in Macbrew, please open an issue with details.
If you type ls on Windows and see this error, try using dir instead, or install a Unix-like environment.
Rusty Shell is available as an npm package for easy installation and distribution.
- Package Name:
macbrew - Registry: npmjs.com
- Install Command:
npm install -g macbrew - NPX Command:
npx macbrew
- ✅ Automatic Rust binary compilation
- ✅ Cross-platform support (Windows, macOS, Linux)
- ✅ Automatic dependency checking
- ✅ Configuration setup
- ✅ Example plugins included
- ✅ Clean uninstallation
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
- Issues: Report bugs and feature requests on GitHub
- Documentation: Check the inline documentation and examples
- Community: Join our community discussions
- GUI mode with TUI interface
- Remote terminal support
- Advanced scripting capabilities
- Package manager integration
- Cloud provider integrations
- Machine learning command suggestions
- Voice command support
- Advanced debugging tools
Built with ❤️ using Rust, Python, and TypeScript
