Download launch_picoclaw.py from ameobius/dev-box: direct link, hf CLI and curl.
- Browser
- Download file 1.51 kB
-
https://huggingface.co/spaces/ameobius/dev-box/resolve/main/launch_picoclaw.py
- Command line
-
hf download hf://spaces/ameobius/dev-box/launch_picoclaw.py
-
curl -L -o launch_picoclaw.py https://huggingface.co/spaces/ameobius/dev-box/resolve/main/launch_picoclaw.py
1.51 kB
| #!/usr/bin/env python3 | |
| """Launch picoclaw gateway — works across versions.""" | |
| import sys | |
| import os | |
| # Set config dir | |
| os.environ.setdefault("PICOCLAW_HOME", "/app/.picoclaw") | |
| try: | |
| import picoclaw | |
| # Try different entry points | |
| if hasattr(picoclaw, "gateway"): | |
| gw = picoclaw.gateway | |
| if callable(gw): | |
| gw() | |
| elif hasattr(gw, "run"): | |
| gw.run() | |
| elif hasattr(picoclaw, "run_gateway"): | |
| picoclaw.run_gateway() | |
| elif hasattr(picoclaw, "cli"): | |
| cli = picoclaw.cli | |
| if hasattr(cli, "main"): | |
| sys.argv = ["picoclaw", "gateway"] | |
| cli.main() | |
| else: | |
| # Search for gateway function in submodules | |
| import importlib | |
| for name in ["picoclaw.gateway", "picoclaw.cli", "picoclaw.main", "picoclaw.app"]: | |
| try: | |
| mod = importlib.import_module(name) | |
| if hasattr(mod, "main"): | |
| sys.argv = ["picoclaw", "gateway"] | |
| mod.main() | |
| break | |
| if hasattr(mod, "run"): | |
| mod.run() | |
| break | |
| except ImportError: | |
| continue | |
| else: | |
| print("ERROR: Cannot find gateway entry point in picoclaw", file=sys.stderr) | |
| print(f"Available: {dir(picoclaw)}", file=sys.stderr) | |
| sys.exit(1) | |
| except Exception as e: | |
| print(f"ERROR: {e}", file=sys.stderr) | |
| import traceback | |
| traceback.print_exc() | |
| sys.exit(1) | |