CmdBridge is a smart, cross-platform terminal engine that bridges the gap between natural language and native operating system commands, executing them reliably across Windows, Linux, and macOS.
Rather than being a simple command wrapper, CmdBridge is a cross-platform command abstraction engine in C featuring a semantic intermediate representation (Execution IR), capability negotiation, safety validation, adapter-based translation, script migration, structured explainability, regression corpus testing, multi-platform CI, and sanitiser-backed quality assurance.
At its core, CmdBridge translates intents (not just raw strings) through a strictly layered pipeline. Each stage has a single responsibility and is tested independently.
Input
│
▼
Execution IR (Semantic mapping)
│
▼
Safety (Risk assessment)
│
▼
Capability (Environment negotiation)
│
▼
Adapter (Platform translation)
│
▼
Execution (Native API or Shell)
- Execution IR: Maps strings to a semantic target.
- Layered Translation Pipeline: Prioritizes Native APIs over OS shells.
- Explain Before Execute: Interactive CLI breaks down the exact action, method, and consequences before taking action.
- Script Migration (
v0.6.0): Transpile legacy Bash scripts to PowerShell (or vice versa) reliably, with structured reporting for unsupported lines. - Cross-Platform: Supports Windows, Linux (POSIX), and macOS.
You can build CmdBridge from source via CMake.
git clone https://github.com/JosephJonathanFernandes/CmdBridge-Smart-Cross-OS-Terminal-Helper.git
cd CmdBridge-Smart-Cross-OS-Terminal-Helper
cmake -B build
cmake --build buildRun the executable to launch the interactive REPL:
./build/smart_terminal shellExample:
> find large pdf files
✓ I understood
Action:
find files
Target:
large pdf
Platform:
Windows
Method:
System Shell
Risk:
SAFE
Proceed? [y/n/d]: y
Need to move a team's build scripts from Linux to Windows?
cmdbridge migrate build.sh --target-os windows --target-shell powershell --out build.ps1Migration Summary
-----------------
Input lines: 16
Commands: 6
Translated: 6
Approximate: 0
Unsupported: 0
Preserved: 10
(CmdBridge preserves unsupported control-flow blocks and converts commands seamlessly).
cmdbridge explain "echo hello"
cmdbridge doctor
cmdbridge version| OS | Compilers | CI Status |
|---|---|---|
| Windows | MSVC, MinGW | ✅ Active |
| Linux | GCC, Clang | ✅ Active |
| macOS | Apple Clang | Roadmap |
The core architecture stabilized in v0.6.0. We follow a strict "architecture over features" philosophy.
- v0.7.0 (Upcoming): A stable Plugin API and Plugin Manager. Exposing
CB_Context,CB_Intent, andCB_Resulthandles for extensible development (e.g., Git, Docker, Kubernetes, AI modules).
We welcome pull requests! Ensure that all tests pass (ctest) before submitting.
Run tests using:
cd build
ctest --output-on-failureMIT License