{"id":16751734,"url":"https://github.com/jakoch/csgo-cli","last_synced_at":"2025-03-17T02:31:10.450Z","repository":{"id":36154753,"uuid":"119075275","full_name":"jakoch/csgo-cli","owner":"jakoch","description":"CS:GO Console shows your user account, stats and latest matches. It also uploads demo sharecodes to csstats.gg.","archived":false,"fork":false,"pushed_at":"2024-07-10T17:03:22.000Z","size":113160,"stargazers_count":35,"open_issues_count":4,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-27T16:43:43.030Z","etag":null,"topics":["counter-strike","counter-strike-global-offensive","cs-go","csgo","csgo-protobufs","csstats","steam","steam-api"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakoch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-01-26T16:27:58.000Z","updated_at":"2025-01-07T17:03:14.000Z","dependencies_parsed_at":"2024-10-27T11:52:33.728Z","dependency_job_id":"5abc483e-a5d8-4bab-a8c3-afc182032d79","html_url":"https://github.com/jakoch/csgo-cli","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakoch%2Fcsgo-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakoch%2Fcsgo-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakoch%2Fcsgo-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakoch%2Fcsgo-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakoch","download_url":"https://codeload.github.com/jakoch/csgo-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243837010,"owners_count":20355813,"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":["counter-strike","counter-strike-global-offensive","cs-go","csgo","csgo-protobufs","csstats","steam","steam-api"],"created_at":"2024-10-13T02:44:45.484Z","updated_at":"2025-03-17T02:31:08.605Z","avatar_url":"https://github.com/jakoch.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csgo-cli ![GitHub Release](https://img.shields.io/github/v/release/jakoch/csgo-cli?style=flat-square\u0026label=Latest%20Release) [![License](https://img.shields.io/github/license/jakoch/csgo-cli.svg)](https://github.com/jakoch/csgo-cli/blob/main/LICENSE)\n\nThis console tool enables you to output pieces of information about your CS:GO user profile and latest matches.\nYou can also use the tool to upload demo sharecodes to https://csstats.gg/ (formerly csgostats.gg).\n\n| Branch | CI | Code Quality | Spell Check |\n|--------|----|--------------|-------------|\n| [![Version](https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/jakoch/csgo-cli/main/vcpkg.json\u0026label=Dev%20Version%20(main)\u0026query=$[%27version%27]\u0026color=blue)](https://github.com/jakoch/csgo-cli/releases/latest) | [![Build](https://github.com/jakoch/csgo-cli/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/jakoch/csgo-cli/actions/workflows/build.yml) | [![C++ Quality](https://github.com/jakoch/csgo-cli/actions/workflows/cpp-quality.yml/badge.svg)](https://github.com/jakoch/csgo-cli/actions/workflows/cpp-quality.yml) | [![Spell Check](https://github.com/jakoch/csgo-cli/actions/workflows/check-spelling.yml/badge.svg)](https://github.com/jakoch/csgo-cli/actions/workflows/check-spelling.yml)\n\n## Installation\n\nThe installation is easy. It's just a zipped folder containing the application.\n\nDownload the zip file, extract it to a location of your choice and then run the app.\n\n- Download the latest release of `csgo-cli-vX.Y.Z.zip` from Github: https://github.com/jakoch/csgo-cli/releases/latest\n- Extract the zip file. Switch to the \"csgo_cli\" folder.\n- Then run `csgo_cli` on the command-line interface or just run `update.bat` to upload your recent matches.\n\n## Requirements\n\n- Windows\n- Steam application running\n- CS:GO application not running\n\n## Usage\n\nDisplay commands:\n\n```bash\ncsgo_cli\n```\n\nOutput:\n\n```bash\ncsgo_cli v1.0.3, https://github.com/jakoch/csgo-cli\nCopyright (c) 2018-2019 Jens A. Koch.\n\n    CS:GO Console shows your user account, stats and latest matches.\n    You can also use the tool to upload demo sharecodes to csgostats.gg.\n\nUsage:\n    command [options] [arguments]\n\nAvailable commands:\n    -user           Show your profile (SteamID, AccountID, MM-Rank, Likes, VAC-Status)\n    -matches        Show your past matches in table form\n    -upload         Upload your past matches to csgostats.gg\n    -s, sharecode   Upload a demo sharecode to csgostats.gg\n\nOptions:\n    -h, help        Display this help message\n    -v, verbose     Increase verbosity of messages\n    -V, Version     Display application version\n```\n\nFetch matches and upload to csgostats (or just use `update.bat`):\n\n```bash\ncsgo_cli -matches -upload\n```\n\nIf you encounter any issues, please use the verbose mode for debugging purposes:\n\n```bash\ncsgo_cli -matches -upload -verbose\n```\n\n## How does this work internally?\n\nThe tool connects to your running Steam as CS:GO game client (SteamApp 730).\nIt communicates with the Steam API to request the serialized player and match infos.\nThe structure of the serialized data is described by the csgo-protobufs.\nThese infos are then deserialized using Protobuf and placed into\niterable objects for further processing and output.\n\n#### Automatic Upload of Demo ShareCodes to http://csgostats.gg/\n\nThe ShareCode is an URL, which you might pass around to your friends.\n\nIt looks like so: steam://rungame/730/76561202255233023/+csgo_download_match%20CSGO-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx\n\nIf you click on this URL or open it in a browser tab it will tell Steam to launch CS:GO,\nautomatically download the demo and open it for replay.\nThe code at the end of the URL is the id of the match.\n\nThe tool requests your latest matches and builds the ShareCodes for the demos.\nThe ShareCodes are then automatically uploaded to https://csgostats.gg/\n\nThis avoids the manual posting of the sharecode via the csgostats webinterface\nor the posting to the csgostats steam group, where the bots pick it up.\nhttps://csgostats.gg/getting-the-sharecode\n\n##### Development Notes: ShareCode Uploading to csgostats.gg\n\nThe file containing the logic for uploading the ShareCode is ShareCodeUpload.cpp.\n\nuploadShareCode() uses cURL to POST the ShareCode.\nPosting data to csgostats.gg is difficult because the server is Cloudflare protected.\nEven normal browsing behavior can trigger a cloudflare redirect to a captcha page or a website ban.\n\nBefore we can POST one or multiple sharecodes, a GET request to csgostats.gg is needed to get a cURL connection handle, including all relevant cookies.\nThe cURL handle is then re-used for one or more POST requests (sending the cookies as header data and the sharecode(s) as post data).\n\nThe response is then parsed by processJsonResponse().\nThere are 4 response possibilities:\nThere is a HTML response by Cloudflare, the HTML captcha page.\nThere are 3 JSON response types by csgostats.gg: error, queued, complete. See testProcessJsonResponse()\n\nFor testing purposes: Posting a ShareCode to csgostats.gg using cURL on the CLI\n - `curl \"https://csgostats.gg/match/upload/ajax\" -H \"accept-language: en\" -H \"content-type: application/x-www-form-urlencoded; charset=UTF-8\" -H \"accept: application/json, text/javascript, */*; q=0.01\" -H \"x-requested-with: XMLHttpRequest\" --data \"sharecode=CSGO-WSACM-qX5Gv-ikbi3-Z6uOW-TGwPB\u0026index=0\"`\n\n## Dependencies\n\n- [Steamworks SDK](https://partner.steamgames.com/) [API Docs](https://partner.steamgames.com/doc/sdk/api)\n  - The official Steamworks SDK is used for making the Steam API connection and requesting data.\n- [Google Protobuf](https://developers.google.com/protocol-buffers/)\n  - A language-neutral, platform-neutral, extensible mechanism for serializing structured data.\n  - Protobuf is used for deserializing the player and match infos.\n- [CS:GO Protobufs](https://github.com/SteamDatabase/Protobufs/tree/master/csgo)\n  - The csgo-protobufs are provided by the [steamdb.info](https://steamdb.info/) project.\n  - The Protobuf Compiler (protoc) is used during the build process to compile the csgo-protobufs to C++ objects for data access.\n- [nlohmann/json](https://github.com/nlohmann/json)\n  - nlohmann/json is used to parse the JSON responses from the csgostats server (error, complete, queued).\n- [ConsoleTable](https://github.com/766F6964/ConsoleTable) (inside /src)\n  - ConsoleTable is used to print tables to the console.\n- [Curl](https://github.com/curl/curl)\n  - libcurl is used for transferring data.\n- [CMake](https://cmake.org/)\n  - CMake is used as build tool.\n- [Github Actions](https://docs.github.com/en/actions)\n  - Github Actions is used as build and deployment service.\n\n##### Release Checklist\n\nBefore releasing a new version:\n\n- [ ] Update Version number in vcpkg.json\n- [ ] Update CHANGELOG.md\n\n# Todo\n\n- [x] CI setup\n  - [x] cmake\n  - [x] ~appveyor.yaml~ - switched to Github Actions @ 09/2021\n    - [x] ~VC15 x64~\n  - [x] added Github Actions (./github/workflows)\n    - [x] MSVC22 - VC17 - x64-windows-static\n- [x] vendor dependencies\n  - [x] steam sdk\n    - [x] encrypt\n    - [x] decrypt via env secret\n  - [x] protobuf\n  - [x] cs:go protobufs\n    - [x] patch cs:go protobuf syntax\n  - [x] curl\n  - [x] ~rapidjson~\n  - [x] nlohmann-json\n  - [x] fmt\n  - [x] spdlog\n- [x] package and deploy the application\n- [x] package and deploy the dependencies\n  - [x] exclude sw_sdk (not redistributable), ship encrypted version\n- [x] connect as CSGO GameClient to Steam\n- [x] fetch player info\n  - [x] calculate steamids\n- [x] fetch latest matches\n  - [x] calculate demo share-codes\n- [x] upload demo share-codes to csgostats.gg\n  - [x] curl based share-code uploader\n  - [x] ~rapid-json based response parser~\n  - [x] nlohmann-json based response parser\n- [x] to avoid re-posting sharecodes (ShareCodeCache)\n- [ ] store matches locally (json, cvs, sqlite)\n- [ ] request additional steam profile data via web-api\n- [ ] colors on the CLI (LOSS red, WIN green)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakoch%2Fcsgo-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakoch%2Fcsgo-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakoch%2Fcsgo-cli/lists"}