npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

Iโ€™ve always been into building performant and accessible sites, but lately Iโ€™ve been taking it extremely seriously. So much so that Iโ€™ve been building a tool to help me optimize and monitor the sites that I build to make sure that Iโ€™m making an attempt to offer the best experience to those who visit them. If youโ€™re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, ๐Ÿ‘‹, Iโ€™m Ryan Hefnerย  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If youโ€™re interested in other things Iโ€™m working on, follow me on Twitter or check out the open source projects Iโ€™ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soonโ€“ish.

Open Software & Tools

This site wouldnโ€™t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you ๐Ÿ™

ยฉ 2025 โ€“ย Pkg Stats / Ryan Hefner

@zemerik/macbrew

v1.0.1

Published

๐Ÿš€ Advanced terminal emulator built in Rust with Python integration - A comprehensive command-line experience

Readme

Macbrew

A feature-rich terminal emulator built in Rust with Python integration, designed to provide a comprehensive command-line experience similar to macOS/Homebrew environments.

npm version License: MIT Rust Python

โœจ Features

๐ŸŽฏ Core Features

  • 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

๐Ÿ“ File Operations

  • 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

๐Ÿ”ง System Administration

  • 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

๐ŸŒ Networking

  • Network Tools: ping, curl, wget, ssh, scp, rsync
  • Network Analysis: netstat, lsof, nmap, tcpdump
  • Network Monitoring: iftop, nethogs, iotop
  • Remote Access: telnet, nc, socat

๐Ÿ” Security & Cryptography

  • Encryption: openssl, gpg, ssh-keygen
  • Hashing: md5sum, sha256sum, sha512sum
  • Encoding: base64, hexdump, xxd

๐Ÿ“ฆ Package Management

  • Homebrew: Full Homebrew package manager simulation
  • Python: pip, conda package management
  • Node.js: npm, yarn package management
  • Docker: Container management commands

๐Ÿณ DevOps & Cloud

  • Containerization: docker, kubectl, helm
  • Infrastructure: terraform, ansible, puppet, chef
  • Virtualization: vagrant, virtualbox, vmware, qemu, kvm
  • Cloud Tools: libvirt, virsh, virt-manager

๐Ÿ“ Text Editors

  • Editors: vim, nano, emacs
  • Pagers: less, more

๐Ÿ” Documentation

  • Manual Pages: man, info, apropos, whatis
  • Help System: Built-in help for all commands

๐Ÿ“ฆ Compression & Archives

  • Compression: gzip, gunzip, bzip2, bunzip2, xz, unxz
  • Archives: tar, zip, unzip, 7z, rar, unrar

๐Ÿ“Š Logging & Monitoring

  • System Logs: dmesg, syslog, rsyslog, logwatch
  • Journal: journalctl, logrotate

๐ŸŽฎ Terminal Multiplexing

  • Sessions: screen, tmux

๐Ÿš€ Quick Start

Prerequisites

[!CAUTION] โš ๏ธ Windows Users: If you encounter a 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-gnu

For the GNU toolchain, you may also need to install MinGW-w64.

Installation

Option 1: Using npx (Recommended)

npx macbrew

Option 2: Global Installation

npm install -g macbrew
macbrew

Option 3: From Source

git clone https://github.com/Zemerik/Macbrew.git
cd Macbrew
cargo build --release
cargo run

๐Ÿ“– Usage Examples

Basic Commands

# File operations
ls -la
cd /path/to/directory
pwd
cat filename.txt
echo "Hello, World!"

# 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

Advanced Features

# 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

System Administration

# 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

Networking

# 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

Security

# 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 4096

โš™๏ธ Configuration

The terminal emulator uses a configuration file located at:

  • Linux/macOS: ~/.config/terminal-emulator/config.json
  • Windows: %APPDATA%\terminal-emulator\config.json

Configuration Options

{
  "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"
  }
}

๐Ÿ”Œ Plugin System

The terminal emulator supports a plugin system for extending functionality:

Creating a Plugin

  1. Create a plugin directory in ~/.config/terminal-emulator/plugins/
  2. Add a plugin.toml manifest file
  3. Include your script files

Example Plugin

# 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()

๐ŸŽจ Customization

Aliases

# Set aliases
alias ll='ls -la'
alias g='git'
alias p='python'

# List aliases
alias

# Remove aliases
unalias ll

Environment Variables

# Set environment variables
export EDITOR=vim
export PATH=$PATH:/custom/path

# Show environment
env

# Unset variables
unset VARIABLE_NAME

๐Ÿ”ง Development

Project Structure

macbrew/
โ”œโ”€โ”€ 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

Adding New Commands

  1. Add the command to the execute_command match statement in main.rs
  2. Implement the command function
  3. Add help documentation

Building for Distribution

# Build optimized release
cargo build --release

# Create installation package
cargo install --path .

# Publish to npm
npm publish

๐Ÿ› Troubleshooting

Common Issues

  1. Python not found: Ensure Python 3.x is installed and in PATH
  2. Permission denied: Check file permissions and ownership
  3. Plugin not loading: Verify plugin.toml syntax and file paths
  4. Command not found: Check if the command is available in your system

Debug Mode

Run with debug output:

RUST_LOG=debug cargo run

โ— Troubleshooting Command Not Found or Execution Errors

If 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.

What does this mean?

  • 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.

How to Fix

  1. Check for typos: Make sure you typed the command correctly.
  2. 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.
  3. Check your PATH: Make sure the directory containing the command is in your system's PATH environment variable.
  4. Try in your system terminal: Open Command Prompt, PowerShell, or Terminal and try the command there. If it fails, it's a system issue.
  5. Permissions: Make sure you have permission to run the command.
  6. Still not working?
    • If the command works in your system terminal but not in Macbrew, please open an issue with details.

Example

If you type ls on Windows and see this error, try using dir instead, or install a Unix-like environment.


๐Ÿ“ฆ NPM Package

Rusty Shell is available as an npm package for easy installation and distribution.

Package Information

  • Package Name: macbrew
  • Registry: npmjs.com
  • Install Command: npm install -g macbrew
  • NPX Command: npx macbrew

Package Features

  • โœ… Automatic Rust binary compilation
  • โœ… Cross-platform support (Windows, macOS, Linux)
  • โœ… Automatic dependency checking
  • โœ… Configuration setup
  • โœ… Example plugins included
  • โœ… Clean uninstallation

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

๐Ÿ“ž Support

  • Issues: Report bugs and feature requests on GitHub
  • Documentation: Check the inline documentation and examples
  • Community: Join our community discussions

๐ŸŽฏ Roadmap

  • [ ] 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