Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: ensure git and internet connection
  • Loading branch information
Yuchen Xiao Yuchen Xiao
Yuchen Xiao authored and Yuchen Xiao committed May 23, 2026
commit f9f3965c4d8aef66e57c9999e59e882770a6229f
21 changes: 21 additions & 0 deletions src/diffpy/apps/app_agentify.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import shutil
import socket
import subprocess
import tempfile
from pathlib import Path
Expand All @@ -7,7 +8,27 @@
DIR_NAME = "cmi-skill"


def ensure_setup():
def internet_available():
try:
socket.create_connection(("github.com", 443), timeout=3)
return True
except OSError:
return False

git_available = shutil.which("git") is not None
agentify_available = internet_available() and git_available
return agentify_available


def agentify(args):
if not ensure_setup():
print(
"Internet connection or git unavailable. "
"Please ensure git is installed and you have an active internet "
f"connection to {REPO_URL}."
)
return
agent = args.agent
system_flag = args.system
if agent == "claude":
Expand Down