Skip to content

5afagy/BashBard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: Apache-2.0 LLM: Google Gemini Python 3.12+ Wiki Languages Visitors

🧠 BashBard

Demo_v1.webm

AI-Powered Shell Intelligence & Safety & Learning Layer

Think in any language. Learn Linux deeply. Execute safely. Never regret a command.

⚡Overview

BashBard is an AI-augmented terminal assistant that embeds Google Gemini intelligence directly into your Linux shell via a true PTY environment.

It transforms ambiguous intent into optimized, vetted bash commands, repairs failed executions in real time, and enforces proactive safety, all without leaving your terminal.

Designed for:

  • Beginners learning Linux → Understand why commands work, not just memorize
  • Developers writing scripts under pressure
  • Sysadmins managing critical infrastructure
  • Security engineers auditing and responding at speed
  • DevOps teams automating with precision
  • Power users who demand fluency and control

BashBard delivers smarter automation, zero-trust execution, context-aware correction, and interactive learning, all in your terminal.


💡Why BashBard Exists: Safety + Education

The terminal is powerful and dangerous.
One typo = data loss. One bad curl | bash = compromise.

BashBard fixes this and teaches you along the way.

Pain Point BashBard Solution
"What was that command again?" /e find config files modified todayfind /etc -type f -mtime -1 + explains each part
"I don’t understand the output" AI breaks down results, flags risks, suggests next steps
"I typed gti instead of git" Auto-corrects + teaches the difference
"I ran rm -rf / by mistake" BLOCKS + explains: “This deletes root. Use /tmp instead.”
"I’m new to Linux" Guides you step-by-step, builds muscle memory safely

“Your terminal, now with judgment and a teacher.”

Multilingual Input Support

BashBard understands natural language in any language including Arabic, English, French, Spanish, and more.

⚙️ Quick Start (30 Seconds)

BashBard ships with an automated installer that sets up everything for you.

curl -sSL https://github.com/5afagy/BashBard/raw/refs/heads/main/install.sh | bash && BashBard

One command. Zero hassle.
Installs, configures, and launches BashBard even on fresh systems.

What the installer does:

  • Creates a dedicated virtual environment
  • Installs dependencies from requirements.txt
  • Prompts for your Google Gemini API key (on first run)
  • Auto-generates .env at ~/.local/share/bashbard/.env
  • Installs launcher to ~/.local/bin/BashBard

Example first-run output:

Configuring BashBard environment...
Installation complete.
Enter your Google Gemini API key: ??
Saved API key to /root/.local/share/bashbard/.env

Usage Examples

image

BashBard understands your intent, it’s not just syntax-aware, it’s context-aware.

Core Features

Feature How to Use Live Example
Natural Language → Command /e <request>
/e list all .log files older than 7 days
→ find /var/log -name "*.log" -mtime +7
Auto-Repair (Interactive) /repair on
gti status
AI: Did you mean git status?
[r]un / [e]dit / [c]ancel
Auto-Repair (Silent) /repair auto
lsf
→ ls -F (runs automatically)
Disable Auto-Repair /repair off No AI fixes, default mode
Dry-Run Mode /dry on
/e delete temp files
Would execute: rm -rf /tmp/*
Dry-Run Status /dry status DRY-RUN: ENABLED
Quick Aliases /alias basic
ll → ls -alF
la → ls -A
l → ls -CF
Replan on Failure Choose [p]lan after error
docker run -p 80:80 app
AI Plan:
[1] docker pull app
[2] docker run -p 8080:80 app
Universal Safety Gate All commands (even typed)
rm -rf /home
DANGEROUS: Targets root-owned path
Why risky: irreversible data loss
Proceed? [y/N]
Help & Exit /help or /quit Shows full command reference

Pro Workflow:

  1. Start with /repair on + /dry on → explore safely
  2. Trust the flow? → /repair auto for speed
  3. Need full control? → /dry off + manual approval

⚙️ Advanced Features

  • Context-aware auto-repair with re-planning (/repair auto)
  • Intelligent output filtering for clean AI feedback
  • Quick alias injection (/alias basic)
  • Customizable dry-run, quiet, and auto-repair modes
  • Built-in danger heuristics to prevent destructive actions

💡 Pro Tip: Run /repair on to let BashBard automatically fix simple typos like gtigit.

Technology Overview

BashBard is engineered with a modular architecture built on modern AI and system libraries.

Stack:

  • Python 3.12+
  • Google Gemini (default) via LangChain / LangGraph
  • PTY shell system (using pty, termios, and fcntl)

Core engine: terminal.py runs the real-time AI terminal. CLI wrapper: cli.py decides mode (interactive, legacy, one-shot). LLM logic: llm.py, nodes.py, and safety.py handle intelligence and protection.

Future Roadmap

Feature Description
Multi-model support Gemini + OpenAI + local models (cost/latency balance)
Session memory Retain context across commands, privacy-first
Offline mode Run fully on-prem or air-gapped
Plugin API Extend with Docker, K8s, AWS, pentest modules
Safe sandboxes Test risky commands in isolation
Pentester mode Evidence capture, checklists, exploit guidance
History intelligence Auto-refactor repeated tasks
Explainability Show prompt + reasoning for every suggestion
Team sync (opt-in) Share policies, not data

All telemetry and cloud features are opt-in only.

🤝 How You Can Help (Open to Contributors)

BashBard is a community project, contributions are welcome. Ways to contribute:

  • ⭐ Star & fork the repo
  • 🐛 Open issues for bugs or improvement ideas
  • ✍️ Submit pull requests (features, docs, tests)
  • 💬 Join Discussions to propose roadmap items or plugins
  • 🔒 Help with security reviews and safe execution patterns

Contribution guide: Fork → branch → PR → review. Keep changes focused and well-documented.

🌟 Contributors

👨‍💻 Authors & License

Authors: Khafagy & Elnaggar
Affiliated with: Cyber Force LLC
License: Apache 2.0

Built with ❤️ in Egypt — open to collaborators worldwide.


BashBard: Intelligence Meets the Command Line.

View on GitHubWikiDiscussions

Star. Fork. Build. Secure.

curl -sSL https://github.com/5afagy/BashBard/raw/main/install.sh -o install.sh && bash install.sh && BashBard

Updated: November 11, 2025 04:15 PM EET • Cairo, Egypt

About

An AI-powered Linux shell tutor and command storyteller

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •