refactor: decouple Coin Hunter from Hermes for cross-platform usage
- Add unified coinhunter_shim.py that accepts subcommands (pre/gate/review/rotate-log) - Update SKILL.md gate pseudocode to read optional ~/.coinhunter/platform.json - Split cron/setup examples into Hermes and OpenClaw variants across docs - Introduce platform.json schema in user-data-layout.md - Remove stale auto_trader.py/run_trader.sh references from auto-trading-guide.md - Keep legacy shims as backward-compatible wrappers
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compatibility shim for external gate execution.
|
||||
Real logic lives in the CoinHunter skill.
|
||||
Copy this file to ~/.hermes/scripts/coinhunter_external_gate.py if needed.
|
||||
"""
|
||||
import runpy
|
||||
from pathlib import Path
|
||||
"""Hermes cron shim: runs coinhunter external-gate via CLI."""
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
TARGET = Path.home() / ".hermes" / "skills" / "coinhunter" / "scripts" / "coinhunter_external_gate.py"
|
||||
runpy.run_path(str(TARGET), run_name="__main__")
|
||||
BIN = shutil.which("coinhunter") or shutil.which("coinhunter.exe")
|
||||
if not BIN:
|
||||
print("error: coinhunter CLI not found in PATH. Install with: pipx install coinhunter", file=sys.stderr)
|
||||
sys.exit(127)
|
||||
|
||||
sys.exit(subprocess.run([BIN, "gate", *sys.argv[1:]]).returncode)
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compatibility shim for Hermes cron script hook.
|
||||
Real logic lives in the CoinHunter skill.
|
||||
Copy this file to ~/.hermes/scripts/coinhunter_precheck.py if needed.
|
||||
"""
|
||||
import runpy
|
||||
from pathlib import Path
|
||||
"""Hermes cron shim: runs coinhunter precheck via CLI."""
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
TARGET = Path.home() / ".hermes" / "skills" / "coinhunter" / "scripts" / "coinhunter_precheck.py"
|
||||
runpy.run_path(str(TARGET), run_name="__main__")
|
||||
BIN = shutil.which("coinhunter") or shutil.which("coinhunter.exe")
|
||||
if not BIN:
|
||||
print("error: coinhunter CLI not found in PATH. Install with: pipx install coinhunter", file=sys.stderr)
|
||||
sys.exit(127)
|
||||
|
||||
sys.exit(subprocess.run([BIN, "pre", *sys.argv[1:]]).returncode)
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compatibility shim for review-context cron script hook.
|
||||
Real logic lives in the CoinHunter skill.
|
||||
Copy this file to ~/.hermes/scripts/coinhunter_review_context.py if needed.
|
||||
"""
|
||||
import runpy
|
||||
from pathlib import Path
|
||||
"""Hermes cron shim: runs coinhunter review-context via CLI."""
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
TARGET = Path.home() / ".hermes" / "skills" / "coinhunter" / "scripts" / "coinhunter_review_context.py"
|
||||
runpy.run_path(str(TARGET), run_name="__main__")
|
||||
BIN = shutil.which("coinhunter") or shutil.which("coinhunter.exe")
|
||||
if not BIN:
|
||||
print("error: coinhunter CLI not found in PATH. Install with: pipx install coinhunter", file=sys.stderr)
|
||||
sys.exit(127)
|
||||
|
||||
sys.exit(subprocess.run([BIN, "review", *sys.argv[1:]]).returncode)
|
||||
|
||||
23
templates/coinhunter_shim.py
Normal file
23
templates/coinhunter_shim.py
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Cross-platform cron shim: delegates any coinhunter subcommand via CLI."""
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
BIN = shutil.which("coinhunter") or shutil.which("coinhunter.exe")
|
||||
if not BIN:
|
||||
print(
|
||||
"error: coinhunter CLI not found in PATH. Install with: pipx install coinhunter",
|
||||
file=sys.stderr,
|
||||
)
|
||||
sys.exit(127)
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("usage: coinhunter_shim.py <subcommand> [args...]", file=sys.stderr)
|
||||
print("example: coinhunter_shim.py pre", file=sys.stderr)
|
||||
sys.exit(2)
|
||||
|
||||
subcommand = sys.argv[1]
|
||||
args = sys.argv[2:]
|
||||
|
||||
sys.exit(subprocess.run([BIN, subcommand, *args]).returncode)
|
||||
12
templates/rotate_external_gate_log_shim.py
Normal file
12
templates/rotate_external_gate_log_shim.py
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Hermes cron shim: runs coinhunter rotate-log via CLI."""
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
BIN = shutil.which("coinhunter") or shutil.which("coinhunter.exe")
|
||||
if not BIN:
|
||||
print("error: coinhunter CLI not found in PATH. Install with: pipx install coinhunter", file=sys.stderr)
|
||||
sys.exit(127)
|
||||
|
||||
sys.exit(subprocess.run([BIN, "rotate-log", *sys.argv[1:]]).returncode)
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
python3 "$HOME/.hermes/skills/coinhunter/scripts/rotate_external_gate_log.py"
|
||||
Reference in New Issue
Block a user