Skip to content

sbay-dev/sarmad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

╔══════════════════════════════════════════════╗
║                                              ║
║   ⟩⟨  S A R M A D  ⟩⟨                    ║
║   Self-Learning CLI Orchestrator            ║
║   GitHub Copilot Engine · RAG · Multi-Model ║
║                                  v1.0.0  ║
╚══════════════════════════════════════════════╝

The first CLI orchestrator that learns from every command it runs.
Powered by GitHub Copilot CLI · Built for power users who live in the terminal.

License: MIT Node.js Copilot CLI


What is Sarmad?

Sarmad (⟩⟨) is a self-learning CLI orchestrator that sits on top of GitHub Copilot CLI and amplifies it into a fully autonomous multi-model command pipeline. It learns your codebase, organizes terminal operations with RAG context injection, chains multiple Copilot invocations intelligently, and delivers a premium branded experience — all from a single command.

$ sarmad
PS C:\Users\ssl55> ⟩⟨  build a REST API with auth and tests, deploy to Docker

[⟩⟨] ⟩▸────────────────────⟨ invoking copilot (claude-sonnet-4.6) · 3s ↑

  ╔══ Analysis ════════════════════════════════════╗
  ║  RAG context: 4 relevant files found          ║
  ║  Plan: 7 steps · estimated 2 min              ║
  ╚════════════════════════════════════════════════╝

  ✓  Created src/routes/auth.js
  ✓  Created src/middleware/jwt.js
  ✓  Created tests/auth.test.js
  ✓  Generated Dockerfile + docker-compose.yml
  ✓  Opened http://localhost:3000 in browser

[⟩⟨ done · 87.3s]

Why Sarmad beats every other CLI orchestrator

Feature Sarmad ⟩⟨ Aider Continue Shell GPT
GitHub Copilot as engine
RAG codebase awareness
Multi-model pipeline
Auto-open HTML/URLs
Inline clipboard image paste
Branded REPL with animations
Windows-native (no WSL) ⚠️ ⚠️ ⚠️
Zero token cost
Abort mid-stream (ESC)
Self-learning via session history

Why Copilot CLI is the superior engine

  • Best-in-class models: Claude Sonnet 4.6, GPT-5.3-Codex, GPT-5.2 — all accessible via one subscription
  • Native tool use: file read/write, shell commands, web fetch — all built-in, no custom wiring
  • Managed safety: permission model, path verification, URL allowlisting — enterprise-grade
  • No token metering anxiety: GitHub Copilot subscription = unlimited orchestration calls through Sarmad
  • Infinite chaining: Sarmad can invoke Copilot CLI multiple times per user request, coordinating multiple specialist models (Analyzer → Executor → Visual Runner) with clean output merging

Architecture

┌─────────────────────────────────────────────────────────┐
│                    User Terminal                         │
│   PS C:\Users\ssl55> ⟩⟨  <your natural language>       │
└────────────────────┬────────────────────────────────────┘
                     │
            ┌────────▼────────┐
            │   REPL + Input  │  ← Bracketed paste, raw mode
            │  (input.js)     │  ← Inline /img tokens
            └────────┬────────┘  ← Double Ctrl+C, ESC abort
                     │
            ┌────────▼────────┐
            │  RAG Engine     │  ← Scans codebase in cwd
            │  (rag.js)       │  ← Injects relevant context
            └────────┬────────┘  ← Learns from history
                     │
            ┌────────▼────────┐
            │   Orchestrator  │  ← Multi-model pipelines
            │(orchestrator.js)│  ← Compliance testing
            └────────┬────────┘  ← Specialist model routing
                     │
            ┌────────▼────────┐
            │    Executor     │  ← Windows-safe PS encoding
            │  (executor.js)  │  ← Animated streaming output
            └────────┬────────┘  ← ESC-abortable processes
                     │
            ┌────────▼────────┐
            │ GitHub Copilot  │  ← copilot --allow-all
            │    CLI Engine   │  ← Any model, any tool
            └─────────────────┘

Self-Learning Loop

User prompt
    ↓
RAG scans ~/.sarmad/history.json + codebase files
    ↓
Relevant context injected into Copilot system prompt
    ↓
Copilot executes (with tools: write, shell, web_fetch…)
    ↓
Result returned → stored in session history
    ↓
Next prompt benefits from this context (self-improving)

Installation

Prerequisites: Node.js 18+, GitHub Copilot CLI (npm install -g @github/copilot-cli or winget install GitHub.GitHubCopilotCLI)

git clone https://github.com/sbay-dev/sarmad.git
cd sarmad
npm install
npm link        # makes `sarmad` available globally

Verify:

sarmad --version   # ⟩⟨ Sarmad v1.0.0

Usage

Interactive REPL

sarmad

Type any natural language request at the ⟩⟨ prompt.

Non-interactive

sarmad -p "fix all TypeScript errors in src/"

Built-in Commands

Command Description
/help Show all commands
/img Paste clipboard image as context (ASCII preview shown)
/rag <query> Show RAG context for a query
/model <name> Switch model (e.g. gpt-5.3-codex, claude-sonnet-4.6)
/run <cmd> Run shell command directly
/history Show recent session history
/status Show current config
/orchestrate <task> Run multi-model pipeline
/exit Exit cleanly

Keyboard Shortcuts

Key Action
Enter Submit prompt
ESC Abort running Copilot invocation
Ctrl+C Clear line / hint
Ctrl+C × 2 Exit
↑ / ↓ Navigate history
/img (typed) Inline image token from clipboard

Inline Image Context

⟩⟨  the layout breaks like this /img please fix it

Sarmad replaces /img with a 4-char token [img:K3XM], shows a live ASCII preview above the line, and injects the full image context into Copilot when you press Enter.


Multi-Model Orchestration

Sarmad can chain specialized models for complex tasks:

/orchestrate build and deploy a microservice with full test coverage
Stage 1 — Analyzer  (claude-sonnet-4.6)  → Architecture plan
Stage 2 — Executor  (gpt-5.3-codex)     → Code generation + tests
Stage 3 — Reviewer  (claude-sonnet-4.6) → Security + quality check

Each stage receives the previous stage's output as context, forming an intelligent pipeline where models critique and improve each other's work.


Configuration

Config stored at ~/.sarmad/config.json:

{
  "defaultModel": "gpt-5.3-codex",
  "useRag": true,
  "ragDepth": 5,
  "copilotFlags": "--allow-all"
}

Roadmap

See the Sarmad Project Board for full Kanban tracking.

Upcoming:

  • Web UI dashboard for session history
  • Plugin system (custom model providers)
  • MCP server mode (expose Sarmad as an MCP tool)
  • Cross-session learning with vector embeddings
  • Team collaboration: shared RAG context

Contributing

This project follows the Sarmad Contribution Guidelines.
All PRs require passing compliance tests: /orchestrate compliance.


License

MIT © sbay-dev


"The best CLI is the one that learns with you."

⟩⟨ S A R M A D ⟩⟨

About

⟩⟨ Sarmad — Self-learning CLI orchestrator powered by GitHub Copilot CLI. RAG · Multi-Model · Autonomous terminal AI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors