A clean, modular, and demo-ready CLI-based shell application written in Go. It supports standard command execution along with enhanced usability features like pipes, command history, custom shortcuts, and an embedded AI assistant powered by the Groq API.
- Interactive Shell Loop: Custom Unicode-styled prompt showing current directory.
- Command Execution: Parses space-delimited inputs and executes system binaries (
ls,pwd) natively. - Pipe Support: Connects standard I/O streams seamlessly between sequential commands (e.g.,
ls | grep go). - ⚡ Execution Timing: Automatic command execution timing display (green for fast, yellow for medium, red for slow).
- ✨ Formatted History: View command history with timestamps in a beautiful table format.
- Built-in Commands:
cd <dir>: Change the current working directory.history: View previously executed commands with formatted table display.help [cmd]: Show help for a specific command or all commands.search_history: Fuzzy search through command history.dashboard: Show a beautiful dashboard with system info, git status, and recent commands.clear: Clear the terminal screen.exit: Terminate the shell.
- History Persistence: Automatically saves and loads your command history to/from
~/.myshell_history. - Smart Correction: Levenshtein-distance typo detection for unknown commands (e.g.,
gti->git). - 🎨 Beautiful UI Elements:
- Colored output with semantic icons (✓, ✗, ⚠, ℹ)
- Status messages with context-aware colors
- Helpful hints displayed on startup
- Command Autocomplete: Get suggestions as you type commands.
- Groq AI Assistant: Built-in natural language to CLI translations using LLaMA models.
- The
-execflag: Append-execto your natural language prompt and the AI will auto-generate and immediately execute the suggested command in your shell loop.
- The
- Custom Scripts: Shortcuts like
open googleormyipdirectly integrated into the parser.
The source code is organized clearly for a highly modular feature addition experience:
main.go: Entry point, input loop, and core routing logic.parser.go: Command parsing split logic mapping commands sequentially or breaking piped chunks.executor.go: Subprocess control and standard program loading with timing.builtins.go: Native Go overrides simulating standard core utilities.pipeline.go: I/O orchestrator for executing sequential programs safely with timing.suggestions.go: Autocomplete and correction logic implementation.custom.go: Custom workflow mappings.ai.go: Integration with Groq API.- NEW
ui.go: Terminal styling, colors, and formatted output functions. - NEW
history_search.go: Fuzzy search and interactive history navigation. - NEW
autocomplete.go: Command and file completion suggestions. - NEW
dashboard.go: Interactive dashboard showing system info and git status. - NEW
timing.go: Command execution timing and performance tracking.
- Go 1.21+ installed on your system.
- (Optional) A valid Groq API Key to utilize the AI Assistant feature.
-
Clone or navigate to the project directory:
cd os-mpr -
Compile the binary:
go build -o myshell
-
Add your Groq API key:
export GROQ_API_KEY="your_api_key_here"
-
Launch the shell:
./myshell
You can easily translate plain English text directly into Linux commands inside the shell. Try opening ./myshell and running:
myshell> ai check what process is taking the highest memory -execThe AI will output and run the pipeline securely:
❖ AI Assistant [command] (100% confidence)
Show which process is taking the most memory. Sorted by memory usage in descending order and show the top result.
Executing: ps aux | sort -rn -k 4 | head -1
...Commands automatically display execution time after completion:
myshell> ls
[0.01s] ← Green for fast commandsGet a formatted view of your command history:
myshell> history
Command History (18)
────────────────────────────────────────
1 [2026-04-01 20:58:37] help
2 [2026-04-01 20:58:56] pwd
3 [2026-04-01 20:58:56] history
────────────────────────────────────────
Total commands: 18Get help for any command:
myshell> help cd
Help: Change directory: cd <path>
myshell> help
Available Commands
────────────────────────────────────────
cd <path> Change directory
exit Exit the shell
history Show command history
...View a beautiful dashboard with system info, recent commands, and git status:
myshell> dashboard
╔══════════════════════════════════════╗
║ 🚀 MYSHELL Dashboard ║
╚══════════════════════════════════════╝
📊 System Information
──────────────────────
Hostname: my-machine
User: keerthan
OS: linux
Working Directory: ~/os-mpr
📜 Recent Commands (Last 5)
──────────────────────
1. help
2. pwd
3. history
📦 Git Status
──────────────────────
Branch: main
Status: 2 changesFuzzy search through your command history:
myshell> search_historyShows matching commands from your history for quick re-execution.
Commands provide visual feedback:
✓ Success message ← Green checkmark
✗ Error message ← Red X
⚠ Warning message ← Yellow exclamation
ℹ Info message ← Blue information icon
Helpful hints are displayed at startup:
💡 Tip: Type 'help' for commands, 'Ctrl+R' for history search, or 'dashboard' for overview
All output uses semantic colors:
- Green for success and important paths
- Yellow for warnings and suggestions
- Blue for information
- Cyan for headers and titles
- Red for errors
- Gray for secondary information