Add the invariant-gateway CLI script.

This commit is contained in:
Hemang
2025-04-10 22:29:38 +02:00
committed by Hemang Sarkar
parent 5bf121bbda
commit 15210997a7
2 changed files with 40 additions and 1 deletions
+36
View File
@@ -0,0 +1,36 @@
"""Script is used to run actions using the Invariant Gateway."""
import sys
def main():
"""Entry point for the Invariant Gateway."""
actions = {
"mcp": "Runs the Invariant Gateway against MCP (Model Context Protocol) servers with guardrailing and push to Explorer features",
"llm": "Runs the Invariant Gateway against LLM providers with guardrailing and push to Explorer features",
"help": "Shows this help message",
}
def _help():
"""Prints the help message."""
print("\nSupported Commands by invariant-gateway:\n")
for verb, description in actions.items():
print(f"{verb}: {description}")
if len(sys.argv) < 2:
_help()
sys.exit(1)
verb = sys.argv[1]
if verb == "mcp":
# Use sys.argv[2:] to pass arguments to the MCP gateway
return 0
if verb == "llm":
# Use sys.argv[2:] to pass arguments to the LLM gateway
print("LLM gateway via the invariant-gateway command is not implemented yet.")
return 1
if verb == "help":
_help()
return 0
print(f"Unknown action: {verb}")
return 1
+4 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "invariant-gateway"
version = "0.1.0"
version = "0.0.1"
description = "LLM proxy to observe and debug what your AI agents are doing"
readme = "README.md"
requires-python = ">=3.12"
@@ -16,6 +16,9 @@ dependencies = [
[tool.setuptools.packages.find]
where = ["."]
[project.scripts]
invariant-gateway = "gateway.__main__:main"
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"