{"id":48464163,"url":"https://github.com/atomicobject/sushi-go-starter-kit","last_synced_at":"2026-04-07T04:01:52.167Z","repository":{"id":341202708,"uuid":"1168615984","full_name":"atomicobject/sushi-go-starter-kit","owner":"atomicobject","description":"Starter kit for building Sushi Go bots — protocol docs and client SDKs","archived":false,"fork":false,"pushed_at":"2026-02-28T16:15:13.000Z","size":25,"stargazers_count":8,"open_issues_count":1,"forks_count":12,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-28T17:04:37.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atomicobject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-27T15:45:33.000Z","updated_at":"2026-02-28T16:15:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/atomicobject/sushi-go-starter-kit","commit_stats":null,"previous_names":["atomicobject/sushi-go-starter-kit"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/atomicobject/sushi-go-starter-kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fsushi-go-starter-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fsushi-go-starter-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fsushi-go-starter-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fsushi-go-starter-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomicobject","download_url":"https://codeload.github.com/atomicobject/sushi-go-starter-kit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fsushi-go-starter-kit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31499193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-07T04:01:51.416Z","updated_at":"2026-04-07T04:01:52.158Z","avatar_url":"https://github.com/atomicobject.png","language":"Python","readme":"# Sushi Go Starter Kit\n\nBuild a bot to play Sushi Go against other players on a networked game server.\n\n## Game Rules\n\nSushi Go is a card-drafting game by Gamewright. Find the rules online or get a copy of the game!\n\n## Quick Start\n\n### Prerequisites\n\n- **Python 3.10+** (no external packages needed), or\n- **Node.js 18+** (no npm dependencies needed)\n\n### Run the Demo Bot\n\n```bash\n# Python — plays the first card every turn\npython python/first_card_bot.py \u003cgame_id\u003e \u003cyour_name\u003e\n\n# Python — priority-based strategy\npython python/sushi_go_client.py localhost 7878 \u003cgame_id\u003e \u003cyour_name\u003e\n\n# JavaScript — priority-based strategy\nnode javascript/sushi_go_client.js localhost 7878 \u003cgame_id\u003e \u003cyour_name\u003e\n```\n\nTo join a game on someone else's laptop\n```bash\npython first_card_bot.py \u003cip_address\u003e \u003cport\u003e \u003cgame_id\u003e \u003cyour_name\u003e\n```\n\nReplace `\u003cgame_id\u003e` with the game ID shown in the web UI or given to you by the tournament organizer.\n\n## Running a Test Server\n\nFirst, load the server image from the LAN:\n\n```bash\ncurl -O https://joes-macbook.tail10906.ts.net/sushi-go-test.tar \u0026\u0026 docker load \u003c sushi-go-test.tar\n```\n\nor \n\n```bash\ncurl -O http://joes-macbook.local:9090/sushi-go-test.tar \u0026\u0026 docker load \u003c sushi-go-test.tar\n```\n\n\nThen start it:\n\n```bash\ndocker run -it -p 7878:7878 -p 8080:8080 sushi-go-test\n```\n\n- **Port 7878** — TCP game port (where your bot connects)\n- **Port 8080** — Web UI for creating games and spectating\n\nOpen http://localhost:8080 in a browser, create a game, then run your bot with the game ID.\n\n## Building Your Bot\n\nThe basic pattern every bot follows:\n\n1. Connect to the server via TCP\n2. Send `JOIN \u003cgame_id\u003e \u003cyour_name\u003e`\n3. Send `READY`\n4. Wait for messages in a loop\n5. When you receive `HAND`, choose a card and send `PLAY \u003cindex\u003e`\n6. Repeat until `GAME_END`\n\nSee `python/first_card_bot.py` for a minimal working example (~30 lines of game logic).\n\n## Customizing\n\nThe starter clients include a strategy function you can edit:\n\n- **Python:** `choose_card(hand)` in `sushi_go_client.py`\n- **JavaScript:** `chooseCard(hand)` in `sushi_go_client.js`\n\nThe `hand` parameter is a list of card names (e.g., `[\"Tempura\", \"Salmon Nigiri\", \"Pudding\"]`). Return the index of the card you want to play.\n\nOr, write your bot from scratch — all you need is a TCP socket and the protocol below.\n\n## Handling Disconnects (Rejoin Tokens)\n\nWhen your bot joins a game, the server sends back a **rejoin token** in the `WELCOME` message:\n\n```\nWELCOME myGame 0 fG6miM0Ge9OnNyUTsARaSyX3ZUW8cqr8\n                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n                  Save this! It's your lifeline.\n```\n\nIf your bot crashes or loses its connection, you can reconnect and send `REJOIN \u003ctoken\u003e` instead of `JOIN`. This restores your session — you keep your seat, your cards, and your score. Other players won't even notice you disconnected.\n\n### How to use it\n\n1. **Save the token** when you receive `WELCOME` (the 4th field)\n2. If you disconnect, open a new TCP connection\n3. Send `REJOIN \u003ctoken\u003e` instead of `JOIN`\n4. Server responds with `REJOINED \u003cgame_id\u003e \u003cplayer_id\u003e` — you're back in\n5. You'll receive the next `HAND` message when it's your turn, just like normal\n\n### Tips\n\n- Save the token to a file so your bot can read it on restart\n- You do **not** need to send `READY` again after rejoining\n- The token is a random 32-character string unique to your seat in that game\n- If the game has already ended, `REJOIN` will return an error\n\n### Example reconnect flow\n\n```\n# First connection\n\u003e\u003e\u003e JOIN myGame Alice\n\u003c\u003c\u003c WELCOME myGame 0 fG6miM0Ge9OnNyUTsARaSyX3ZUW8cqr8\n\u003e\u003e\u003e READY\n\u003c\u003c\u003c OK\n\u003c\u003c\u003c HAND 0:Tempura 1:Sashimi ...\n\u003e\u003e\u003e PLAY 0\n\u003c\u003c\u003c OK\n\n# Connection drops...\n\n# New connection\n\u003e\u003e\u003e REJOIN fG6miM0Ge9OnNyUTsARaSyX3ZUW8cqr8\n\u003c\u003c\u003c REJOINED myGame 0\n\u003c\u003c\u003c HAND 0:Dumpling 1:Pudding ...   (game continues)\n\u003e\u003e\u003e PLAY 1\n\u003c\u003c\u003c OK\n```\n\n## Language Guides\n\n- [Python Guide](python/README.md)\n- [JavaScript Guide](javascript/README.md)\n\n## Protocol Reference\n\nSee [PROTOCOL.md](PROTOCOL.md) for the full protocol specification, including:\n\n| You Send | Server Sends |\n|----------|-------------|\n| `JOIN \u003cgame_id\u003e \u003cname\u003e` | `WELCOME \u003cgame_id\u003e \u003cid\u003e \u003ctoken\u003e` |\n| `READY` | `OK` |\n| `PLAY \u003cindex\u003e` | `OK` |\n| `CHOPSTICKS \u003ci\u003e \u003cj\u003e` | `OK` |\n| `REJOIN \u003ctoken\u003e` | `REJOINED \u003cgame_id\u003e \u003cid\u003e` |\n| | `HAND 0:Card 1:Card ...` (your turn) |\n| | `PLAYED ...` (turn results) |\n| | `ROUND_END ...` / `GAME_END ...` |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicobject%2Fsushi-go-starter-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomicobject%2Fsushi-go-starter-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicobject%2Fsushi-go-starter-kit/lists"}