{"id":29857176,"url":"https://github.com/urpagin/slpcli","last_synced_at":"2026-04-18T00:31:27.184Z","repository":{"id":304628022,"uuid":"726265169","full_name":"Urpagin/slpcli","owner":"Urpagin","description":"A Minecraft: Java Edition CLI SLP implementation in C++.","archived":false,"fork":false,"pushed_at":"2025-11-11T22:22:37.000Z","size":358,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-12T00:20:06.365Z","etag":null,"topics":["asio","aur","cli","cpp","cross-platform","gamedev","jetbrains","learn","lightweight","minecraft","minecraft-protocol","minecraft-tool","naive","networking","open-source","ping","server-list-ping","shell","slp","tooling"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Urpagin.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,"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":"2023-12-01T22:34:15.000Z","updated_at":"2025-11-11T22:22:41.000Z","dependencies_parsed_at":"2025-07-14T11:28:06.118Z","dependency_job_id":"79a7dade-490f-47dc-b12d-cfbad736ec23","html_url":"https://github.com/Urpagin/slpcli","commit_stats":null,"previous_names":["urpagin/slpcli"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Urpagin/slpcli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fslpcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fslpcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fslpcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fslpcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Urpagin","download_url":"https://codeload.github.com/Urpagin/slpcli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Urpagin%2Fslpcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31951233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["asio","aur","cli","cpp","cross-platform","gamedev","jetbrains","learn","lightweight","minecraft","minecraft-protocol","minecraft-tool","naive","networking","open-source","ping","server-list-ping","shell","slp","tooling"],"created_at":"2025-07-30T00:38:52.251Z","updated_at":"2026-04-18T00:31:27.162Z","avatar_url":"https://github.com/Urpagin.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slpcli\n\n🚀 **A simple C++ tool to query the Server List Ping (SLP) of a Minecraft: Java Edition (Notchian) server.**\n\n---\n\n🔧 *A naive implementation of the Server List Ping (SLP) protocol in C++\nusing [non-boost Asio](https://think-async.com/Asio/).*\n\n📦 **Available on the AUR**  \n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;[![AUR version](https://img.shields.io/aur/version/slpcli-git?logo=archlinux\u0026label=slpcli-git\u0026style=flat)](https://aur.archlinux.org/packages/slpcli-git)\n\n⭐ Enjoying this repo? A star would mean a lot.\n\n---\n\n## 📌 Usage\n\n```bash\n./slpcli [OPTIONS] addr [port]\n\n\nPOSITIONALS:\n  addr TEXT REQUIRED          Server address with optional \":port\".\n  port UINT                   Port of the Minecraft server (default 25565).\n\nOPTIONS:\n  -h,     --help              Print this help message and exit\n  -s,     --silent            Only prints the JSON or an empty string if error.\n  -a,     --address TEXT REQUIRED\n                              Server address with optional \":port\".\n  -p,     --port UINT         Port of the Minecraft server (default 25565).\n  -t,     --timeout INT       The timeout in seconds at which the query is dropped\n          --protocol-version INT\n                              The protocol version that the client plans on using to connect to\n                              the server. Do not change if you do not know what it means.\n```\n\n## 🛠️ Examples\n\n### 🎯 Basic Usage\n\nWithout specifying a port (default port 25565):\n\n```bash\n./slpcli mc.hypixel.net\n```\n\nSpecifying a port:\n\n```bash\n./slpcli 23.230.3.162:25572\n```\n\nSpecifying a port (option 2):\n\n```bash\n./slpcli 23.230.3.162 25572\n```\n\nReal example for Hypixel, prettified with [`jq`](https://jqlang.org/):\n\n```bash\n$ ./slpcli --silent mc.hypixel.net | jq .\n{\n  \"version\": {\n    \"name\": \"Requires MC 1.8 / 1.21\",\n    \"protocol\": 47\n  },\n  \"players\": {\n    \"max\": 200000,\n    \"online\": 31198,\n    \"sample\": []\n  },\n  \"description\": \"                §aHypixel Network §c[1.8-1.21]\\n     §6§lSB 0.23.1 §2§lFORAGING §8§l- §e§lSUMMER EVENT\",\n  \"favicon\": \"\u003ctrimmed for GitHub\u003e\"\n}\n```\n\nVideo example:\n[![asciicast](https://asciinema.org/a/pqljUYpBR9wftuD28h2sE4VCz.svg)](https://asciinema.org/a/pqljUYpBR9wftuD28h2sE4VCz)\n\n### 🔍 Extracting Data with jq\n\nDisplay the number of online players using [`jq`](https://jqlang.org/):\n\n```bash\n./slpcli -s purpleprison.net | jq '.players.online'\n# Output: 438\n```\n\n### 🖼️ Displaying Server Favicon\n\nUse chained bash commands with [`feh`](https://github.com/derf/feh) to display the server favicon:\n\n```bash\n./slpcli mc.hypixel.net -s | jq .favicon -r | cut -d, -f2 | base64 -d | feh -\n```\n\nSave favicon as an image file:\n\n```bash\n./slpcli mc.hypixel.net -s | jq .favicon -r | cut -d, -f2 | base64 -d \u003e favicon.png\n```\n\n### 🤫 Quiet Mode\n\nThe `-s` or `--silent` option suppresses diagnostic messages, outputting only the raw JSON payload or an empty string upon error. Useful for shell pipelines.\n\n---\n\n## 📦 Installation\n\n\u003e [!WARNING]\n\u003e The project is currently **only** available on Arch Linux's User Repository (AUR). On other distributions and OSes you will have to build it manually or download a binary from the [Releases](https://github.com/Urpagin/slpcli/releases).\n\nYou have two main ways to install `slpcli` on Arch Linux:\n\n1. Use your favorite AUR helper like [`yay`](https://github.com/Jguer/yay) or [`paru`](https://github.com/Morganamilo/paru):\n\n```bash\nyay -S slpcli-git\n```\n\n2. Install directly from the `PKGBUILD` file:\n\n```bash\nsudo pacman -S --needed git base-devel\ngit clone --recursive https://github.com/Urpagin/slpcli.git\ncd slpcli/arch-pkg\nmakepkg -si\n```\n\n## 🏗️ Building\n\nUse the provided `run_debug.sh` script or build manually.\n\n### Manual Build\n\n```bash\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake -j$(nproc)\n```\n\n*(To be improved later.)*\n\n---\n\n## 💻 Compatibility\n\n### Platforms 🌐\n\n*Cross platform thanks to Asio*\n\n| OS      | Compatibility |\n| ------- | ------------- |\n| Linux   | ✅ YES         |\n| macOS   | ✅ YES         |\n| Windows | ✅ YES         |\n\n\u003e [!NOTE]\n\u003e Manual build required on macOS and Windows. On Arch Linux you can use the AUR package.\n\n### 📐 C++ Version\n\n* Requires C++23 or newer.\n\n---\n\n## 📖 Integrating SLP Code in Your C++ Project\n\nStarting from a basic project structure:\n\n**main.cpp**\n\n```cpp\nint main() {\n    return 0;\n}\n```\n\n**CMakeLists.txt**\n\n```cmake\ncmake_minimum_required(VERSION 3.24)\nproject(myapp)\n\nadd_executable(myapp main.cpp)\n```\n\n### 🚩 Steps\n\n1. 📥 Clone the repository (**do not omit `--recursive`**):\n\n```bash\ngit clone --recursive https://github.com/Urpagin/slpcli.git\n```\n\n2. 🔗 Link the library in your project's `CMakeLists.txt`:\n\n```cmake\ncmake_minimum_required(VERSION 3.24)\nproject(myapp)\n\n# Include SLP library\nadd_subdirectory(slpcli/libs/slp)\n\nadd_executable(myapp main.cpp)\n\n# Link SLP library\ntarget_link_libraries(myapp PRIVATE slp)\n```\n\n3. 📝 Use the library in your project:\n\n```cpp\n#include \u003ciostream\u003e\n#include \"slp.h\"\n\nint main() {\n    auto ping = slp(\"mc.hypixel.net\");\n    auto response = ping.query_slp();\n    std::cout \u003c\u003c response \u003c\u003c std::endl;\n    return 0;\n}\n```\n\n4. 🏭 Build and run:\n\n```bash\nmkdir -p build \u0026\u0026 cd build\ncmake ..\nmake -j$(nproc)\n./myapp\n```\n\n---\n\n## ⚠️ Known Issues\n\n### 🔢 VarInt handling\n\nWe are storing `VarInt`s as a 32-bit signed integer, however, a `VarInt` is defined in the protocol with a maximum of 5 bytes, which is 35 bits.\nI think this means I am not spec-compliant, but with the packets we're handling, I don't think it matters.\n\n## TODO\n\n* Remove the small overhead of launching a new thread with `std::thread` by using an Asio-native solution (see [Timeouts](https://think-async.com/Asio/asio-1.30.2/doc/asio/examples/cpp11_examples.html)) / [Source Code](https://github.com/chriskohlhoff/asio/tree/master/asio/src/examples/cpp11/timeouts). (in progress in the `devel` branch)\n* Add support for Bedrock Edition?\n* Add a thread pool and async requests to check a text file for online MC servers. (in progress in the `devel` branch)\n* Maybe adding CL11 as a submodule isn't clever. If it works now, why not update it?\n* Take into account SRV records so that FINALLY hypixel.net and any other domain (that have SRV records) actually work. (in progress in the `devel` branch)\n---\n\n## Why not Rust?\n\nI objectively think Rust would be better for this project. But I also think C++ is awesome and deserves some love, it is also funny how easily I can shoot myself in the foot, thrilling.\n\n## 📚 References \u0026 Acknowledgments\n\n* [Minecraft Protocol](https://minecraft.wiki/w/Java_Edition_protocol/)\n\n* [Server List Ping Protocol](https://minecraft.wiki/w/Java_Edition_protocol/Server_List_Ping)\n\n* [Packet Format](https://minecraft.wiki/w/Java_Edition_protocol/Packets)\n\n* [String Format](https://minecraft.wiki/w/Java_Edition_protocol/Data_types#Type:String)\n\n* [VarInt Logic](https://minecraft.wiki/w/Java_Edition_protocol/Packets#VarInt_and_VarLong)\n\n* [ASIO library for socket programming](https://think-async.com/Asio/)\n\n* [CLI11 for CLI parsing](https://github.com/CLIUtils/CLI11)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furpagin%2Fslpcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furpagin%2Fslpcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furpagin%2Fslpcli/lists"}