Your terminal, fluent in English.
Shard is an AI-powered natural language interface for your terminal.
It converts plain English instructions into safe shell commands — analyzes risk — and executes them only after confirmation.
No more memorizing obscure flags.
Just describe what you want.
- 🧠 Natural language → shell command generation
- 🛡️ Built-in risk engine (strict / default / relaxed policies)
- 🔍 Structured output validation (LLM-safe parsing)
- 🎨 Clean terminal UI (Rich + Typer)
- 💬 Interactive session mode
- ⚙️ Configurable safety levels
shard "delete all node_modules folders recursively"
shard --policy strict "install nginx"
shard
>> check all files including hidden ones
>> compress this folder
>> exitShard never executes commands automatically.
Each generated command:
- Is analyzed by a deterministic risk engine
- Is classified as SAFE / WARN / BLOCK
- Requires explicit user confirmation
Strict mode can block dangerous operations entirely.
Since Shard is not yet published to PyPI, install directly from source.
git clone https://github.com/baync180705/ShardCLI.git
cd ShardCLIpython -m venv venv
source venv/bin/activate # Linux / macOS
# venv\Scripts\activate # Windowspip install -e .This makes the shard command available globally inside your environment.
Shard requires a Groq API key.
Export it as an environment variable:
export GROQ_API_KEY=your_groq_api_key_hereFor Windows (PowerShell):
setx GROQ_API_KEY "your_groq_api_key_here"shard "check all files in this folder including hidden ones"shardType commands interactively:
>> delete build folder
>> list large files
>> exit
You can control safety strictness:
shard --policy strict "delete temp files"Available policies:
strict→ Maximum protectiondefault→ Balanced safety (default)relaxed→ Less restrictive
shard --explain "compress this directory"Displays the reasoning behind the generated command.
shardcli/
├── LICENSE
├── pyproject.toml
├── README.md
└── shardcli
├── config
│ ├── config.py
│ └── __init__.py
├── core
│ ├── environment.py
│ ├── executor.py
│ ├── __init__.py
│ ├── models.py
│ └── orchestrator.py
├── engine
│ ├── __init__.py
│ ├── policy
│ │ ├── base.py
│ │ ├── default.py
│ │ ├── __init__.py
│ │ ├── relaxed.py
│ │ └── strict.py
│ ├── risk_engine.py
│ └── risk_types.py
├── __init__.py
├── interface
│ ├── cli.py
│ └── __init__.py
├── llm
│ ├── __init__.py
│ ├── llm_client.py
│ ├── models
│ │ └── command_result.py
│ ├── prompt_builder.py
│ └── structured_output.py
├── main.py
└── requirements.txt
Shard is built with clean separation of concerns:
- LLM Layer → Structured command generation
- Risk Engine → Deterministic safety checks
- Policy System → Configurable safety levels
- Orchestrator → Coordinates workflow
- Executor → Runs commands safely
- CLI Layer → User interface only
Shard executes real shell commands.
Always review generated commands before confirming execution.
Use strict mode when in doubt.
Run locally:
python -m shardcli.mainOr via installed CLI:
shard --helpMIT License
Because your terminal should understand you —
not the other way around.