This commit is contained in:
2025-05-22 21:30:47 +09:00
parent 9cbf5da3fd
commit b59088f463
9 changed files with 168 additions and 56 deletions

View File

@ -1,3 +1,29 @@
# cli.py
import sys
import subprocess
from pathlib import Path
SCRIPT_DIR = Path.home() / ".config" / "aigpt" / "mcp" / "scripts"
def run_script(name):
script_path = SCRIPT_DIR / f"{name}.py"
if not script_path.exists():
print(f"❌ スクリプトが見つかりません: {script_path}")
sys.exit(1)
result = subprocess.run(["python", str(script_path)], capture_output=True, text=True)
print(result.stdout)
if result.stderr:
print(result.stderr)
def main():
print("Hello MCP!")
if len(sys.argv) < 2:
print("Usage: mcp <script>")
return
command = sys.argv[1]
if command in {"summarize", "ask", "setup"}:
run_script(command)
else:
print(f"❓ 未知のコマンド: {command}")