shellfirm  by kaplanelad

Terminal guardrails for safer command execution

Created 4 years ago
920 stars

Top 38.9% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Shellfirm acts as terminal guardrails, intercepting dangerous shell commands before execution to protect both humans and AI agents. It prevents accidental or malicious damage by presenting context-aware challenges, covering a wide range of ecosystems.

How It Works

Shellfirm hooks into the shell to analyze commands against over 100 patterns across nine ecosystems (filesystem, Git, Kubernetes, Terraform, etc.). For risky commands, it prompts users with context-specific challenges, like math problems, requiring a correct answer to proceed. This adds a verification layer, enhanced by context-aware escalation that increases challenge difficulty in sensitive environments (SSH, root, production clusters).

Quick Start & Requirements

Installation options include npm (npm install -g @shellfirm/cli), Homebrew (brew tap kaplanelad/tap && brew install shellfirm), Cargo (cargo install shellfirm), or downloading a binary. After installation, run shellfirm init --install and restart your shell. Supported shells include Zsh, Bash, Fish, Nushell, PowerShell, Elvish, Xonsh, and Oils. Full documentation is available at shellfirm.dev.

Highlighted Details

  • Covers 100+ risk patterns across 9 ecosystems.
  • Supports 8 popular shells.
  • Features context-aware escalation for sensitive operations.
  • Offers actionable, safer alternative command suggestions.
  • Provides configurable severity levels and project policies (.shellfirm.yaml).
  • Includes an audit trail logging intercepted commands.
  • Ships with an MCP server for AI agent integration (e.g., Claude Code, Cursor).

Maintenance & Community

Contributions are welcomed via GitHub issues and pull requests. No specific community channels or maintainer details are provided in the README.

Licensing & Compatibility

Licensed under the permissive Apache-2.0 license, generally compatible with commercial use and closed-source projects.

Limitations & Caveats

The README does not explicitly detail known limitations, unsupported platforms, or alpha status.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
5 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.