Inspiration

Terminal users often switch between browsers or docs just to remember exact shell flags, cmdlets, or system commands—especially when switching between PowerShell, CMD, Bash, or Roman Urdu / English prompts. Hybrid CLI AI turns natural language requests directly into terminal commands right inside the command line.

What it does

Hybrid CLI AI (ai) takes natural language prompts, detects or adapts to the target shell environment (powershell, cmd, gitbash, macos, linux), generates a raw terminal command, asks for confirmation before running, and keeps a history log (ai --history). It supports cloud inference via Groq (--cloud) as well as a local Ollama path (generate_command_local).

How we built it

  • Built a Python CLI (ai) structured around cli.py, ai_engine.py, and utils.py.
  • Configured OS-aware system prompts so generated commands match the active shell environment.
  • Integrated Groq Cloud (qwen/qwen3.8-27b) via --cloud alongside local Ollama support (generate_command_local) and command history tracking (ai --history).
  • Added output sanitization (clean_markdown) to strip markdown fences and explanatory filler so raw commands are returned cleanly.

Challenges we ran into

  • Environment & Configuration Bugs: Tracked down an incorrect os.getenv(...) lookup in cli.py and updated a deprecated Groq model ID (llama-3.3-70b-versatile) to qwen/qwen3.8-27b.
  • Shell Execution Differences: Handling shell-specific commands (such as PowerShell cmdlets) cleanly across terminal environments without executing unwanted text.

Accomplishments that we're proud of

  • Got end-to-end natural-language-to-command generation working reliably over Groq Cloud (--cloud) and verified command history logging (ai --history).
  • Built defensive output filtering (clean_markdown) so explanations or markdown blocks don't leak into command execution.

What we learned

  • Strict system prompting plus post-processing is essential when turning LLM responses into executable CLI commands.
  • Keeping clear error messages and fallback options saves time during debugging and demos.

What's next for Hybrid CLI AI

  • Make shell execution handling even smoother across PowerShell and CMD environments.
  • Refine prompt handling for mixed-language (Roman Urdu / English) CLI queries and add even cleaner tests and documentation.

Built With

Share this project:

Updates

Submission history