mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-07-06 19:07:50 +02:00
Add the invariant-gateway CLI script.
This commit is contained in:
@@ -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
@@ -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"
|
||||
Reference in New Issue
Block a user