{"id":18743980,"url":"https://github.com/at1as/terminal-chess","last_synced_at":"2025-10-29T20:47:52.544Z","repository":{"id":18969572,"uuid":"22190394","full_name":"at1as/Terminal-Chess","owner":"at1as","description":"A chess game written for the Terminal in Ruby","archived":false,"fork":false,"pushed_at":"2018-01-07T18:26:51.000Z","size":72,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T15:54:21.448Z","etag":null,"topics":["chess","chess-game","game","ruby","terminal"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/at1as.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-24T01:08:55.000Z","updated_at":"2020-11-13T11:59:51.000Z","dependencies_parsed_at":"2022-09-13T17:50:58.435Z","dependency_job_id":null,"html_url":"https://github.com/at1as/Terminal-Chess","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/at1as%2FTerminal-Chess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/at1as%2FTerminal-Chess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/at1as%2FTerminal-Chess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/at1as%2FTerminal-Chess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/at1as","download_url":"https://codeload.github.com/at1as/Terminal-Chess/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248636085,"owners_count":21137372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["chess","chess-game","game","ruby","terminal"],"created_at":"2024-11-07T16:13:18.941Z","updated_at":"2025-10-29T20:47:52.454Z","avatar_url":"https://github.com/at1as.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Terminal-Chess\n==============\n\nA lightweight two-player chess game for the Terminal, written in Ruby\n\n![Screenshot](http://at1as.github.io/github_repo_assets/terminal_chess-2.png)\n\n \n### Installing\n\nThe easiest way to use terminal_chess is to install it via the [Rubygem](https://rubygems.org/gems/terminal_chess).\n\nOtherwise, clone this repo directly and run:\n\n```bash\n# Download Repo\n$ git clone git@github.com:at1as/Terminal-Chess.git\n$ chmod +x lib/terminal_chess.rb\n\n# Install Dependencies. Only dependency for local use is the colorize gem\n# however there are various requirements for a websocket client and server in order to play remotely\n$ bundle install\n```\n\n### Running\n\n#### Local Gameplay\n\nIn this mode, the game will launch in Terminal and allow the player to make moves for both sides of the board\n\n```\n# Run program in terminal (source)\n$ ruby lib/terminal_chess.rb\n\n# Run program in terminal (gem)\n$ gem install terminal_chess\n$ terminal_chess\n```\n\n#### Multiplayer\n\nTerminal Chess can connect to an opponent using websockets over ngrok. The requires first starting the server. While this resides \n\n```\n# The webserver must be running either on one of the players machines\n# Or somewhere else. This will need to be running before either client can connect\n$ SERVER=start lib/terminal_chess.rb \n\n# The host running the server will need to tunnel the connection through ngrok\n# on the free plan the URL will change every time ngrok is launched\n# therefor the `9cf13f35` component will need to be passed to the clients in order\n# to connect\n$ ngrok http 4567\n =\u003e http://9cf13f35.ngrok.io -\u003e localhost:4567\n```\n\nAnd then the client can connect via the NGROK environment variable. if this environment variable is set, the client will attempt to start a session over the network. If the connection  \n\n```\n# Replace the NGROK enviroment variable with whatever URL the ngrok server returned\n# -- from Soure:\n$ NGROK=9cf13f5 ruby lib/terminal_chess.rb\n# -- OR from Gem:\n$ NGROK=9cf13f5 terminal_chess\n\n# =\u003e [:message, \"INFO: Awaiting second player...\"]\n```\n\nAnd once the second client connects, game on!\n\n```\n$ NGROK=9cf13f5 ruby lib/terminal_chess.rb\n\n# =\u003e [:message, \"INFO: Connected to remote player\"]\n# =\u003e [:message, \"SETUP: You are player 2\"]\n# =\u003e [:message, \"INFO: Starting game!\"]\n```\n\nAny subsequent clients that attempt to connect while the game is in session will have their connections dropped\n\n### Testing:\n\n```bash\n$ bundle exec rake test --trace\n```\n\n### Notes\n* Built and tested on macOS 10.11 with Ruby 2.4.0\n* Neither player can currently be automated\n\n### TODO:\n* Automate one of two players (note: tried and failed at this. Not easy to make it competent)\n* Switch written Chess pieces to unicode characters (note: tried this. Didn't look great unless text size was massive)\n* Player 2 must play an upside down chessboard. Reorient so it's the same for both players\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fat1as%2Fterminal-chess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fat1as%2Fterminal-chess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fat1as%2Fterminal-chess/lists"}