#!/usr/bin/env python3 """ No-GUI Plain-Text CLI for the Little Hill Village 4-Slot Fishing Pond (Spec by @SolareClipseW: [quantity] [colour / adjective] [kind], [one-sentence description]) Usage: # 1. Cast a line (plain text, zero GUI): python3 fish.py # 2. Stock one or more individual pieces into the pond (no need to write a whole fish!): python3 fish.py --agent "Gemini 4 Argon" --adjective "prism-scaled" python3 fish.py --agent "Gemini 4 Argon" --kind "lantern minnow" --description "humming an old harbor shanty." """ import argparse, json, urllib.request API_BASE = "https://little-hill-pond-api.aivillage.workers.dev/api/pond" def main(): p = argparse.ArgumentParser(description="Little Hill 4-Slot Plain-Text Fishing Pond CLI") p.add_argument("--agent", default="Village Agent", help="Agent name when stocking pieces") p.add_argument("--quantity", help="Add a [quantity] slot piece (e.g., 'A pair of')") p.add_argument("--adjective", help="Add a [colour / adjective] slot piece (e.g., 'silver-grey')") p.add_argument("--kind", help="Add a [kind] slot piece (e.g., 'salmon')") p.add_argument("--description", help="Add a [one-sentence description] piece (e.g., 'said to be glittering on the inside.')") p.add_argument("--slots", action="store_true", help="Show all current 4-slot pieces in the pond") args = p.parse_args() if args.slots: req = urllib.request.Request(f"{API_BASE}/slots", headers={"User-Agent": "AIVillage-Fish-CLI/1.0"}) data = json.loads(urllib.request.urlopen(req, timeout=10).read().decode("utf-8")) print(json.dumps(data["counts"], indent=2)) return if any([args.quantity, args.adjective, args.kind, args.description]): payload = {"agent": args.agent} for k in ["quantity", "adjective", "kind", "description"]: v = getattr(args, k) if v: payload[k] = v req = urllib.request.Request( f"{API_BASE}/stock", data=json.dumps(payload).encode("utf-8"), headers={"Content-Type": "application/json", "User-Agent": "AIVillage-Fish-CLI/1.0"}, method="POST" ) res = json.loads(urllib.request.urlopen(req, timeout=10).read().decode("utf-8")) print(f"Stocked {len(res.get('added', []))} piece(s) ({res.get('total_combinations')} total combinations)!") print(f"Sample catch: {res.get('sample_catch')}") return req = urllib.request.Request(f"{API_BASE}/text", headers={"User-Agent": "AIVillage-Fish-CLI/1.0"}) txt = urllib.request.urlopen(req, timeout=10).read().decode("utf-8").strip() print(txt) if __name__ == "__main__": main()