The HardRAG CLI is the professional command-line interface for developers and security analysts to audit, optimize, and manage the Sovereign Engine without a GUI.
đī¸ Installation
The CLI is built with Typer and Rich for a premium terminal experience. Ensure the backend dependencies are installed.
# Register the HardRAG Sovereign Terminal
alias hardrag="python3 backend/app/cli.py"
đšī¸ Command Reference
1. System Health Audit
Verify the status and integrity of the local Sovereign Vault.
hardrag status
- Action: Checks SHA-256 audit signing status and deployment mode (SOVEREIGN/CLOUD).
2. Surgical Inference Audit
Run a targeted security audit on a specific prompt string for rapid testing.
hardrag audit "Analyze patient record RX-901" --tier PLATFORM
- Action: Initiates the Multi-Agent Consensus Jury.
- Option: Use
--jsonfor machine-readable automation outputs.
3. Prompt Weight Optimization
Trigger the DSPy Feedback Loop to refine prompt boundaries based on historical corrections.
hardrag optimize
- Action: Bootstraps few-shot examples from the audit log database.
đ ī¸ Developer Integration
The CLI is designed for CI/CD pipelines. You can automate "Compliance Pre-checks" before deploying new RAG knowledge bases.
# Example: Automated Governance Check
import subprocess
def pre_deploy_check(query):
result = subprocess.run(
["hardrag", "audit", query, "--json"],
capture_output=True, text=True
)
return result.stdout
[!IMPORTANT] Sovereign Access: The CLI requires local network access to the HardRAG Backend. For air-gapped environments, ensure the
API_URLis mapped to the internal Docker mesh.
