-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforce_install_hook.py
More file actions
28 lines (24 loc) · 1.14 KB
/
Copy pathforce_install_hook.py
File metadata and controls
28 lines (24 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from pathlib import Path
# Shell alias utility only.
# This script does NOT install Claude Code or Codex Athena hooks.
profile_candidates = [
Path.home() / "Documents" / "PowerShell" / "Microsoft.PowerShell_profile.ps1",
Path.home() / "Documents" / "WindowsPowerShell" / "Microsoft.PowerShell_profile.ps1",
]
alias_cmd = 'Set-Alias -Name start-agent -Value athena'
for profile_path in profile_candidates:
try:
profile_path.parent.mkdir(parents=True, exist_ok=True)
if profile_path.exists():
content = profile_path.read_text(encoding="utf-8")
if "start-agent" in content:
print(f"OK: Alias already present in {profile_path}")
else:
with profile_path.open("a", encoding="utf-8") as f:
f.write(f"\n# Athena Shell Alias\n{alias_cmd}\n")
print(f"OK: Updated existing profile {profile_path}")
else:
profile_path.write_text(f"# Athena Shell Alias\n{alias_cmd}\n", encoding="utf-8")
print(f"OK: Created profile {profile_path}")
except Exception as e:
print(f"Failed for {profile_path}: {e}")